Spaces:
Runtime error
Runtime error
Update tools/demo.py
Browse files- tools/demo.py +2 -0
tools/demo.py
CHANGED
|
@@ -52,6 +52,7 @@ def run_image(runner,
|
|
| 52 |
score_thr,
|
| 53 |
nms_thr,
|
| 54 |
image_path='./work_dirs/demo.png'):
|
|
|
|
| 55 |
image.save(image_path)
|
| 56 |
texts = [[t.strip()] for t in text.split(',')] + [[' ']]
|
| 57 |
data_info = dict(img_id=0, img_path=image_path, texts=texts)
|
|
@@ -202,6 +203,7 @@ if __name__ == '__main__':
|
|
| 202 |
if args.cfg_options is not None:
|
| 203 |
cfg.merge_from_dict(args.cfg_options)
|
| 204 |
|
|
|
|
| 205 |
if args.work_dir is not None:
|
| 206 |
cfg.work_dir = args.work_dir
|
| 207 |
elif cfg.get('work_dir', None) is None:
|
|
|
|
| 52 |
score_thr,
|
| 53 |
nms_thr,
|
| 54 |
image_path='./work_dirs/demo.png'):
|
| 55 |
+
os.makedirs('./work_dirs', exist_ok=True)
|
| 56 |
image.save(image_path)
|
| 57 |
texts = [[t.strip()] for t in text.split(',')] + [[' ']]
|
| 58 |
data_info = dict(img_id=0, img_path=image_path, texts=texts)
|
|
|
|
| 203 |
if args.cfg_options is not None:
|
| 204 |
cfg.merge_from_dict(args.cfg_options)
|
| 205 |
|
| 206 |
+
os.makedirs('./work_dirs', exist_ok=True)
|
| 207 |
if args.work_dir is not None:
|
| 208 |
cfg.work_dir = args.work_dir
|
| 209 |
elif cfg.get('work_dir', None) is None:
|