The previous blog was shared with you on how to compile to use TensorFlow to classified Pre-trained images. Now I have tried to train custom images, and the results get look accurate!
1. Open Comand Prompt and then key in"git clone https://github.com/googlecodelabs/tensorflow-for-poets-2".
2. Create folder fruit inside"TensorFlow-for-poets-2\tf_files". Then create 2 different fruit folder, example:
3. Now can download dataset by google Image durian and durian belanda, then save into the related folder,
3. Open Command Prompt inside this folder "TensorFlow-for-poets-2".
4. Then start train the data set by key in: python scripts/retrain.py --output_graph=tf_files/retrained_graph.pb --output_labels=tf_files/retrained_labels.txt --image_dir=tf_files/fruit.
5. After model train complete. Then we can start test to verify our train model. So download another Durian image then put input Image: C:\Users\csheng\tensorflow-for-poets-2\d1.jpeg
7. Output correct results Result! Done
1. Open Comand Prompt and then key in"git clone https://github.com/googlecodelabs/tensorflow-for-poets-2".
2. Create folder fruit inside"TensorFlow-for-poets-2\tf_files". Then create 2 different fruit folder, example:
3. Now can download dataset by google Image durian and durian belanda, then save into the related folder,
3. Open Command Prompt inside this folder "TensorFlow-for-poets-2".
4. Then start train the data set by key in: python scripts/retrain.py --output_graph=tf_files/retrained_graph.pb --output_labels=tf_files/retrained_labels.txt --image_dir=tf_files/fruit.
5. After model train complete. Then we can start test to verify our train model. So download another Durian image then put input Image: C:\Users\csheng\tensorflow-for-poets-2\d1.jpeg
6. Enter command "python scripts/label_image.py --image d1.JPG" to start verify.
Comments
Post a Comment