Giter VIP home page Giter VIP logo

circlenet-cnn-pytorch's Introduction

Sphere Center Detection in PyTorch - CircleNet

Simple working example of a convolutional neural net implemented in PyTorch that predicts the center of a circle in a black and white image.

Overview

The project is organized into the following key components:

Synthetic Data Generation: Involves generating black and white images with circles of random sizes and positions, and storing the coordinates of their centers.

CircleNet Model: A CNN model implemented in PyTorch. The model takes an image as input and outputs the coordinates of the circle's center.

Training Procedure: The model is trained on the synthetic dataset with the aim to minimize the discrepancy between the model's predicted circle center and the true circle center.

Prediction & Visualization: The prediction script loads a trained CircleNet model and performs predictions on a new set of images. Predicted circle centers and true circle centers are visualized for comparison.

Installation

git clone https://github.com/alxschwrz/circlenet-cnn-pytorch.git
cd circlenet-cnn-pytorch
pip3 install -r requirements.txt

Image Generation

The script "generate_synthetic_spheres.py" can be used to generate a synthetic dataset of black and white images, each containing a circle of random size and position. Along with each generated image, the true coordinates of the circle's center are stored as a label.

python3 generate_synthetic_spheres.py --num_images 1000

Model Training

python3 train.py --n_epochs 20 --batch_size 8 --save_as_onnx True

Visualization

python3 visualize_results.py --model best_model.pth

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.