Giter VIP home page Giter VIP logo

detectron2-licenseplates's Introduction

License plates detection model using Detectron2

For detailed description how to train your own detection model using a custom dataset and evaluate it read the Medium story:

Setup environment

This project is using Conda for project environment management.

Setup the project environment:

$ conda env create -f environment.yml
$ conda activate detectron2-licenseplates

or update the environment if you git pull the repo previously:

$ conda env update -f environment.yml

Training

To launch end-to-end license plates detection training with Faster R-CNN ResNet-50 backbone on 2 GPUs, one should execute:

$ python train.py --config-file configs/lp_faster_rcnn_R_50_FPN_3x.yaml --num-gpus 2

To train the model with RetinaNet ResNet-50 backbone run:

$ python train.py --config-file configs/lp_retinanet_R_50_FPN_3x.yaml --num-gpus 2

Evaluation

Model evaluation is done at the and of the training but you can run it alone:

$ python train.py --config-file configs/lp_faster_rcnn_R_50_FPN_3x.yaml --eval-only MODEL.WEIGHTS output/model_final.pth

or

$ python train.py --config-file configs/lp_retinanet_R_50_FPN_3x.yaml --eval-only MODEL.WEIGHTS output/model_final.pth

Prediction

To execute prediction on some sample data from test dataset with Faster R-CNN ResNet-50 backbone (which is default), run:

$ python predict.py --config-file configs/lp_faster_rcnn_R_50_FPN_3x.yaml MODEL.WEIGHTS output/model_final.pth

or

$ python predict.py --config-file configs/lp_retinanet_R_50_FPN_3x.yaml MODEL.WEIGHTS output/model_final.pth

to run prediction on RetinaNet

Resources and Credits

License

MIT License

detectron2-licenseplates's People

Contributors

jagin 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

Watchers

 avatar  avatar  avatar  avatar

detectron2-licenseplates's Issues

[question] About --num-gpus.

Hello,

Thank you for your good writing.

$ python train.py --config-file configs/lp_faster_rcnn_R_50_FPN_3x.yaml --num-gpus 2
I don't think num-gpus means the number of CUDA cores, does it mean the number of physical graphics cards?

I don't know what exactly it means.

I use jetson xavier nx and the specs are as follows:

GPU 384-core NVIDIA Volta™ GPU with 48 Tensor Cores

In case of xavier nx, how should I set num-gpus?

Starting training from iteration 0
/home/hodu/.local/lib/python3.6/site-packages/detectron2/modeling/roi_heads/fast_rcnn.py:217: UserWarning: This overload of nonzero is deprecated:
nonzero()
Consider using one of the following signatures instead:
nonzero(*, bool as_tuple) (Triggered internally at ../torch/csrc/utils/python_arg_parser.cpp:882.)
num_fg = fg_inds.nonzero().numel()
Killed
hodu@hodu-desktop:~/coding/GitHub/detectron2-licenseplates$ python3 train.py --config-file configs/lp_faster_rcnn_R_50_FPN_3x.yaml --num-gpus 1

As above, I started with num-gpus given 1, and it ended with the message'Killed'.

How do I get it to work? I would appreciate it if you could give me directions.

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.