CSAILVision / semantic-segmentation-pytorch

Pytorch implementation for Semantic Segmentation/Scene Parsing on MIT ADE20K dataset
http://sceneparsing.csail.mit.edu/
BSD 3-Clause "New" or "Revised" License
4.96k stars 1.1k forks source link

Test on a folder got error. #226

Closed sibadakesi closed 4 years ago

sibadakesi commented 4 years ago
 if os.path.isdir(args.imgs[0]):   # Maybe args.imgs.
        imgs = find_recursive(args.imgs[0])
    else:
        imgs = [args.imgs]

and "find_recursive"

def find_recursive(root_dir):
    files = []
    filenames = os.listdir(root_dir)
    for filename in filenames:
        files.append(os.path.join(root_dir, filename))
    return files
owenzlz commented 4 years ago

if os.path.isdir(args.imgs): # Maybe args.imgs. imgs = find_recursive(args.imgs) else: imgs = [args.imgs]

Change to the above should work.