The goal of this project is to build a Tensorflow Object Detection model designed to detect the Cloudera and Hortonworks logos. This project will include the scripts, photos, and instructions that are required to follow this project at home. This Github repo include annotated images and completed models for quick testing.
Language: Python
Requirements:
- Python 3.8
- Tensorflow 2.3.1
Author: Ian R Brooks
Follow: LinkedIn - Ian Brooks PhD
- TensorFlow 2 Object Detection API tutorial
- Object Detection Tutorial Link
- Another Object Detection Tutorial
- Yet Another Object Detection Tutorial
- Logo Object Detection Article
- Logo Object Detection Article Using SSD
Image Augmentation For Object Detection:
- Great Read on Data Augmentation for Object Detection
- Image Augmentation Examples in Python
- Image Augmentation Using Keras
- Importing a TensorFlow GraphDef based Models into TensorFlow.js
- Getting Started With TensorFlow.js
- Convert TensorFlow Saved Model to TF Lite Model
- Exporting Tained Model for Inference
- Convert Tensorflow Model for TPU
- Convert Tensorflow Model to TFLite
- Coral Board Hardware
- Coral Board Getting Started
- Retrain Object Detection Model Tutorial
- Coral Dev Board - Hands On
- Tensorflow Object Detection API
- Online Edge TPU Compiler
- LabelImg - Free Object Labeling Tool
- Data Augmentation for Object Detection GitHub
- ImageMagick - Free Image Processing Tool
- SSD: Single Shot MultiBox Detector
- Gif Maker!!!
Since this is an Object Detection model, images and annotation labels, which x,y coordinate information on the location of the object in the image, are both required for training. To create these label annotations, the software package LabelImg can create the object's label annotation into XML files. Please note this step is optional, these files have been provided in this project, and they are avaiable in the Images/train/ or Images/test/ directories. Below is a screenshot of the the application.
Considering this is a Deep Learning model, the training set should be in the 1000s of photographs, but this project only has 10s of photos. In order to create trainset that is proper size, Data Augmentation will be required to create synthetic images for training. Using this library, this project will take the originally provided photos and create synthetic images for training to boost model performance. This article on the subject is a must read to fully understand this project.
This process is automated by provided scripts, but the user will need to determine the amount of synthetic training examples that will be created.
Below are a few different examples, please note the object labels are updated for the image.
Please Note: Any scripts that use '~/' in the path are assuming this is the home directory of the downloaded project. This is the default for CDSW.
- In CSDW/CML, download the project using the git url for here.
- Open a new session, run the CDSW-build.sh script at the terminal prompt, which contains the following operating code.
-
Download the project using the git url for here.
-
Project Setup
./scripts/setup.sh
- Convert CSV labels to Tensorflow TF-Record type.
./scripts/imagePrep.sh
- (Optional) Validate images for sizing errors
python3 scripts/checkImages.py
- Start model training process.
./scripts/buildModel.sh
- Evaluate model
./scripts/evalModel.sh
- Export model
./scripts/exportModel.sh
- Export model
./scripts/exportModelJS.sh
- Export model
./scripts/convertTF2TFL.sh