Skip to content

Commit

Permalink
minor chnages in demo.py so only images in the specified directory (n…
Browse files Browse the repository at this point in the history
…ot deeper)

gets ran
  • Loading branch information
akanazawa committed May 2, 2019
1 parent 984ab41 commit ed9cd3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import torch.utils.data
import numpy as np
from opt import opt
from glob import glob

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

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ pandas
tqdm
matplotlib
opencv-python
ntpath
#ntpath

0 comments on commit ed9cd3c

Please sign in to comment.