• Stars
    star
    653
  • Rank 68,968 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 5 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

mmdetection源码注释

Notes!!

MMDetection-annotations have been update to latest version 1.0. I'll continue updating but may not chase after upgrades for latest version.

mmdetection-annotated

Introduction

Refer to the execllent implemention here:https://github.com/open-mmlab/mmdetection ,and thanks to author Kai Chen.
Open-mmlab project , which contains various models and implementions of latest papers , achieves great results in detection/segmentataion tasks , and is kind enough for rookies in CV field.

Getting started

More information about installation or pre-train model downloads , pls refer to officia mmdetection or blog here

  • Test on images
    You can test on Faster RCNN demo by running the script demo.py. I have just rewritten the demo file to detect on single image or a folder as follow:
import os
from mmdet.apis import init_detector, inference_detector, show_result

if __name__ == '__main__':
	config_file = 'configs/faster_rcnn_r50_fpn_1x.py'
	checkpoint_file = 'weights/faster_rcnn_r50_fpn_1x_20181010-3d1b3351.pth'
	# checkpoint_file = 'tools/work_dirs/mask_rcnn_r101_fpn_1x/epoch_1200.pth'
	img_path = '/home/bit/下载/n07753592'
	model = init_detector(config_file, checkpoint_file, device='cuda:0')
	# print(model)
	# 输入可以为文件夹或者图片
	if os.path.isdir(img_path):
		imgs= os.listdir(img_path)
		for i in range(len(imgs)):
			imgs[i]=os.path.join(img_path,imgs[i])
		for i, result in enumerate(inference_detector(model, imgs)):	# 支持可迭代输入imgs
			print(i, imgs[i])
			show_result(imgs[i], result, model.CLASSES, out_file='output/result_{}.jpg'.format(i))

	elif os.path.isfile(img_path):
		result = inference_detector(model, img_path)
		show_result(img_path, result, model.CLASSES)


  • Debug
    You can debug by setting breakpoint with method of adding ipdb.set_trace().Before that , make sure of the success installment and import of ipdb package.
  • Hook
    If you want to inspect on intermediate variables , hook.py can be a provision served as a reference for your work.

Annotations

Annotations are attached everywhere in the code(surely only the part I have read , and the not finished part will be completed as soon as possible). Beside , annotation folder contains some interpreting documents as well.

  • Dataset Example
    Provide a simple small sample data set for testing (segmentation && detection) .More details referrd to instruction here

  • CUDA related code
    I've delete files in folder mmdet/ops cause no annotations attached inside.However it's a good news that specific notes are made about RoIAlign here .

  • Model visualization
    Take Mask-RCNN for example , the model can be visualized as follow:(more details refere to model-structure-png)

  • notes

  • Configuration
    Explicit describtion on config file , take Mask RCNN for example , refer to mask_rcnn_r101_fpn_1x.py

  • MMCV&MMDET
    Specification of mmcv lib and a partial of mmdet(more details about various models will be updated later ).

Detection Results

Test on Mask RCNN model:

Training

dataset

  • You can just use COCO dataset , refer here.
  • If you want to train on your customed dataset labeled by labelme , you need first convert json files to COCO style , this toolbox may help you ;
  • If you want to train on your customed dataset labeled by labelImg , you need first convert xml files to COCO style , this toolbox may also help you .
  • I have tested on these tools recently to make sure them still work well, if questiones still arised , desrcibe on issue please or contact me , thanks.

learning rate

Remember to set lr in config file according to your own GPU_NUM !!!!(eg.1/8 of default lr for 1 GPU)

More Repositories

1

CV_PaperDaily

CV 论文笔记
720
star
2

toolbox

various cv tools, such as label tools, data augmentation, label conversion, etc.
Jupyter Notebook
416
star
3

rotate-yolov3

Arbitrary oriented object detection implemented with yolov3 (attached with some tricks).
Python
222
star
4

DAL

[AAAI 2021] Official implementation of "Dynamic Anchor Learning for Arbitrary-Oriented Object Detection".
Python
219
star
5

yolov3-polygon

Arbitrary-oriented object detection based on yolov3.
Python
131
star
6

UCAS-AOD-benchmark

A benchmark of UCAS-AOD dataset.
Python
91
star
7

Rotated-RetinaNet

Rotation RetinaNet for arbitrary-oriented object detection.
Python
72
star
8

HRSC2016_SOTA

Fair comparison of different algorithms on the HRSC2016 dataset.
70
star
9

CFC-Net

[TGRS 2021] Official implementation of "CFC-Net: A Critical Feature Capturing Network for Arbitrary-Oriented Object Detection in Remote Sensing Images".
Python
64
star
10

RIDet

[GRSL 2021] Official code for paper "Optimization for Oriented Object Detection via Representation Invariance Loss".
Python
57
star
11

OBBDet_Swin

The sixth place winning solution (6/220) in 2021 Gaofen Challenge.
Python
50
star
12

yolov3-pytorch

annotation and specification for yolov3
Jupyter Notebook
48
star
13

CUDA

useful cuda code .
Cuda
39
star
14

TIOE

[ISPRS&RS 2023]Official implementation of "Task Interleaving and Orientation Estimation for High-Precision Oriented Object Detection in Aerial Images".
Python
23
star
15

GCIoU-loss

[CVPR 2023] Official implementation of "Deep Dive into Gradients: Better Optimization for 3D Object Detection with Gradient-Corrected IoU Supervision".
Python
17
star
16

Cascade-Rotated-RetinaNet

cascade rotated RetinaNet for arbitrary-oriented object detection
Python
12
star
17

SLA

[RS 2021] Official implementation of "Sparse Label Assignment for Oriented Object Detection inAerial Images"
Python
12
star
18

PGM

notes
7
star
19

GCL

GCL implementation
Python
6
star