yan-roo / spinenet-pytorch Goto Github PK
View Code? Open in Web Editor NEWSpineNet - mmdetection (Pytorch) Implementation
Home Page: https://arxiv.org/abs/1912.05027
License: Apache License 2.0
SpineNet - mmdetection (Pytorch) Implementation
Home Page: https://arxiv.org/abs/1912.05027
License: Apache License 2.0
Hey,
I want to check mAP of the model during training and after it finishes. For this purpose I use --validate during training and tools/test.py script after that. The output I get looks like this:
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.384
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.614
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.439
Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.059
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.147
Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.436
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.005
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.049
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.426
Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.104
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.173
Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.483
My problem is that there is far more objects on images than 100. I changed the max_per_img in config file so now the model outputs more bounding boxes, but when calculating mAP, maxDets is still set to 100. Is there a way to easily change this number?
Are the default training epochs 350? Can you share the curve of loss?
In paper and official code, the Dropblock is used in protocol B. But I can't find in this repo, so whether the Dropblock is used?
hello, yan-roo!
i have successfully training your model with my custom dataset, but when i test some errors existing as following:
################################
size mismatch for bbox_head.retina_cls.weight: copying a param with shape torch.Size([180, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([720, 128, 3, 3]).
size mismatch for bbox_head.retina_cls.bias: copying a param with shape torch.Size([180]) from checkpoint, the shape in current model is torch.Size([720]).
Fontconfig error: Cannot load default config file
################################
the test.py i used:
import argparse
import cv2
import torch
from mmdet.apis import inference_detector, init_detector, show_result
from mmdet.models import build_detector
def parse_args():
parser = argparse.ArgumentParser(description='MMDetection webcam demo')
parser.add_argument('config', help='test config file path')
parser.add_argument('checkpoint', help='checkpoint file')
parser.add_argument('--device', type=int, default=0, help='CUDA device id')
parser.add_argument(
'--camera-id', type=int, default=0, help='camera device id')
parser.add_argument(
'--img_path', help='test image path')
parser.add_argument(
'--score-thr', type=float, default=0.5, help='bbox score threshold')
args = parser.parse_args()
return args
def main():
args = parse_args()
model = init_detector(
args.config, args.checkpoint, device=torch.device('cuda', args.device))
result = inference_detector(model, args.img_path)
show_result(args.img_path, result, model.CLASSES, score_thr=args.score_thr, wait_time=0)
if name == 'main':
main()
please help me solve this problem
many thanks.
Greate work! I found only retinanet is tested. Have any plan to test maskrcnn with spinenet backbone?
`---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in
9 # Build the detector
10 model = build_detector(
---> 11 cfg.model, train_cfg=cfg.train_cfg, test_cfg=cfg.test_cfg)
12 # Add an attribute for visualization convenience
13 model.CLASSES = datasets[0].CLASSES
~/Downloads/mmdetection/mmdet/models/builder.py in build_detector(cfg, train_cfg, test_cfg)
65 def build_detector(cfg, train_cfg=None, test_cfg=None):
66 """Build detector."""
---> 67 return build(cfg, DETECTORS, dict(train_cfg=train_cfg, test_cfg=test_cfg))
~/Downloads/mmdetection/mmdet/models/builder.py in build(cfg, registry, default_args)
30 return nn.Sequential(*modules)
31 else:
---> 32 return build_from_cfg(cfg, registry, default_args)
33
34
~/anaconda3/envs/edge/lib/python3.7/site-packages/mmcv/utils/registry.py in build_from_cfg(cfg, registry, default_args)
169 f'type must be a str or valid type, but got {type(obj_type)}')
170
--> 171 return obj_cls(**args)
~/Downloads/mmdetection/mmdet/models/detectors/retinanet.py in init(self, backbone, neck, bbox_head, train_cfg, test_cfg, pretrained)
15 pretrained=None):
16 super(RetinaNet, self).init(backbone, neck, bbox_head, train_cfg,
---> 17 test_cfg, pretrained)
~/Downloads/mmdetection/mmdet/models/detectors/single_stage.py in init(self, backbone, neck, bbox_head, train_cfg, test_cfg, pretrained)
28 bbox_head.update(train_cfg=train_cfg)
29 bbox_head.update(test_cfg=test_cfg)
---> 30 self.bbox_head = build_head(bbox_head)
31 self.train_cfg = train_cfg
32 self.test_cfg = test_cfg
~/Downloads/mmdetection/mmdet/models/builder.py in build_head(cfg)
55 def build_head(cfg):
56 """Build head."""
---> 57 return build(cfg, HEADS)
58
59
~/Downloads/mmdetection/mmdet/models/builder.py in build(cfg, registry, default_args)
30 return nn.Sequential(*modules)
31 else:
---> 32 return build_from_cfg(cfg, registry, default_args)
33
34
~/anaconda3/envs/edge/lib/python3.7/site-packages/mmcv/utils/registry.py in build_from_cfg(cfg, registry, default_args)
169 f'type must be a str or valid type, but got {type(obj_type)}')
170
--> 171 return obj_cls(**args)
~/Downloads/mmdetection/mmdet/models/dense_heads/retina_sepbn_head.py in init(self, num_classes, num_ins, in_channels, stacked_convs, conv_cfg, norm_cfg, **kwargs)
28 self.num_ins = num_ins
29 super(RetinaSepBNHead, self).init(num_classes, in_channels,
---> 30 **kwargs)
31
32 def _init_layers(self):`
subprocess.CalledProcessError: Command '['/home/payal/anaconda3/envs/spn/bin/python', '-u', 'tools/train.py', '--local_rank=1', './configs/sp.py', '--launcher', 'pytorch']' returned non-zero exit status 1.
Any idea how to resolve this
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.