After comparing the accuracy and speed of several models, I finally select Inception-v3 to deploy my 102 classes flower classification project which was trained on Oxford-102 flower dataset. The final model file in this folder which include the freezed pb file.
Other project including ποΈBird-200, πCar-196, πΆDog-120, πΆπ±Pet-37 described in Deep-Model-Transfer will be enclosed in the future.
- GTX 1080
- CUDA 10.1
- CuDNN 7.6.5
- TensorFlow 1.5.0+/2.0.0+
- For TensorFlow 2.0.0+
nothing to change
- For TensorFlow 1.5.0+
comment import tensorflow.compat.v1 as tf
uncomment import tensorflow as tf
same as server_html.py/server_api.py
Command
# create folder to store images uploaded
>>> mkdir /tem/upload
>>> python3 -u server_html.py \
--model_name=./all_102_inception_v3/all_102_inception_v3_named_freeze.pb \
--label_file=./all_102_inception_v3/all_102_inception_v3_named_freeze.label \
--upload_folder=/tmp/upload
How open http://<your_ip>:5001/ upload image get result
Command
# create folder to store images uploaded
>>> mkdir /tem/upload
>>> python3 -u server_api.py \
--model_name=./all_102_inception_v3/all_102_inception_v3_named_freeze.pb \
--label_file=./all_102_inception_v3/all_102_inception_v3_named_freeze.label \
--upload_folder=/tmp/upload
Definition
If upload image URL path:
POST /FROMURL
If upload image file:
POST /FROMFILE
Arguments
If upload image URL path:
"file":string
.jpg image URL path
If upload image file:
"file":binary
.jpg image binary file
Response
200 OK
on success
{
"data": {
"Top 1 name": "ηε
°θ±",
"Top 1 score": "100.00%",
"Top 2 name": "θθ±",
"Top 2 score": "0.00%",
"Top 3 name": "ζ θιΎθθ±",
"Top 3 score": "0.00%",
"Top 4 name": "ηε±±ιΎηΌθ±",
"Top 4 score": "0.00%",
"Top 5 name": "η«η°θ±",
"Top 5 score": "0.00%"
}
}
How