thograce / BGNet

Boundary-Guided Camouflaged Object Detection
91 stars 19 forks source link

About pre-computed map for other model #9

Open Qiublack opened 1 year ago

Qiublack commented 1 year ago

Thanks for your nice work. When I use the eval.py file to evaluate a pre-computed map for another model, I get the following error:

Traceback (most recent call last): File "D:/1_code/1Net/eval.py", line 32, in FM.step(pred=pred, gt=mask) File "D:\Anaconda3\envs\pytorch\lib\site-packages\py_sod_metrics\sod_metrics.py", line 67, in step adaptive_fm = self.cal_adaptive_fm(pred=pred, gt=gt) File "D:\Anaconda3\envs\pytorch\lib\site-packages\py_sod_metrics\sod_metrics.py", line 84, in cal_adaptive_fm area_intersection = binary_predcition[gt].sum() IndexError: boolean index did not match indexed array along dimension 1; dimension is 700 but corresponding boolean dimension is 702

could you tell what problems in me my steps.

thograce commented 1 year ago

Thanks for your nice work. When I use the eval.py file to evaluate a pre-computed map for another model, I get the following error:

Traceback (most recent call last): File "D:/1_code/1Net/eval.py", line 32, in FM.step(pred=pred, gt=mask) File "D:\Anaconda3\envs\pytorch\lib\site-packages\py_sod_metrics\sod_metrics.py", line 67, in step adaptive_fm = self.cal_adaptive_fm(pred=pred, gt=gt) File "D:\Anaconda3\envs\pytorch\lib\site-packages\py_sod_metrics\sod_metrics.py", line 84, in cal_adaptive_fm area_intersection = binary_predcition[gt].sum() IndexError: boolean index did not match indexed array along dimension 1; dimension is 700 but corresponding boolean dimension is 702

could you tell what problems in me my steps.

Please check whether the quantity of pre-computed maps and GT maps is consistent.

Qiublack commented 1 year ago

The pre-computed map I used came from the cod_methods.zip file you shared.Have you encountered the same problem when measuring four metrics of other models? I have checked the pre-computed map, H and W are the same as GT's sizes.

thograce commented 1 year ago

The pre-computed map I used came from the cod_methods.zip file you shared.Have you encountered the same problem when measuring four metrics of other models? I have checked the pre-computed map, H and W are the same as GT's sizes.

I said consistency is not the image size, but the number of images. For example, CAMO has 250 testing images. Is the prediction images of the model you test also 250? By the way, the links I share are also shared by others, because I don't want to upload them again. Those models are open source. If you find the quantity is inconsistent, you can directly download them from the source code of the model. I found that some pre-computed maps provided by the original authors are not complete. You can download their pre-trained models and codes and run them again to obtain complete pre-computed maps.

Qiublack commented 1 year ago

The pre-computed map I used came from the cod_methods.zip file you shared.Have you encountered the same problem when measuring four metrics of other models? I have checked the pre-computed map, H and W are the same as GT's sizes.

I said consistency is not the image size, but the number of images. For example, CAMO has 250 testing images. Is the prediction images of the model you test also 250? By the way, the links I share are also shared by others, because I don't want to upload them again. Those models are open source. If you find the quantity is inconsistent, you can directly download them from the source code of the model. I found that some pre-computed maps provided by the original authors are not complete. You can download their pre-trained models and codes and run them again to obtain complete pre-computed maps.

Ok, thank you very much for your answer.