Skip to content

Instantly share code, notes, and snippets.

View Quorafind's full-sized avatar
💭
Next plugin: Outliner.md

Boninall Quorafind

💭
Next plugin: Outliner.md
View GitHub Profile
@Quorafind
Quorafind / index.ts
Last active January 7, 2023 13:24
Obsidian Plugin Register Keymap for LeafView
export default class mapForNotePlugin extends Plugin {
//...
public activeMapForNoteView: MapForNote = null;
async onload(): Promise<void> {
//...
this.registerEventListeners();
}
//...
@Quorafind
Quorafind / loadModelAndCheck.py
Last active July 20, 2019 02:40
加载.pb文件并检测
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'} # 定义字典,保存标签和类别的映射关系
# 图片转化为数组
@Quorafind
Quorafind / loadModel.py
Last active July 20, 2019 02:35
加载.pb文件
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')