- https://www.buymeacoffee.com/boninall
- https://boninall.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class mapForNotePlugin extends Plugin { | |
//... | |
public activeMapForNoteView: MapForNote = null; | |
async onload(): Promise<void> { | |
//... | |
this.registerEventListeners(); | |
} | |
//... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import numpy as np | |
from PIL import Image | |
FILEPATH = path_to_img # 检测文件地址 | |
MODELPATH = path_to_pb_file # pb文件 | |
SIZE = [100, 100] # 检测图片规格 | |
DIC = {0: 'aaa', 1: 'bbb'} # 定义字典,保存标签和类别的映射关系 | |
# 图片转化为数组 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def load_pb(path_to_pb): | |
with tf.gfile.GFile(path_to_pb, "rb") as f: | |
graph_def = tf.GraphDef() | |
graph_def.ParseFromString(f.read()) | |
with tf.Graph().as_default() as graph: | |
tf.import_graph_def(graph_def, name='') | |
return graph | |
#你可以检索感兴趣的张量 | |
input = graph.get_tensor_by_name('input:0') |
NewerOlder