Code Monkey home page Code Monkey logo

circle-detection-cnn's Introduction

Cirlcle-Detection-DNN

This is a PyTorch implementation of a Deep Convolutional Neural Network model for detecting the parameters of a circle presents inside a given image under the presence of noise.

Note: This implementation is using Multi-GPUs for faster training. You can modify train.py to avoid using GPUs.

Network Architecture

Repo List

The output of the network is 3 real numbers which represents the detected row, column, and radious of the circle in the noisy image.

Getting Started

Installation

  • Clone this repo:
git clone https://github.com/hsouri/Cirlcle-Detection-CNN
  • Requirements Install the dependencies by running the following command:
pip install -r requirements.txt

Model training

  • Data set making Before trainig, train set should be created by the following command:
python dataset.py

This will generate 200,000 images with randon level of noise between 0.035 and 3.5. You can create yout own train set with arbitrary number of imaages and arbitrary level of noise by changing number of images and level of noise in the train_set() function.

  • Training:
python train.py

You can use your own data set by changing the default dataset by the following command:

python train.py --data {directory path to your csv train set}
  • Resume training from a saved model:

You are able to resume training your model from a saved checkpoint by running the following:

python train.py --resume {directory path to your saved model}

You can also change other attributes such as batch size, learning rate, number of epochs, number of workers, resume and continue training from a checkpoint. List of selectable attributes:

'--name', '--out_file', '--workers', '--batch-size', '--resume', '--data', '--print_freq', '--epochs', '--start_epoch', '--save_freq'

Model Testing

You can test your model on 1000 random images with level noise of 2 by running the fowwloing command:

python validation.py

By default validation is using the my pretrained model. If you're willing to test your own model you must change the checkpoint in the find_circle() function.

Traing Loss

Losses for trainig the model will be saved in the out.txt file. Trinig loss of 50 epochs is as follows: Training Loss

Validation Scores

Validation scores using the metric AP 0.7 are as follows:

validation scores

circle-detection-cnn's People

Contributors

hsouri 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

Watchers

 avatar  avatar

circle-detection-cnn's Issues

ng-translate

Généraliser la traduction des données
ng-translate ?

Torchvision version?

The requirements.txt (Typo in the name by the way) lists torch, but not torchvision. I think torchvision should be added to the requirements.txt file. The version that worked for me was torchvision==0.2.2.

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.