Skip to content

Detecting Scratches and Dents on Cars using Darkflow, a Tensorflow implementation of YOLOv2

License

Notifications You must be signed in to change notification settings

rdutta1999/Car-Damage-Detection-Darkflow

Repository files navigation

Car-Damage-Detection-Darkflow

Introduction

This repository goes through the process of setting up Darkflow, and using it to train a custom object detection model. Here, I have trained a Car Damage Detection model, that identifies Scratches and Dents and draws a bounding box around it.

The dataset can be downloaded from here.

Training.ipynb contains the source code, and the trained model weights (checkpoint files) are available in the checkpoints folder.

Setting Up:-

  1. Create a new Python/Anaconda enviroment (optional but recommended).

  2. Install the necessary packages:-

    • conda install numpy pandas matplotlib opencv cython jupyter
    • If you have a supported GPU, run conda install tensorflow-gpu=1.14
    • If you don't have a supported GPU or want to train on a CPU, run conda install tensorflow=1.14
  3. Clone the Darkflow repository into your working directory and run cd darkflow.

  4. Setup darkflow and build the Cython extensions.

    • pip install .
    • python setup.py build_ext --inplace
  5. Download the yolo weights from here and again place in the working directory. More info in the .ipynb file.

  6. From the Object Detection Metrics repository, download and copy the following into the working directory:-

    • pascalvoc.py
    • _init_paths.py
    • lib module
  7. Download the dataset and place it in the following manner:-

├─── darkflow
     ├─── ..
     ├─── ..
     ├─── cfg
     ├─── checkpoints
     ├─── lib
     ├─── test_imgs
     ├─── pascalvoc.py
     ├─── _init_paths.py
     ├─── labels.txt
     ├─── Training.ipynb
     ├─── yolo.weights
     └─── data
          ├─── annotations
               ├─── annot1.xml
               ├─── annot2.xml
               ├─── annot3.xml
               ├─── annot5.xml
               ├─── annot6.xml
               ├─── ..
               ├─── ..
               └─── ..
           └─── images
               ├─── img1.jpg
               ├─── img2.jpg
               ├─── img3.jpg
               ├─── img4.jpg
               ├─── img5.jpg
               ├─── ..
               ├─── ..
               └─── ..

Outputs

Pic1 Pic2 Pic3

References

About

Detecting Scratches and Dents on Cars using Darkflow, a Tensorflow implementation of YOLOv2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published