Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predict my own dataset #6

Open
mvstu opened this issue Oct 12, 2024 · 4 comments
Open

Predict my own dataset #6

mvstu opened this issue Oct 12, 2024 · 4 comments

Comments

@mvstu
Copy link

mvstu commented Oct 12, 2024

Hello, thank you for your excellent work and sharing!
May I ask if I am able to predict my own data and how to handle the pkl file obtained? Thank you!

@zhenghaohu
Copy link
Contributor

Thank you for your attention. Regarding predicting your own data, you can refer to the relevant tutorials of MMDetection to organize your data in COCO format, modify the corresponding test data parameters in the configs file, and then run the test script. As for how to process the predicted .pkl file, you can refer to the relevant code in tools/bonai/bonai_evaluation.py.

@mvstu
Copy link
Author

mvstu commented Oct 14, 2024

Thank you for your patient answer!
Also, may I ask a question? Is it okay if my test image is not labeled? So, using the training model from Beijing and Xi'an to predict my data? At the same time, when I was running your test script, I was missing the file 'bonai_sthanghai_xian_test_roof.json'. I checked the data and the original file 'bonai/bonai_ievalation-py', but I only have the file 'bonai_sthanghai_xian_test.json'. May I ask why this is happening? How can I obtain this file? Thank you for your answer!

@zhenghaohu
Copy link
Contributor

  • If the data is unlabeled, there are two ways to perform inference. The first way is to refer to the official inference tutorial from MMDetection, as we have not provided relevant code. The second way, which we adopt, is to construct a COCO format .json file containing only filenames without semantic annotations. This .json file is used to specify the files for testing. Then, you can run the test script without the --eval parameter, so it only performs prediction without evaluation, i.e., inference.
  • The "_roof" in bonai_shanghai_xian_test_roof.json means that the annotations such as 'segmentation' and 'bbox' in the file correspond to the roof, as the code by default reads annotation information from these two fields. Similarly, bonai_shanghai_xian_test_footprint.json contains annotations for the building's footprint. You can convert it based on the fields 'footprint_mask', 'footprint_bbox', 'roof_bbox', and 'roof_mask' in bonai_shanghai_xian_test.json.

@mvstu
Copy link
Author

mvstu commented Oct 14, 2024

Thank you for your detailed and patient answer!
Let me try it, thank you! Wishing you a happy life and smooth scientific research!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants