[Japanese/English]
Hands-on for TensorFlow Lite Model Maker.
Annotation with VoTT is performed on the local PC, and learning-inference is performed on Colaboratory.
You can also use the annotated dataset without annotating it.
This repository contains the following:
- Dataset (Annotation not implemented)
- Dataset (Annotated)
- Script for Google Colaboratory(Environment setting, model training, inference result confirmation)
Tensorflow 2.5.0 or later
This hands-on assumes about 1.5 hours.
- VoTT:Annotation(30-60minutes)
- Colaboratory:Environmental preparation
- Colaboratory:Convert to format read by object_detector
- Colaboratory:Model training(About 5-10minutes)
- Colaboratory:Inference
The following is required as a preliminary preparation.
- Clone this repository to your local PC.
- VoTT installation.
Annotate using VoTT and output in CSV format.
If you use annotated datasets, skip this chapter.
VoTT project settings
Display name:TFLite-ModelMaker-EfficientDet-Colab-Hands-On
Security token:Generate New Security Token
Source connection:Press「Add Connection」
Display name:TFLite-ModelMaker-EfficientDet-Colab-Hands-On-TrainData Provider: Local file system Folder path:Specify the "01_dataset" directory of the cloned repository
Target connection:Add Connection
Display name:TFLite-ModelMaker-EfficientDet-Colab-Hands-On-Target
Provider:Local file system
Folder path:Arbitrary directory
CSV export
Provider:Comma separated values(CSV)
Asset status: Tagged assets only
Press "Save Export Settings"
Click the export icon from the annotation screen to export CSV.
Subsequent work will be performed on Google Colaboratory.
Open your notebook from the [Open In Colab] link and run it in the following order.
- Install the required packages
- Import the required packages
After executing "!mkdir dataset", store the image file and CSV file exported from VoTT.
After storing, execute the following.
If you do not want to perform the annotation hands-on, or if you want to try using the annotated data, change the following "if False:" to "if True:" and execute it.
if False:
!git clone https://github.com/Kazuhito00/TFLite-ModelMaker-EfficientDet-Colab-Hands-On
!cp -r TFLite-ModelMaker-EfficientDet-Colab-Hands-On/02_dataset\(Annotated\)/* ./dataset
- Read CSV
- Split Training data/validation data/Test data
- Convert to format read by object_detector
Please execute in the following order.
- Import csv file with Model Maker
- Choose an object detection model archiecture
- Training
- Model evaluate
- Export to TensorFlow Lite format(Full integer quantization)
- Export to TensorFlow Lite format(Float16 quantization)
Please execute in the following order.
- Inference(Full integer quantization)
- Inference(Float16 quantization)
Kazuhito Takahashi(https://twitter.com/KzhtTkhs)
TFLite-ModelMaker-EfficientDet-Colab-Hands-On is under MIT license.