Git Product home page Git Product logo

mmdetection_object_detection_demo's Introduction

Quick start

Train an object detection with Google Colab and free GPU.

Train with custom Pascal VOC dataset. Open in Colab

Train with custom COCO dataset. Open in Colab

The data/VOC2007 folder provides a reference structure of custom dataset ready for training. Fork my repository and replace them with your custom annotated dataset as necessary.

Further instruction on how to create your own datasets, read the tutorials

mmdetection_object_detection_demo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mmdetection_object_detection_demo's Issues

How to set the img_scale parameter

First thank for your tutorial about how to use mmdetection toolbox to train the custom dataset. And I have a question about how to resize my image if I have already labeled the image . Is the config file below handle the resize image operation daring training step?
image

Change Output layer

Hi,
I have my own dataset of 6 objects say a,b,c,d,e,f. Now at the output I want to use two softmax layers. One for the objects a,b,c and one for the objects d,e,f. Could anyone guide me how to do it. Any help would be greatfull.

dataset formating

i fork your repo and updated my custo dataset in that folder, but when i your notebook i am getting following error

        raise ValueError('Cannot infer dataset year from img_prefix')

i am stuck ,please help

Welcome update to OpenMMLab 2.0

Welcome update to OpenMMLab 2.0

I am Vansin, the technical operator of OpenMMLab. In September of last year, we announced the release of OpenMMLab 2.0 at the World Artificial Intelligence Conference in Shanghai. We invite you to upgrade your algorithm library to OpenMMLab 2.0 using MMEngine, which can be used for both research and commercial purposes. If you have any questions, please feel free to join us on the OpenMMLab Discord at https://discord.gg/amFNsyUBvm or add me on WeChat (van-sin) and I will invite you to the OpenMMLab WeChat group.

Here are the OpenMMLab 2.0 repos branches:

OpenMMLab 1.0 branch OpenMMLab 2.0 branch
MMEngine 0.x
MMCV 1.x 2.x
MMDetection 0.x ใ€1.xใ€2.x 3.x
MMAction2 0.x 1.x
MMClassification 0.x 1.x
MMSegmentation 0.x 1.x
MMDetection3D 0.x 1.x
MMEditing 0.x 1.x
MMPose 0.x 1.x
MMDeploy 0.x 1.x
MMTracking 0.x 1.x
MMOCR 0.x 1.x
MMRazor 0.x 1.x
MMSelfSup 0.x 1.x
MMRotate 1.x 1.x
MMYOLO 0.x

Attention: please create a new virtual environment for OpenMMLab 2.0.

issue in running the colab file

hello,
I have two issues actually , Both are related to running your colab code.
First issue is when running the part where you change the number of classes,

here it is the line ,
work_dir = re.findall(r"work_dir = '(.*?)'", s)[0]

it gives me this error massage
'list index out of range'

i did not understand what do you mean by [0] , i used the config files 'configs/pascal_voc/faster_rcnn_r50_fpn_1x_voc0712.py'
I am thinking to change the number of class manually , is it possible?

the 2nd issue is when using another config like the one you mentioned in colab 'configs/cascade_rcnn_r50_fpn_1x.py' and 'configs/retinanet_r50_fpn_1x.py'
i could not find them in configs folder in mmdetection .

how can i use them ? specially if i am working with semantic segmentation annotated dataset. not only object detection problem ? i need to use mask rcnn , and cascade mask rcnn.

any document or repository that may help ? i will be so thankful .

list index out of range

I am training model in Google Colab using my custom dataset and feeding data in coco format. I have already changed the number of classes in config file. But it throws me error -

File "tools/train.py", line 151, in <module> main() File "tools/train.py", line 147, in main meta=meta) File "/usr/local/lib/python3.6/dist-packages/mmdet-1.2.0+0f33c08-py3.6-linux-x86_64.egg/mmdet/apis/train.py", line 165, in train_detector runner.run(data_loaders, cfg.workflow, cfg.total_epochs) File "/usr/local/lib/python3.6/dist-packages/mmcv/runner/runner.py", line 384, in run epoch_runner(data_loaders[i], **kwargs) File "/usr/local/lib/python3.6/dist-packages/mmcv/runner/runner.py", line 279, in train for i, data_batch in enumerate(data_loader): File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 345, in __next__ data = self._next_data() File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 856, in _next_data return self._process_data(data) File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 881, in _process_data data.reraise() File "/usr/local/lib/python3.6/dist-packages/torch/_utils.py", line 394, in reraise raise self.exc_type(msg) IndexError: Caught IndexError in DataLoader worker process 0. Original Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop data = fetcher.fetch(index) File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/usr/local/lib/python3.6/dist-packages/mmdet-1.2.0+0f33c08-py3.6-linux-x86_64.egg/mmdet/datasets/custom.py", line 132, in __getitem__ data = self.prepare_train_img(idx) File "/usr/local/lib/python3.6/dist-packages/mmdet-1.2.0+0f33c08-py3.6-linux-x86_64.egg/mmdet/datasets/custom.py", line 145, in prepare_train_img return self.pipeline(results) File "/usr/local/lib/python3.6/dist-packages/mmdet-1.2.0+0f33c08-py3.6-linux-x86_64.egg/mmdet/datasets/pipelines/compose.py", line 24, in __call__ data = t(data) File "/usr/local/lib/python3.6/dist-packages/mmdet-1.2.0+0f33c08-py3.6-linux-x86_64.egg/mmdet/datasets/pipelines/loading.py", line 147, in __call__ results = self._load_masks(results) File "/usr/local/lib/python3.6/dist-packages/mmdet-1.2.0+0f33c08-py3.6-linux-x86_64.egg/mmdet/datasets/pipelines/loading.py", line 127, in _load_masks gt_masks = [self._poly2mask(mask, h, w) for mask in gt_masks] File "/usr/local/lib/python3.6/dist-packages/mmdet-1.2.0+0f33c08-py3.6-linux-x86_64.egg/mmdet/datasets/pipelines/loading.py", line 127, in <listcomp> gt_masks = [self._poly2mask(mask, h, w) for mask in gt_masks] File "/usr/local/lib/python3.6/dist-packages/mmdet-1.2.0+0f33c08-py3.6-linux-x86_64.egg/mmdet/datasets/pipelines/loading.py", line 112, in _poly2mask rles = maskUtils.frPyObjects(mask_ann, img_h, img_w) File "pycocotools/_mask.pyx", line 292, in pycocotools._mask.frPyObjects IndexError: list index out of range

@Tony607 How I can resolve this?

key error in xml_style

i used your colab notebook and only changed the dataset inside your data folder.but when i ran train.py code i am getting following error ,dont know why?

KeyError: Caught KeyError in DataLoader worker process 0.
 File "/usr/local/lib/python3.6/dist-packages/mmdet-1.0+93bed07-py3.6-linux-x86_64.egg/mmdet/datasets/xml_style.py", line 47, in get_ann_info
    label = self.cat2label[name]
KeyError: 'agx'

RuntimeError: Expected object of scalar type Byte but got scalar type Bool for argument #2 'other'

Hi Tony607,

Thank you for this mmdetection object detection demo. I got an issue when running the demo: !python tools/train.py {config_fname}

got these errors:
2019-10-02 09:08:06,271 - INFO - Distributed training: False
2019-10-02 09:08:06,683 - INFO - load model from: modelzoo://resnet50
/usr/local/lib/python3.6/dist-packages/mmcv/runner/checkpoint.py:155: UserWarning: The URL scheme of "modelzoo://" is deprecated, please use "torchvision://" instead
warnings.warn('The URL scheme of "modelzoo://" is deprecated, please '
2019-10-02 09:08:06,985 - WARNING - The model and loaded state dict do not match exactly

unexpected key in source state_dict: fc.weight, fc.bias

2019-10-02 09:08:09,667 - INFO - Start running, host: root@aac8453041fd, work_dir: /content/mmdetection_object_detection_demo/mmdetection/work_dirs/faster_rcnn_r50_fpn_1x_voc0712
2019-10-02 09:08:09,668 - INFO - workflow: [('train', 1)], max: 8 epochs
Traceback (most recent call last):
File "tools/train.py", line 98, in
main()
File "tools/train.py", line 94, in main
logger=logger)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/apis/train.py", line 62, in train_detector
_non_dist_train(model, dataset, cfg, validate=validate)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/apis/train.py", line 223, in _non_dist_train
runner.run(data_loaders, cfg.workflow, cfg.total_epochs)
File "/usr/local/lib/python3.6/dist-packages/mmcv/runner/runner.py", line 358, in run
epoch_runner(data_loaders[i], **kwargs)
File "/usr/local/lib/python3.6/dist-packages/mmcv/runner/runner.py", line 264, in train
self.model, data_batch, train_mode=True, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/apis/train.py", line 40, in batch_processor
losses = model(**data)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/parallel/data_parallel.py", line 150, in forward
return self.module(*inputs[0], **kwargs[0])
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/core/fp16/decorators.py", line 49, in new_func
return old_func(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/models/detectors/base.py", line 86, in forward
return self.forward_train(img, img_meta, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/models/detectors/two_stage.py", line 108, in forward_train
*rpn_loss_inputs, gt_bboxes_ignore=gt_bboxes_ignore)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/models/anchor_heads/rpn_head.py", line 51, in loss
gt_bboxes_ignore=gt_bboxes_ignore)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/core/fp16/decorators.py", line 127, in new_func
return old_func(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/models/anchor_heads/anchor_head.py", line 179, in loss
sampling=self.sampling)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/core/anchor/anchor_target.py", line 63, in anchor_target
unmap_outputs=unmap_outputs)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/core/utils/misc.py", line 24, in multi_apply
return tuple(map(list, zip(*map_results)))
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/core/anchor/anchor_target.py", line 108, in anchor_target_single
cfg.allowed_border)
File "/usr/local/lib/python3.6/dist-packages/mmdet-0.6.0+5b9c5dd-py3.6-linux-x86_64.egg/mmdet/core/anchor/anchor_target.py", line 169, in anchor_inside_flags
(flat_anchors[:, 2] < img_w + allowed_border) &
RuntimeError: Expected object of scalar type Byte but got scalar type Bool for argument #2 'other'

Do you have any hints to fix it out?

ImportError: cannot import name 'deform_conv_cuda'

Thanks for the notebook!

Running through the notebook I got this error:

ImportError: cannot import name 'deform_conv_cuda'

when I run the line:

from mmdet.models import build_detector

Do you have any ideas how to fix it? Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.