- Notifications
You must be signed in to change notification settings - Fork0
TensorFlow Object Detection Starter is a sample project also a guide of how you can train your own data for object detection
License
CognitiveBuild/TensorFlowObjectDetectionStarter
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
TensorFlow Object Detection Starter is a sample project also a guide of how you can train your own data for object detection.
Now we're working on the easiest one, which is called "Image Retraining".
- InstallPython 3.6.x (At this moment the Tensorflow does not support Python 3.7.x)
- InstallTensorFlow &TensorFlow Hub
pip install tensorflowpip install tensorflow_hub
Note: if you have seen this kind of error:could not find a version that satisfies the requirement tensorflow
, please Use Python 3.6.x.
- Prepare the images to be trained & verified (tested), please check themhere for example, tag the pictures by naming the folders
There is an official tutorial ofHow to Retrain an Image Classifier for New Categories
python retrain.py --image_dir=samples/retrain/ \--saved_model_dir=result/saved_model/ \--output_graph=result/foo.pb \--output_labels=result/foo.txt \-—bottleneck_dir=result/bottleneck/ \--summaries_dir=result/retrain_logs/ \-—intermediate_output_graphs_dir=result/intermediate_graph/ \--tfhub_module=https://tfhub.dev/google/imagenet/mobilenet_v2_100_224/feature_vector/1 \--how_many_training_steps=4000
After running through the training process, you'll get the trainedmodel
(foo.pb),label
(foo.txt) andsaved_model
files from theresult
folder.
Verify the model withlabel_image.py
, which comes from the official tensorflow repository, and we only changed the default settings so we don't have to type too many parameters. Check out theoriginal folder here for label_image.py
Execute thelabel_image.py
:
python label_image.py
And you should see the output something like:
r2d2 0.99754924bb8 0.0024507595
- There is an official link of Tensorflow TFLite:Introduction to TensorFlow Lite
For the trained data, we can easily usetflite_convert
command like this:
tflite_convert --output_file=result/foo.tflite --input_format=TENSORFLOW_GRAPHDEF --output_format=TFLITE --input_array=Placeholder --output_array=final_result --inference_type=FLOAT --input_data_type=FLOAT --graph_def_file=result/foo.pb
About
TensorFlow Object Detection Starter is a sample project also a guide of how you can train your own data for object detection
Resources
License
Uh oh!
There was an error while loading.Please reload this page.