zcablii / SARDet_100K

Offical implementation of MSFA and release of SARDet_100K dataset for Large-Scale Synthetic Aperture Radar (SAR) Object Detection
Other
328 stars 25 forks source link

How can I start testing properly? #26

Closed System2c closed 1 month ago

System2c commented 1 month ago

I use ‘MSFA\tools\test.py’ to test SARDet100k datasets, python tools/test.py local_configs/SARDet/r50_dota_pretrain/fg_frcnn_dota_pretrain_sar_wavelet_r50.py checkpoints/fg_frcnn_dota_pretrain_sar_wavelet_r50/best_coco_bbox_mAP_epoch_12.pth --work-dir results/test/2 but an error message appears:

File "D:\Anaconda\envs\MSFA\lib\site-packages\pycocotools\coco.py", line 170, in getCatIds
    cats = self.dataset['categories']
KeyError: 'categories'

I guess the reason is the difference of SARDet100k and coco. Could you please tell me how to reorganize the SARDet100k dataset into COCO format?

zcablii commented 1 month ago

If you want to perform inference without ground truth (GT), please refer to inference.md or test.md. Your current command is actually evaluating the model, which requires an annotation file.

If you intend to perform evaluation, please ensure the integrity of your annotation file, including the file path and format. The error you're encountering is due to the missing 'categories' key in your annotation JSON file. You can refer to the provided train.json or val.json for the correct format.

System2c commented 1 month ago

Thanks for replying! I use the JSON file and it really works.

tbxmh commented 1 month ago

谢谢回复!我使用JSON文件,确实有效。 May I ask exactly how to do this? I am also unable to reason

System2c commented 1 month ago

谢谢回复!我使用JSON文件,确实有效。 May I ask exactly how to do this? I am also unable to reason

Actually, I am sorry that I didn't find test.json, Instead I use the JPEGImages of val and val.json to test. As zcablii said, we can refer to the provided train.json or val.json for the correct format if we want to use data without ground truth (GT). And I find the image_demo.py can help to test the dataset without GT.

tbxmh commented 1 month ago

Thanks for the reply. I haven't found the corresponding test.json either, and I haven't found the vol or train json files yet either; as for your right about using image_demo.py for inference, I'd be alerted to a strange error.

I'm not sure if my model weights are wrong or if I'm running the wrong command, here's what I'm running: python . /image_demo.py . /demo/demo.jpg local_configs/SARDet/r50_dota_pretrain/fg_frcnn_dota_pretrain_sar_wavelet_r50_1.py --weights . /work_dirs/fg_frcnn_dota_pretrain_sar_wavelet_r50/best_coco_bbox_mAP_epoch_12.pth --out-dir . /

------------------ 原始邮件 ------------------ 发件人: "zcablii/SARDet_100K" @.>; 发送时间: 2024年8月8日(星期四) 下午2:37 @.>; @.**@.>; 主题: Re: [zcablii/SARDet_100K] How can I start testing properly? (Issue #26)

谢谢回复!我使用JSON文件,确实有效。 May I ask exactly how to do this? I am also unable to reason

Actually, I am sorry that I didn't find test.json, Instead I use the JPEGImages of val and val.json to test. As zcablii said, we can refer to the provided train.json or val.json for the correct format if we want to use data without ground truth (GT). And I find the image_demo.py can help to test the dataset without GT.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

System2c commented 1 month ago

Thanks for the reply. I haven't found the corresponding test.json either, and I haven't found the vol or train json files yet either; as for your right about using image_demo.py for inference, I'd be alerted to a strange error. I'm not sure if my model weights are wrong or if I'm running the wrong command, here's what I'm running: python . /image_demo.py . /demo/demo.jpg local_configs/SARDet/r50_dota_pretrain/fg_frcnn_dota_pretrain_sar_wavelet_r50_1.py --weights . /work_dirs/fg_frcnn_dota_pretrain_sar_wavelet_r50/best_coco_bbox_mAP_epoch_12.pth --out-dir . /

It occurred to me that I had met the similar problem, which made me couldn't run the img_demo.py. I used this command: python . /image_demo.py . /demo/demo.jpg local_configs/SARDet/r50_dota_pretrain/fg_frcnn_dota_pretrain_sar_wavelet_r50_1.py --weights . /work_dirs/fg_frcnn_dota_pretrain_sar_wavelet_r50/best_coco_bbox_mAP_epoch_12.pth --out-dir . /

ValueError: unknown argument {'tokens_positive'} for 'preprocess', 'forward', 'visualize' and 'postprocess'

Then I looked up this https://github.com/open-mmlab/mmdetection/issues/10672, and I git clone https://github.com/open-mmlab/mmdetection and run pip install -v -e .

Again, I executed the command of image_demo.py and it worked.

tbxmh commented 1 month ago

Thank you very much for your reply, I managed to run through it; but I think I have another question I would like to ask, which is that I would like to reason about SAR images and detect airplanes or cars in them, but I don't know which models are able to do this? Would you have an answer to this please?

------------------ 原始邮件 ------------------ 发件人: "zcablii/SARDet_100K" @.>; 发送时间: 2024年8月8日(星期四) 下午3:09 @.>; @.**@.>; 主题: Re: [zcablii/SARDet_100K] How can I start testing properly? (Issue #26)

Quote reply Reference in

It occurred to me that I had met the similar problem, which made me couldn't run the img_demo.py. I used this command: python . /image_demo.py . /demo/demo.jpg local_configs/SARDet/r50_dota_pretrain/fg_frcnn_dota_pretrain_sar_wavelet_r50_1.py --weights . /work_dirs/fg_frcnn_dota_pretrain_sar_wavelet_r50/best_coco_bbox_mAP_epoch_12.pth --out-dir . /

ValueError: unknown argument {'tokens_positive'} for 'preprocess', 'forward', 'visualize' and 'postprocess'

Then I looked up this link, and I git clone https://github.com/open-mmlab/mmdetection and run pip install -v -e .

Again, I executed the command of image_demo.py and it worked.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

System2c commented 1 month ago

Thank you very much for your reply, I managed to run through it; but I think I have another question I would like to ask, which is that I would like to reason about SAR images and detect airplanes or cars in them, but I don't know which models are able to do this? Would you have an answer to this please?

I still use the files which are metioned above. local_configs/SARDet/r50_dota_pretrain/fg_frcnn_dota_pretrain_sar_wavelet_r50_1.py --weights . /work_dirs/fg_frcnn_dota_pretrain_sar_wavelet_r50/best_coco_bbox_mAP_epoch_12.pth I've only tried this one so far.

tbxmh commented 1 month ago

My inference doesn't come up with good results (as shown below), is it related to the size of the image? Other than that, I don't know what else could be the reason.

------------------ 原始邮件 ------------------ 发件人: "zcablii/SARDet_100K" @.>; 发送时间: 2024年8月8日(星期四) 晚上6:52 @.>; @.**@.>; 主题: Re: [zcablii/SARDet_100K] How can I start testing properly? (Issue #26)

Thank you very much for your reply, I managed to run through it; but I think I have another question I would like to ask, which is that I would like to reason about SAR images and detect airplanes or cars in them, but I don't know which models are able to do this? Would you have an answer to this please?

I still use the files which are metioned above. local_configs/SARDet/r50_dota_pretrain/fg_frcnn_dota_pretrain_sar_wavelet_r50_1.py --weights . /work_dirs/fg_frcnn_dota_pretrain_sar_wavelet_r50/best_coco_bbox_mAP_epoch_12.pth I've only tried this one so far.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

System2c commented 1 month ago

My inference doesn't come up with good results (as shown below), is it related to the size of the image? Other than that, I don't know what else could be the reason.

Actually as a freshman on this field, I am afraid that I couldn‘t give you some good explains. And I am still learning something more about these codes. QAQ (Btw, your results isn't shown on your reply.)

tbxmh commented 1 month ago

Sorry, I'm also a newbie as well; I'm sorry my results didn't show up, how about you look again now? put the results in an attachment.

------------------ 原始邮件 ------------------ 发件人: "zcablii/SARDet_100K" @.>; 发送时间: 2024年8月8日(星期四) 晚上7:05 @.>; @.**@.>; 主题: Re: [zcablii/SARDet_100K] How can I start testing properly? (Issue #26)

My inference doesn't come up with good results (as shown below), is it related to the size of the image? Other than that, I don't know what else could be the reason.

Actually as a freshman on this field, I am afraid that I couldn‘t give you some good explains. And I am still learning something more about these codes. QAQ (Btw, your results isn't shown on your reply.)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

System2c commented 1 month ago

Sorry, I'm also a newbie as well; I'm sorry my results didn't show up, how about you look again now? put the results in an attachment.

Nothing show up. Maybe using the website to comment will be better.

tbxmh commented 1 month ago

Sorry, I'm also a newbie as well; I'm sorry my results didn't show up, how about you look again now? put the results in an attachment.

Nothing show up. Maybe using the website to comment will be better. 20240808191010

System2c commented 1 month ago

Sorry, I'm also a newbie as well; I'm sorry my results didn't show up, how about you look again now? put the results in an attachment.

Nothing show up. Maybe using the website to comment will be better. 20240808191010

Maybe it depends on the image. I used other images and the model gave good results.

tbxmh commented 1 month ago

抱歉,我也是新手;很抱歉我的结果没有显示出来,你现在再看看怎么样?将结果放在附件中。

什么都没显示出来。也许使用网站来评论会更好。 20240808191010

也许这取决于图像。我使用了其他图像,模型给出了良好的结果。 Would it be possible to see your results; and if so, would it be possible to provide me with an image of yours for testing

System2c commented 1 month ago

抱歉,我也是新手;很抱歉我的结果没有显示出来,你现在再看看怎么样?将结果放在附件中。

什么都没显示出来。也许使用网站来评论会更好。 20240808191010

也许这取决于图像。我使用了其他图像,模型给出了良好的结果。 Would it be possible to see your results; and if so, would it be possible to provide me with an image of yours for testing

I use this as demo, and its result is shown below. demo_img

demo_img_result

tbxmh commented 1 month ago

抱歉,我也是新手;很遗憾我的结果没有显示出来,你现在再看看怎么样?将结果放在附件中。

什么都没有显示出来。也许使用网站来评论会更好。 20240808191010

也许这取决于图像。我使用了其他图像,模型给出了良好的结果。 是否有可能看到你的结果;如果是的话,是否可以向我提供您的图像进行测试

我以此作为演示,其结果如下所示。 演示图像

demo_img_result Thank you very much, I reproduced your results; that seems to be, as I thought, a problem with my image.

tbxmh commented 1 month ago

抱歉,我也是新手;很遗憾我的结果没有显示出来,你现在再看看怎么样?将结果放在附件中。

什么都没有显示出来。也许使用网站来评论会更好。 20240808191010

也许这取决于图像。我使用了其他图像,模型给出了良好的结果。 是否有可能看到你的结果;如果是的话,是否可以向我提供您的图像进行测试

我以此作为演示,其结果如下所示。 演示图像

demo_img_result Sorry to bother you again; I'd like to ask if you've ever detected aircraft or cars in a SAR image

System2c commented 1 month ago

抱歉,我也是新手;很遗憾我的结果没有显示出来,你现在再看看怎么样?将结果放在附件中。

什么都没有显示出来。也许使用网站来评论会更好。 20240808191010

也许这取决于图像。我使用了其他图像,模型给出了良好的结果。 是否有可能看到你的结果;如果是的话,是否可以向我提供您的图像进行测试

我以此作为演示,其结果如下所示。 演示图像 demo_img_result Sorry to bother you again; I'd like to ask if you've ever detected aircraft or cars in a SAR image

I‘m sorry that I haven’t detected these categories. : ( Maybe you can try.