facebookresearch / Detectron

FAIR's research platform for object detection research, implementing popular algorithms like Mask R-CNN and RetinaNet.
Apache License 2.0
26.27k stars 5.45k forks source link

tools/infer_simple.py fail when input directory contains non-ascii characters #874

Open dmromanov opened 5 years ago

dmromanov commented 5 years ago

Expected results

No errors in console, successfully parsed images

Actual results

$ python tools/infer_simple.py     --cfg configs/12_2017_baselines/e2e_mask_rcnn_R-101-FPN_2x.yaml     --output-dir /tmp/detectron-visualizations     --image-ext jpg     --wts https://dl.fbaipublicfiles.com/detectron/35861858/12_2017_baselines/e2e_mask_rcnn_R-101-FPN_2x.yaml.02_32_51.SgT4y1cO/output/train/coco_2014_train:coco_2014_valminusminival/generalized_rcnn/model_final.pkl /tmp/пример
....
Traceback (most recent call last):
  File "tools/infer_simple.py", line 185, in <module>
    main(args)
  File "tools/infer_simple.py", line 139, in main
    im_list = glob.iglob(args.im_or_folder + '/*.' + args.image_ext)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 5: ordinal not in range(128)

Detailed steps to reproduce

  1. Create a directory with a name containing non-ascii characters, e.g. cyrillic. /tmp/пример
  2. Run demo script infer_simple.py
$ python tools/infer_simple.py     --cfg configs/12_2017_baselines/e2e_mask_rcnn_R-101-FPN_2x.yaml     --output-dir /tmp/detectron-visualizations     --image-ext jpg     --wts https://dl.fbaipublicfiles.com/detectron/35861858/12_2017_baselines/e2e_mask_rcnn_R-101-FPN_2x.yaml.02_32_51.SgT4y1cO/output/train/coco_2014_train:coco_2014_valminusminival/generalized_rcnn/model_final.pkl /tmp/пример

System information

jewelcai commented 5 years ago

Have you solved this issue?

dmromanov commented 5 years ago

No, this is still an issue.