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

how to get 12 map? #28

Open
zr526799544 opened this issue Dec 27, 2020 · 13 comments
Open

how to get 12 map? #28

zr526799544 opened this issue Dec 27, 2020 · 13 comments

Comments

@zr526799544
Copy link

I run all.sh and get nothing. so I use detetron demo predict code to generate the coco result and the resulte is to low.loading annotations into memory...
Done (t=0.50s)
creating index...
index created!
Loading and preparing results...
DONE (t=0.38s)
creating index...
index created!
Running per image evaluation...
Evaluate annotation type bbox
DONE (t=11.88s).
Accumulating evaluation results...
DONE (t=2.87s).
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.011
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.020
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.010
Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.000
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.006
Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.023
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.027
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.032
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.032
Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.000
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.010
Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.071

@fanq15
Copy link
Owner

fanq15 commented Dec 28, 2020

Could send me your training log?

@zr526799544
Copy link
Author

Could send me your training log?

I do not train the model I just test it on coco val use the weight you provided.

@zr526799544
Copy link
Author

Could send me your training log?

the code I run has been send to you email.

@fanq15
Copy link
Owner

fanq15 commented Dec 28, 2020

What's your detectron2 version?

@zr526799544
Copy link
Author

What's your detectron2 version?

0.3

@fanq15
Copy link
Owner

fanq15 commented Dec 28, 2020

Please try this one to install detectron2 0.1 version

python -m pip install detectron2 -f \
  https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.5/index.html

@zr526799544
Copy link
Author

Please try this one to install detectron2 0.1 version

python -m pip install detectron2 -f \
  https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.5/index.html

YOU install MD said that recommend the Pre-Built Detectron2 (Linux only) version with pytorch 1.5. I use the Pre-Built Detectron2 with CUDA 10.1 and pytorch 1.5. and I found detectron2 V0.1 just for pytorch 1.4 and use python -m pip install detectron2 -f
https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.5/index.html can just install V0.3.

@zr526799544
Copy link
Author

zr526799544 commented Dec 28, 2020

Please try this one to install detectron2 0.1 version

python -m pip install detectron2 -f \
  https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.5/index.html

I can just use V0.1.3 and meet /workspace/FewX-master/fewx/modeling/fsod/fsod_roi_heads.py in ()
8
9 from detectron2.config import configurable
---> 10 from detectron2.layers import ShapeSpec, nonzero_tuple
11 from detectron2.structures import Boxes, ImageList, Instances, pairwise_iou
12 from detectron2.utils.events import get_event_storage

ImportError: cannot import name 'nonzero_tuple'

@fanq15
Copy link
Owner

fanq15 commented Dec 30, 2020

I tried the evaluation again and I can get the reported number.

[12/30 18:13:39 fewx.evaluation.coco_evaluation]: Preparing results for COCO format ...
[12/30 18:13:39 fewx.evaluation.coco_evaluation]: Saving results to ./output/fsod/finetune_dir/R_50_C4_1x/inference/coco_instances_results.json
[12/30 18:13:39 fewx.evaluation.coco_evaluation]: Evaluating predictions ...
Loading and preparing results...
DONE (t=0.13s)
creating index...
index created!
Running per image evaluation...
Evaluate annotation type *bbox*
COCOeval_opt.evaluate() finished in 10.44 seconds.
Accumulating evaluation results...
COCOeval_opt.accumulate() finished in 1.24 seconds.
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.030
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.056
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.029
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.007
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.031
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.052
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.047
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.066
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.066
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.009
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.059
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.114
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for bbox: 
|  AP   |  AP50  |  AP75  |  APs  |  APm  |  APl  |
|:-----:|:------:|:------:|:-----:|:-----:|:-----:|
| 2.989 | 5.592  | 2.948  | 0.724 | 3.057 | 5.165 |
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> AP  : 11.95
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> AP50: 22.37
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> AP75: 11.79
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> APs : 2.89
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> APm : 12.23
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> APl : 20.66

@zr526799544
Copy link
Author

I tried the evaluation again and I can get the reported number.

[12/30 18:13:39 fewx.evaluation.coco_evaluation]: Preparing results for COCO format ...
[12/30 18:13:39 fewx.evaluation.coco_evaluation]: Saving results to ./output/fsod/finetune_dir/R_50_C4_1x/inference/coco_instances_results.json
[12/30 18:13:39 fewx.evaluation.coco_evaluation]: Evaluating predictions ...
Loading and preparing results...
DONE (t=0.13s)
creating index...
index created!
Running per image evaluation...
Evaluate annotation type *bbox*
COCOeval_opt.evaluate() finished in 10.44 seconds.
Accumulating evaluation results...
COCOeval_opt.accumulate() finished in 1.24 seconds.
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.030
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.056
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.029
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.007
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.031
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.052
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.047
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.066
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.066
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.009
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.059
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.114
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for bbox: 
|  AP   |  AP50  |  AP75  |  APs  |  APm  |  APl  |
|:-----:|:------:|:------:|:-----:|:-----:|:-----:|
| 2.989 | 5.592  | 2.948  | 0.724 | 3.057 | 5.165 |
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> AP  : 11.95
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> AP50: 22.37
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> AP75: 11.79
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> APs : 2.89
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> APm : 12.23
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> APl : 20.66

you env is pytorch 1.5 . detectron2 v0.31 ? just run all.sh can get the result?

@zr526799544
Copy link
Author

zr526799544 commented Dec 31, 2020

I tried the evaluation again and I can get the reported number.

[12/30 18:13:39 fewx.evaluation.coco_evaluation]: Preparing results for COCO format ...
[12/30 18:13:39 fewx.evaluation.coco_evaluation]: Saving results to ./output/fsod/finetune_dir/R_50_C4_1x/inference/coco_instances_results.json
[12/30 18:13:39 fewx.evaluation.coco_evaluation]: Evaluating predictions ...
Loading and preparing results...
DONE (t=0.13s)
creating index...
index created!
Running per image evaluation...
Evaluate annotation type *bbox*
COCOeval_opt.evaluate() finished in 10.44 seconds.
Accumulating evaluation results...
COCOeval_opt.accumulate() finished in 1.24 seconds.
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.030
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.056
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.029
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.007
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.031
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.052
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.047
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.066
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.066
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.009
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.059
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.114
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for bbox: 
|  AP   |  AP50  |  AP75  |  APs  |  APm  |  APl  |
|:-----:|:------:|:------:|:-----:|:-----:|:-----:|
| 2.989 | 5.592  | 2.948  | 0.724 | 3.057 | 5.165 |
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> AP  : 11.95
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> AP50: 22.37
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> AP75: 11.79
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> APs : 2.89
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> APm : 12.23
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> APl : 20.66

I find the problem..... In your all.sh you do delete the ./support_dir/support_feature.pkl which inference needed ... plz delete it in your all.sh and plz delete the code self.logger.info("===========inference call===========") in your fewx/modeling/fsod/fsod_rcnn.py
340

@zr526799544
Copy link
Author

zr526799544 commented Dec 31, 2020

I tried the evaluation again and I can get the reported number.

[12/30 18:13:39 fewx.evaluation.coco_evaluation]: Preparing results for COCO format ...
[12/30 18:13:39 fewx.evaluation.coco_evaluation]: Saving results to ./output/fsod/finetune_dir/R_50_C4_1x/inference/coco_instances_results.json
[12/30 18:13:39 fewx.evaluation.coco_evaluation]: Evaluating predictions ...
Loading and preparing results...
DONE (t=0.13s)
creating index...
index created!
Running per image evaluation...
Evaluate annotation type *bbox*
COCOeval_opt.evaluate() finished in 10.44 seconds.
Accumulating evaluation results...
COCOeval_opt.accumulate() finished in 1.24 seconds.
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.030
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.056
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.029
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.007
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.031
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.052
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.047
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.066
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.066
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.009
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.059
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.114
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for bbox: 
|  AP   |  AP50  |  AP75  |  APs  |  APm  |  APl  |
|:-----:|:------:|:------:|:-----:|:-----:|:-----:|
| 2.989 | 5.592  | 2.948  | 0.724 | 3.057 | 5.165 |
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> AP  : 11.95
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> AP50: 22.37
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> AP75: 11.79
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> APs : 2.89
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> APm : 12.23
[12/30 18:13:51 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> APl : 20.66

after motify the result I can get below.
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.019
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.035
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.019
Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.000
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.009
Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.041
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.036
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.041
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.041
Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.000
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.013
Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.096
[12/31 01:46:01 fewx.evaluation.coco_evaluation]: Evaluation results for bbox:

AP AP50 AP75 APs APm APl
1.939 3.469 1.948 0.015 0.889 4.124
[12/31 01:46:01 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> AP : 7.75
[12/31 01:46:01 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> AP50: 13.88
[12/31 01:46:01 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> AP75: 7.79
[12/31 01:46:01 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> APs : 0.06
[12/31 01:46:01 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> APm : 3.56
[12/31 01:46:01 fewx.evaluation.coco_evaluation]: Evaluation results for VOC 20 categories =======> APl : 16.50

@Zhang1Sheng
Copy link

(FNMNJ28(96TBAT}RV1 4K
I know that the model generates 100 BBoxes for each class, but when I predicted that only dozens of BBoxes were generated for each class. Why not 100 and how to solve this problem?

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

3 participants