Closed colt18 closed 3 years ago
Hi @colt18 , Thanks for your kind suggestion. We are reorganizing the documentation, which may be released in v2.6.0, your suggestion and question are very valuable for us.
Since there will be a while before the new release of documentation, here is the answer to your question:
CocoDataset
in your config. For the dataset, you only need to modify the paths related to your annotation and data including ann_file
, img_prefix
, and classes
.num_classes
in box head and mask head.Here is an example of the config for your case:
_base_ = [
'../_base_/models/mask_rcnn_r50_fpn.py',
'../_base_/datasets/coco_instance.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
# Use r101 model
model = dict(
pretrained='torchvision://resnet101',
backbone=dict(depth=101),
roi_head=dict(
bbox_head=dict(num_classes=N),
mask_head=dict(num_classes=N)))
classes = ('a', 'b', 'c')
data = dict(
train=dict(
ann_file='path/to/your/annotation',
img_prefix='root path/to/your/image'
classes=classes),
val=dict(
ann_file='path/to/your/annotation',
img_prefix='root path/to/your/image'
classes=classes),
test=dict(
ann_file='path/to/your/data',
img_prefix='root path/to/your/image'
classes=classes))
# in case you want to use mask r101 pretrain
load_from = 'http://download.openmmlab.com/mmdetection/v2.0/mask_rcnn/mask_rcnn_r101_fpn_1x_coco/mask_rcnn_r101_fpn_1x_coco_20200204-1efe0ed5.pth' # noqa
With this config, you should be able to train mask r101 on your own dataset without any further modification.
Hope it helps and feel free to ask if you have any further questions.
As the documentation have been refactored, now we have quick run sections for training and testing models on existing datasets or on customized datasets.
I used
matterport-mrcnn
anddetectron2
in the last couple of months so far and quite acquainted to the workflow (prepping datasets, configs , training an so on). However I seem to struggle with mmdetection probably I can't concentrate on to it after them. Reacthedocs and colab tutorials seems to cover a lot but I just can't merge them into something useful.Here is what I have and need to accomplish:
r101-fpn
.I'm much confused about customdataset class, dataset registration and configs. Initially, do I have to create a new dataset as indicated here? Or is it just for non coco datasets preprocessing stuff. Do I have to register my database by creating a py file in dataset folder or can I do it under main config file.
Actually what I need is a complete example of workflow from scratch that involves dataset creation or registration, config setting and training routine. I heard many times that indeed mmdet is an easy to learn and flexible to implement framework but looks like I'm not able to find my way inside.
Thanks.