Skip to content

Commit ed9cd3c

Browse files
committed
minor chnages in demo.py so only images in the specified directory (not deeper)
gets ran
1 parent 984ab41 commit ed9cd3c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

demo.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import torch.utils.data
88
import numpy as np
99
from opt import opt
10+
from glob import glob
1011

1112
from dataloader import ImageLoader, DetectionLoader, DetectionProcessor, DataWriter, Mscoco
1213
from yolo.util import write_results, dynamic_write_results
@@ -36,8 +37,10 @@
3637
if len(inputlist):
3738
im_names = open(inputlist, 'r').readlines()
3839
elif len(inputpath) and inputpath != '/':
39-
for root, dirs, files in os.walk(inputpath):
40-
im_names = files
40+
# @kanazawa: only run on images in the directory.
41+
im_names = sorted(glob(inputpath + '/*.png'))
42+
# for root, dirs, files in os.walk(inputpath):
43+
# im_names = files
4144
else:
4245
raise IOError('Error: must contain either --indir/--list')
4346

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ pandas
66
tqdm
77
matplotlib
88
opencv-python
9-
ntpath
9+
#ntpath

0 commit comments

Comments
 (0)