未验证 提交 ca5308c9 编写于 作者: mikeshi1980's avatar mikeshi1980 提交者: GitHub

make predict_det.py work on windows (#1236)

* make predict_det.py work on windows
上级 2ffbece7
...@@ -177,7 +177,7 @@ if __name__ == "__main__": ...@@ -177,7 +177,7 @@ if __name__ == "__main__":
text_detector = TextDetector(args) text_detector = TextDetector(args)
count = 0 count = 0
total_time = 0 total_time = 0
draw_img_save = "./inference_results" draw_img_save = os.path.join(".", "inference_results")
if not os.path.exists(draw_img_save): if not os.path.exists(draw_img_save):
os.makedirs(draw_img_save) os.makedirs(draw_img_save)
for image_file in image_file_list: for image_file in image_file_list:
...@@ -193,8 +193,8 @@ if __name__ == "__main__": ...@@ -193,8 +193,8 @@ if __name__ == "__main__":
count += 1 count += 1
print("Predict time of %s:" % image_file, elapse) print("Predict time of %s:" % image_file, elapse)
src_im = utility.draw_text_det_res(dt_boxes, image_file) src_im = utility.draw_text_det_res(dt_boxes, image_file)
img_name_pure = image_file.split("/")[-1] img_name_pure = os.path.split(image_file)[-1] # image_file.split("/")[-1]
cv2.imwrite( img_path = os.path.join(draw_img_save, "det_res_%s" % img_name_pure)
os.path.join(draw_img_save, "det_res_%s" % img_name_pure), src_im) cv2.imwrite(img_path, src_im)
if count > 1: if count > 1:
print("Avg Time:", total_time / (count - 1)) print("Avg Time:", total_time / (count - 1))
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册