Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions FinalVer/capsule_inspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ def train(opech, is_continnue_train=False):
if is_continnue_train:
# 装载checkpoint
savemodel = tf.train.latest_checkpoint('./model/')
saver.restore(sess, savemodel)
if not savemodel is None:
saver.restore(sess, savemodel)
for i in range(opech):
str_ing = 'lr=' + str(learning_rate) + '迭代=' + str(opech)

Expand Down Expand Up @@ -340,9 +341,9 @@ def tes_part(imagedir):
elif maxindex == 1:
return '凹陷'
elif maxindex == 2:
return '帽子'
return '缺帽子'
elif maxindex == 3:
return '身体'
return '缺身体'

# 摄像头拍照并预测
def video_test():
Expand Down Expand Up @@ -390,7 +391,7 @@ def video_test():
train(400, is_continnue_train=True)


# 文件夹所有内容测试
#文件夹所有内容测试
# for root, dirs, files in os.walk('D:/Image/test/'):
# for filename in files:
# filepath = os.path.join(root, filename) # 获取文件地址
Expand Down