Coder Social home page Coder Social logo

mmdetection-annotated's Introduction

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)

mmdetection-annotated's People

Contributors

ming71 avatar

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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mmdetection-annotated's Issues

模型可视化

你好,你的模型可视化用的什么工具?能否分享下?谢谢~

修改necks

显示KeyError: 'PAFPN is not in the neck registry'

关于您的configs解释?

1、configs中batchsize是在哪里说明的?
2、config中的img_scale 是什么意思?
3、您在本地训练是训练的什么数据,用几个gpu?如果单gpu,你的lr是多少?能提供一下实际的本地训练配置文件吗?谢谢

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.

no prediction found

您好,想请教一下,我在训练的过程中我只用了三张数据集,为什么会出现no prediction found,不应该是过拟合吗?

想请问一下如何计算accuracy?

首先感谢你的注释,中文的看起来舒服多了。另外是这样的,我现在在做疾病分类,但是有的病灶只占了图像很小一部分,所以我现在需要用目标检测来提高图像分类准确率。我目前的想法是比如说一张图片预测出了很多box,那么我就按照置信度选择前10个box来得出最终这张图片的类别,比如看10个box觉得多数预测称了A类,那么就预测这张图片属于A类。

我现在用的是faster_rcnn_x101_64x4d这个模型,然后问题是我不太清楚模型输出是个什么东西。比如我在tools/test.py

def single_gpu_test(model, data_loader, show=False):
    model.eval()
    results = []
    dataset = data_loader.dataset
    prog_bar = mmcv.ProgressBar(len(dataset))
    for i, data in enumerate(data_loader):
        with torch.no_grad():
            result = model(return_loss=False, rescale=not show, **data)
        results.append(result)

        if show:
            model.module.show_result(data, result, dataset.img_norm_cfg)

        batch_size = data['img'][0].size(0)
        for _ in range(batch_size):
            prog_bar.update()
    return results

那个result我调试发现输出是个list,好像每次长度都为10,每个元素是一个tensor,维度是 n*5, 这个n不固定,可能是0,1,也可能是8。就想请问一下这里输出的是什么?或者有什么简单的办法可以计算最终的分类准确率?谢谢

训练模块出错

运行
~/mmdetection$ python tools/train.py configs/cascade_rcnn_x101_32x4d_fpn_1x.py --validate

2019-07-25 10:13:28,296 - INFO - Distributed training: False
2019-07-25 10:13:30,073 - INFO - load model from: open-mmlab://resnext101_32x4d
Downloading: "https://s3.ap-northeast-2.amazonaws.com/open-mmlab/pretrain/third_party/resnext101_32x4d-a5af3160.pth" to /home/yaping/.cache/torch/checkpoints/resnext101_32x4d-a5af3160.pth
Traceback (most recent call last):
File "/home/yaping/anaconda3/envs/mmd/lib/python3.7/urllib/request.py", line 1317, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
......(省略)
File "/home/yaping/anaconda3/envs/mmd/lib/python3.7/urllib/request.py", line 1319, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 110] Connection timed out>

显示下载resnext101_32x4d-a5af3160.pth,但是超时,是不是从国外网站下载不下来resnext101_32x4d-a5af3160.pth这个文件啊? 请问有相关的文件么?谢谢啦!

数据问题

看到博客中有car.json,但我在git工程中没有找到这个数据。

Oriented Bounding Box

@ming71
i saw your work with the oriented bounding box, very nice work!.(ultralytics/yolov3#345)

how you implemented the oriented bounding box to yolov3?Which format for the label you use and can i use a webcam to detect the objects?
Thank you!

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.