Skip to content

Commit 3b407e7

Browse files
author
yxdragon
committed
rename
1 parent a0b8633 commit 3b407e7

6 files changed

Lines changed: 6 additions & 5 deletions

File tree

demo/hed_edge_detector/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import sys
2+
sys.path.append('../../')
13
from cnnumpy import read_onnx
24
import numpy as np
35
from matplotlib import pyplot as plt
@@ -24,7 +26,6 @@ def normal(img):
2426
img = makesize8(img)
2527
x = normal(img).transpose(2, 0, 1)[None, :, :, :].copy()
2628

27-
2829
# 2 files needed, hed.txt, hed.npy
2930
net = read_onnx('hed')
3031
y = net(x)
File renamed without changes.

cnnumpy/io.py renamed to npcnn/io.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def read_onnx(path):
4242
with open(path+'.txt') as f:
4343
cont = f.read()
4444
for i in res: cont = i.sub(parse, cont)
45-
#for i in cont.split('\n'): print(i)
45+
# for i in cont.split('\n'): print(i)
4646
cont = [eval(i) for i in cont.split('\n') if len(i)>0 and i[0]=='[']
4747
cont = [[eval(j) if (',' in j) else j for j in i] for i in cont]
4848

@@ -58,7 +58,7 @@ def read_onnx(path):
5858
flow.append((i[4][0], ['conv_%s'%num], i[0]))
5959
elif i[1]=='Gemm':
6060
num = len(body)
61-
body.append(('dense_%s'%num, 'dense', key[i[2][1][::-1]]))
61+
body.append(('dense_%s'%num, 'dense', key[i[2][1]]))
6262
flow.append((i[2][0], ['dense_%s'%num], i[0]))
6363
elif i[1]=='Sigmoid':
6464
num = len(body)
@@ -93,8 +93,8 @@ def read_onnx(path):
9393
body.append(('flatten_%s'%num, 'flatten', None))
9494
flow.append((i[2], ['flatten_%s'%num], i[0]))
9595

96-
#for i in body: print(i)
97-
#for i in flow: print(i)
96+
# for i in body: print(i)
97+
# for i in flow: print(i)
9898

9999
net = Net()
100100
net.load_json(body, flow)
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)