Open bohare opened 3 years ago
Just replace icboard
by the keyword of the City Scape dataset, probably cityscape
@bohare Hi were you able to test using test.py? Can you please share your test.py command? I am trying 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'
I get the following error:
File "test.py", line 122, in <module>
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
@bohare Hi were you able to test using test.py? Can you please share your test.py command? I am trying 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'
I get the following error:
File "test.py", line 122, in <module> 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
The dataset is hardcoded by
icboard
in this line https://github.com/PingoLH/FCHarDNet/blob/fc4b854b5cfa01a449bcfaece6bb3c32d84d9e2b/test.py#L16 You must replaceicboard
withargs.dataset
. The list of available dataset names is in this file by available keys in https://github.com/PingoLH/FCHarDNet/blob/fc4b854b5cfa01a449bcfaece6bb3c32d84d9e2b/ptsemseg/loader/__init__.py#L18
@bohare Hi were you able to test using test.py? Can you please share your test.py command? I am trying 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'
I get the following error:File "test.py", line 122, in <module> 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
The dataset is hardcoded by
icboard
in this linehttps://github.com/PingoLH/FCHarDNet/blob/fc4b854b5cfa01a449bcfaece6bb3c32d84d9e2b/test.py#L16
You must replace
icboard
withargs.dataset
. The list of available dataset names is in this file by available keys in
This is only part of the problem. The argument of [root]
(https://github.com/PingoLH/FCHarDNet/blob/fc4b854b5cfa01a449bcfaece6bb3c32d84d9e2b/test.py#L18) needs to be changed to point to the Cityscapes directory since the DataLoader initializes its attributes using this variable. Having changed the argument value from None
to the Cityscapes data directory combined with your suggestion, I was able to test the script.
@bohare @cao-nv Thanks for the reply. I am a little confused. You mentioned I need to point root to the Cityscapes data directory. So does FCHarDNet/test.py require the Cityscape data directory to operate even if I am testing/inferring on my own images? Also is there a specific Cityscape dataset that it requires? There are quite a few cityscapes dataset at their download site. And is a specific directory structure required? Thanks, Jon
@bohare @cao-nv Thanks for the reply. I am a little confused. You mentioned I need to point root to the Cityscapes data directory. So does FCHarDNet/test.py require the Cityscape data directory to operate even if I am testing/inferring on my own images? Also is there a specific Cityscape dataset that it requires? There are quite a few cityscapes dataset at their download site. And is a specific directory structure required? Thanks, Jon
Actually, the test code requires the dataset name to decode segmentation outputs to the proper color map. However, you still have to point to the folder of the specified dataset.
Hello, thanks for your work.
I would like to use
test.py
to run inference on a folder of images without having to download entire Cityscapes dataset. Is it possible to do this?Currently, when I try to do it, I get the following error:
Thanks for your help.