PingoLH / FCHarDNet

Fully Convolutional HarDNet for Segmentation in Pytorch
MIT License
195 stars 52 forks source link

Test Pretrain model for single image #40

Open Mps24-7uk opened 4 years ago

Mps24-7uk commented 4 years ago

Thanks for an amazing repository.

How can I test the result with Cityscapes pre-trained weights for the single image?

huang45 commented 4 years ago

Same question, pls help~

jfhauris commented 3 years ago

@PingoLH @Mps24-7uk @huang45 I have same issue.

I am trying to use test.py to test a single (or couple of) images. Can you share a typical test.py command line to do this? I am using the following but it is not working: python test.py --model_path '/home/arl/Documents/FCHARDNET/FCHarDNet-master/ptsemseg/models/hardnet.py' --dataset 'cityscapes' --input '/home/arl/Documents/FCHARDNET/FCHarDNet-master/test_image/index.jpeg' --output '/home/arl/Documents/FCHARDNET/FCHarDNet-master/test_image/index_output.jpeg' In particular what should the --model_path point to? hardnet.py? or the weights *.pkl? Also why does --dataset point to cityscapes if I am trying to test my own data?

I get the following error:

File "test.py", line 122, in test(args) File "test.py", line 39, in test device, model, loader = init_model(args) File "test.py", line 24, in init_model test_mode=True File "/home/arl/Documents/FCHARDNET/FCHarDNet-master/ptsemseg/loader/cityscapes_loader.py", line 82, in init self.images_base = os.path.join(self.root, "leftImg8bit", self.split) File "/home/arl/anaconda3/envs/rgbsemseg/lib/python3.6/posixpath.py", line 80, in join a = os.fspath(a) TypeError: expected str, bytes or os.PathLike object, not NoneType