SHI-Labs / OneFormer

OneFormer: One Transformer to Rule Universal Image Segmentation, arxiv 2022 / CVPR 2023
https://praeclarumjj3.github.io/oneformer
MIT License
1.39k stars 129 forks source link

Output path in demo.py #69

Open gagson opened 1 year ago

gagson commented 1 year ago

Hi there, Appreciate you effort in research work of OneFormer.

I have tried your demo.py code recently and noticed there is some problem of creating an output.

My command was: python demo.py --input input_img.jpg \ --output ../outputs/semantic_output1.jpg \ --task semantic \ --opts MODEL.IS_TRAIN False MODEL.IS_DEMO True MODEL.WEIGHTS ../weights/swin_large_patch4_window12_384_22k.pkl

It turns out your code seems to add a semantic_inference folder before the desired path and gave an error:

FileNotFoundError: [Errno 2] No such file or directory: 'semantic_inference/../outputs/semantic_output1.jpg'

If I change my command into ... --output semantic_out1.jpg, the error would be eliminated and the file will be saved to be semantic_inference/semantic_out1.jpg.

Not quite a big deal but just to report the found error. Looking forward to any update of your work.

praeclarumjj3 commented 1 year ago

Hi @gagson, thanks for pointing this out! I'll take a look and update the code accordingly.