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))