Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

TensorFlow Object Detection Starter is a sample project also a guide of how you can train your own data for object detection

License

NotificationsYou must be signed in to change notification settings

CognitiveBuild/TensorFlowObjectDetectionStarter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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".

Preparation

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

Retraining

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 trained model

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

Convert trained model to TFLite format

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp