Giter VIP home page Giter VIP logo

rebar-detection-competition's Introduction

rebar-detection-competition-baseline

Simple rebar detection competition baseline(0.97+) based on Faster RCNN[1]

competition link: https://www.datafountain.cn/competitions/332/details

If you wanna a higher score.Please use FPN or DCN,maybe softnms(also contained in this baseline) or other tricks are useful.Thanks for contribution!

1、Install dependencies

requires PyTorch >=0.4

  • install PyTorch >=0.4 with GPU (code are GPU-only), refer to official website

  • install cupy, you can install via pip install cupy-cuda80 or(cupy-cuda90,cupy-cuda91, etc).

  • install other dependencies: pip install -r requirements.txt

  • Optional, but strongly recommended: build cython code nms_gpu_post:

    cd model/utils/nms/
    python build.py build_ext --inplace
    cd -
  • start visdom for visualization

nohup python -m visdom.server &

2、 Prepare caffe-pretrained vgg16

If you want to use caffe-pretrain model as initial weight, you can run below to get vgg16 weights converted from caffe, which is the same as the origin paper use.

python misc/convert_caffe_pretrain.py

This scripts would download pretrained model and converted it to the format compatible with torchvision. If you are in China and can not download the pretrain model, you may refer to this issue

Then you could specify where caffe-pretraind model vgg16_caffe.pth stored in utils/config.py by setting caffe_pretrain_path. The default path is ok.

If you want to use pretrained model from torchvision, you may skip this step.

NOTE, caffe pretrained model has shown slight better performance.

NOTE: caffe model require images in BGR 0-255, while torchvision model requires images in RGB and 0-1. See data/dataset.pyfor more detail.

3、Prepare your data.

refer to: https://blog.csdn.net/github_36923418/article/details/86303670

4、Train

python train.py train --env='fasterrcnn-caffe' --plot-every=100 --caffe-pretrain

you may refer to utils/config.py for more argument.

Some Key arguments:

  • --caffe-pretrain=False: use pretrain model from caffe or torchvision (Default: torchvison)
  • --plot-every=n: visualize prediction, loss etc every n batches.
  • --env: visdom env for visualization
  • --voc_data_dir: where the VOC data stored
  • --use-drop: use dropout in RoI head, default False
  • --use-Adam: use Adam instead of SGD, default SGD. (You need set a very low lr for Adam)
  • --load-path: pretrained model path, default None, if it's specified, it would be loaded.

5、Test

python test.py

If you have any question about this baseline, please ask questions in the issue area, I will give you an answer as soon as possible.

reference

[1]、https://arxiv.org/abs/1506.01497

[2]、https://github.com/chenyuntc/simple-faster-rcnn-pytorch

rebar-detection-competition's People

Contributors

bigwode avatar

Watchers

James Cloos 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.