Code Monkey home page Code Monkey logo

mmdetection's Introduction

mmdetection0.5.7

mmdetection for ReasoningRCNN 对官方mmetection0.5.7进行了一些修改使其能够用于Reasoning-RCNN《Reasoning-RCNN Unifying Adaptive Global Reasoning into Large-scale Object Detection》

安装

1:创建conda虚拟环境,安装所需要的库,包括mmcv,pytorch,torchvision等并激活环境(先安装mmcv后安装mmdetection)

2:git clone https://github.com/Jinzhong-Duan/mmdetection.git

3:cd mmdetection

4:conda install cython #pip install cython

5:./compile.sh

6:python setup.py install #pip install .

#测试代码 预训练模型需要自己下载

from mmcv.runner import load_checkpoint
from mmdet.models import build_detector
from mmdet.apis import inference_detector, show_result
 
cfg = mmcv.Config.fromfile('/home/stardust/mmdetection/configs/faster_rcnn_r50_fpn_1x.py')
cfg.model.pretrained = None
 
# 构建网络,载入模型
model = build_detector(cfg.model, test_cfg=cfg.test_cfg)
 
# _ = load_checkpoint(model, 'https://s3.ap-northeast-2.amazonaws.com/open-mmlab/mmdetection/models/faster_rcnn_r50_fpn_1x_20181010-3d1b3351.pth')
# 如果通过网盘下载,取消下一行代码的注释,并且注释掉上一行
_ = load_checkpoint(model, 'model/faster_rcnn_r50_fpn_1x_20181010-3d1b3351.pth')
 
# 测试一张图片
img = mmcv.imread('test.jpg')
result = inference_detector(model, img, cfg)
show_result(img, result)
 
# 测试多张图片
# imgs = ['test1.jpg', 'test2.jpg']
# for i, result in enumerate(inference_detector(model, imgs, cfg, device='cuda:0')):
#     print(i, imgs[i])
#     show_result(imgs[i], result)

mmdetection's People

Contributors

jinzhongduan avatar

Stargazers

 avatar

Watchers

 avatar

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.