FewShotDetection icon indicating copy to clipboard operation
FewShotDetection copied to clipboard

how to visualize the detection results?

Open HuangLian126 opened this issue 5 years ago • 11 comments
trafficstars

HuangLian126 avatar Nov 02 '20 08:11 HuangLian126

Hi @HuangLian126

You can run test.py with args --vis, then the visualisation is on.

YoungXIAO13 avatar Nov 02 '20 08:11 YoungXIAO13

Hi @HuangLian126

You can run test.py with args --vis, then the visualisation is on.

Sorry to bother you, I also wanted to see the visual results during the test, but there was an error: File "/home/xxx/FewShotDetection-master/test.py", line 335, in im = cv2.imread(imdb.image_path_from_index(int(data[4]))) File "/home/xxx/FewShotDetection-master/lib/datasets/pascal_voc.py", line 93, in image_path_from_index image_path = os.path.join(self._data_path, 'JPEGImages', index + self._image_ext) TypeError: unsupported operand type(s) for +: 'int' and 'str' When the second error message is located, there is no problem running debug. I don’t know the reason. If you have encountered it, please let me know.

NHW2017 avatar Nov 18 '20 10:11 NHW2017

No description provided.

Did you successfully get the visual result?

NHW2017 avatar Nov 18 '20 10:11 NHW2017

No description provided.

Did you successfully get the visual result?

No description provided.

Did you successfully get the visual result?

Yes, I successfully get the visual result. You can check your Pytorch version.

HuangLian126 avatar Nov 18 '20 11:11 HuangLian126

Hi @NHW2017 ,

I think your problem comes from this line: image_path = os.path.join(self._data_path, 'JPEGImages', index + self._image_ext)

Could you try modify it as: image_path = os.path.join(self._data_path, 'JPEGImages', str(index) + self._image_ext) to see if the issue is resolved?

YoungXIAO13 avatar Nov 18 '20 11:11 YoungXIAO13

Hi @NHW2017 ,

I think your problem comes from this line: image_path = os.path.join(self._data_path, 'JPEGImages', index + self._image_ext)

Could you try modify it as: image_path = os.path.join(self._data_path, 'JPEGImages', str(index) + self._image_ext) to see if the issue is resolved?

No, I have tried this modification, but a new error appears and the file path cannot be found

NHW2017 avatar Nov 18 '20 11:11 NHW2017

No description provided.

Did you successfully get the visual result?

No description provided.

Did you successfully get the visual result?

Yes, I successfully get the visual result. You can check your Pytorch version.

torch==0.4.0?

NHW2017 avatar Nov 18 '20 11:11 NHW2017

Then I think you might need to check the dataset is well downloaded as structured as suggested

YoungXIAO13 avatar Nov 18 '20 11:11 YoungXIAO13

@NHW2017 torch==0.4, torchvision==0.21

HuangLian126 avatar Nov 18 '20 11:11 HuangLian126

Then I think you might need to check the dataset is well downloaded as structured as suggested

I don't quite understand, because I had no problems during training and testing, but this error occurred during --vis, so I think the error is not due to the configuration of the data set

NHW2017 avatar Nov 18 '20 11:11 NHW2017

@NHW2017 torch==0.4, torchvision==0.21

Which version of python do you use and whether you have modified other parts of the code?

NHW2017 avatar Nov 18 '20 11:11 NHW2017