Giter Site home page Giter Site logo

trellixvulnteam / object_detection_on_cavities_0ss7 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from atul-g/object_detection_on_cavities

0.0 0.0 0.0 579.11 MB

Detecting cavities or tooth decay on images of teeth using Tensorflow's Object Detection API.

Shell 0.34% JavaScript 0.07% C++ 3.28% Python 34.41% Java 0.03% Makefile 0.01% HTML 0.30% GLSL 0.01% Jupyter Notebook 61.23% Dockerfile 0.02% Starlark 0.30%

object_detection_on_cavities_0ss7's Introduction

Detecting tooth decay and cavities using Tensorflow Object Detection API

image_prediction

In this project I use tensorflow's Object Detection API to detect tooth decay and possibly early stage cavities. I made my own dataset of images, which was collected from Google Images.

Note:I made a similiar project on this before where I used CNN to classify images into categories- having decay/cavities, not having any decay/cavities. The results weren't convincing enough so I decided to move to Object Detection. The results turned out to be much better.

Project Tree:

  • The models directory is cloned from tensorflow's models repo.
  • The labelimg-master is cloned from this repository. I used it to annotate my images.
  • The main working directory is the my_custom_directory:
  • images contains our dataset of images with it's corresponding xml files which was created with the help of labelimg.
  • ssd_mobilenet_v1_coco_2018_01_28 is the model which I used to train on my dataset. Other models can be found here.
  • The training directory contains the config files for the model and also the label-map which is needed by the model for training and also detection. The model stores it's checkpoints in this directory.
  • trained_inference_graph contains the graph exported from the trained model using the export_inference_graph.py script which was copied from the object_detection directory.
  • model_main.py is the script which is used to start the training of the model.
  • generate_tfrecord.py and xml_to_csv.py were scripts used from this repo. A really simple and convenient way to convert the xml files created to CSV and then generating Tensorflow records which will be used to train the model. The generated CSV files and the TFrecords are in the data directory.

Training:

  1. Clone the models repo from tensorflow. Follow their installation instructions to setup the environment needed for the project.
  2. Collect the dataset. I had around 350 images in total
  3. Annotate the images with the help of labelimg. Run python3 labelimg.py to start the application.
  4. Use xml_to_csv.py and generate_tfrecords.py to get the final train.records and test.records files.
  5. Select your model and clone it. Get the corresponding config file from /models/research/object_detection/samples directory.
  6. Edit the config file.
  7. Create the .ptxt file which will be the label-map. Mine is object-detection.pbtxt.
  8. Run the model_main.py. I used 40000 steps to train the model.
  9. Use export_inference_graph.py to generate the graph needed for further prediction. (Use the best checkpoint file for this)
  10. For further predictions just paste images in the test_image_dir.
  11. The code to make predictions from trained models were derived from the object_detections_tutorial.ipynb. I made a few changes to it as the code seemed to render some errors.

Since I trained it in colab, you can find the cavity_detection.ipynb notebook which does all of the above.

References:

object_detection_on_cavities_0ss7's People

Contributors

atul-g avatar dependabot[bot] avatar trellixvulnteam 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.