From 6c51bda6b49e378c904d200ae02157dbe6e0e03c Mon Sep 17 00:00:00 2001 From: makao007 Date: Thu, 10 Mar 2022 16:57:25 +0800 Subject: [PATCH] fix demo.py, missing output text folder error --- demo.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/demo.py b/demo.py index c646868..afb9206 100644 --- a/demo.py +++ b/demo.py @@ -26,6 +26,8 @@ def single_pic_proc(image_file): output_file = os.path.join(result_dir, image_file.split('/')[-1]) txt_file = os.path.join(result_dir, image_file.split('/')[-1].split('.')[0]+'.txt') print(txt_file) + if not os.path.isdir(os.path.dirname(txt_file)): + os.mkdir(os.path.dirname(txt_file)) txt_f = open(txt_file, 'w') Image.fromarray(image_framed).save(output_file) print("Mission complete, it took {:.3f}s".format(time.time() - t))