This is the repository developed to classify two different organism from their scientific images using this CodeLab guide by Google.
To develop this classifier, TensorFlow framework and the famous Inception model are used. What is done to get this repository is basically retraining Inception's final layer for our categories which are Caenorhabditis elegans and Halicephalobus mephisto.
Our classifier script is classifier.py
as one can easily guess :)
Image data that used for retraining of final layer can be found under the rhabditidae folder. To understand what other parts of the repository required for, you can check retraining script of the TensorFlow from here .
cd $HOME
git clone https://github.com/AhmetCanSolak/rhabditidae-image-classifier-tensorflow
mkdir tf_files
cd tf_files
cp -rf $HOME/rhabditidae-image-classifier-tensorflow/* .
-
Start the docker image
docker run -it -v $HOME/tf_files:/tf_files/ gcr.io/tensorflow/tensorflow:latest-devel
-
Run the classifier script to label the image.
python /tf_files/classifier.py <path_to_image>
-
Open a new folder under rhabditidae folder with name of the category you want to add.
-
Put the images of the corresponding category into this folder.
-
Start docker image again and run the command:
python tensorflow/examples/image_retraining/retrain.py \
--bottleneck_dir=/tf_files/bottlenecks \
--how_many_training_steps 500 \
--model_dir=/tf_files/inception \
--output_graph=/tf_files/retrained_graph.pb \
--output_labels=/tf_files/retrained_labels.txt \
--image_dir /tf_files/rhabditidae
- Run the classifier script again to check new category label.
python /tf_files/classifier.py <path_to_image>
GPLv3 Licence.