facebookresearch / facebookresearch/detectron2
model zoo result lower than expected
- Dominant language
- Python
- Stars
- 34.7k
- Forks
- 7.9k
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I'm tring to load the model zoo Mask R-CNN and evaluate it on the COCO dataset, but the result is much lower than that of expected, the code I'm using is
```
from detectron2.evaluation import inference_on_dataset
from detectron2.data import build_detection_test_loader
from detectron2.config import get_cfg
from detectron2 import model_zoo
from detectron2.evaluation import COCOEvaluator as COCOEvaluator_detectron
from detectron2.config import get_cfg
from detectron2.engine import DefaultPredictor
cfg = get_cfg()
# add project-specific config (e.g., TensorMask) here if you're not running a model in detectron2's core library
cfg.merge_from_file(model_zoo.get_config_file("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml"))
# cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5 # set threshold for this model
# Find a model from detectron2's model zoo. You can use the https://dl.fbaipublicfiles... url as well
cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml")
model_pretrained = DefaultPredictor(cfg)
coco_evaluator_detectron = COCOEvaluator_detectron('coco_2017_val', output_dir='./output/inference')
test_loader = build_detection_test_loader(cfg, 'coco_2017_val')
print(inference_on_dataset(model_pretrained.model, test_loader, coco_evaluator_detectron))
```
the result box AP is only 20.5, much lower than the expected box 40 AP of the model
Contributor guide
Research direction
Start by running the shown model_zoo Mask R-CNN evaluation through DefaultPredictor, build_detection_test_loader, inference_on_dataset, and COCOEvaluator. Check the loaded configuration, checkpoint, dataset, and evaluator output against the model-zoo expectations. Done means identifying the cause of the 20.5 box AP result and confirming the corrected evaluation matches the expected result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-vision, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100