An APP for identify flowers in Hong Kong with Deep Learning technology.
- Flower list provided by 柴娃娃植物網
- Image annotated by Hong Kong Deep Learning
Keras or pyTorch installed.
It is very easy to set up a docker container for pyTorch and Keras using the following command.
$sudo docker pull floydhub/pytorch:0.2.0-gpu-py2.11
(Note: remove -gpu
if you want CPU only. Change to py3.11
if using python3.)
$sudo nvidia-docker run -ti -v YOURDIRECTORY:/workspace/ -p 8889:8888 -p 8097:8097 floydhub/pytorch:0.2.0-gpu-py2.11
For CPU use normal docker. You can also add /bin/bash
at the end of the command to use bash instead.
Go to your localhost:8889
to access pyTorch Jupyter notebook!
$sudo docker pull floydhub/tensorflow:1.3.0-gpu-py2_aws.12
(settings likewise as above.)
$sudo nvidia-docker run -ti -v YOURDIRECTORY:/workspace/ -p 8888:8888 -p 6006:6006 floydhub/tensorflow:1.3.0-gpu-py2_aws.12
Go to your localhost:8888
to access Keras and Tensorflow Jupyter notebook!
Fine-tuning the pre-trained ResNet50 with Oxford 102 flowers dataset
$./finetuning/boostrap.sh
to download oxford102 dataset
$python resnet50.py
to start fine-tuning
Go to options.py
and change data_dir to your own dataset ABSOLUTE path.
Choose which library, model, optimizer and loss to run in options.py
by changing self.configs
.
$python train.py
to start training.
To add your model, simply do the following:
- create your model class in
core/YOURLIBRARYCHOICE/models
, note that it must take two arguments(args, num_classes)
. - add your model class to
ModelsDict
incore/YOURLIBRARYCHOICE/parser.py
- add your model, optimizer and loss function of your choice to
CONFIGS
inoptions.py
- change
self.configs
to your model inoptions.py
- First at all, install Google Cloud SDK
$gcloud init # set up gcloud compute on your computer,
$gcloud auth application-default login # or if you already initialized before
- Compile your trained model and upload to Google Cloud Storage
$export MODEL_BUCKET=gs://dlhk-flower.appspot.com
$python ./deploy \
--trained_model=model_best_weights \
--model_dir=./checkpoints/2017-10-04_experiment_0/\
--bucket_dir=$MODEL_BUCKET
- Create model on ml-engine
$export MODEL_BINARIES=gs://dlhk-flower.appspot.com/export
$export MODEL_NAME=baseline
$gcloud ml-engine models create $MODEL_NAME --regions=asia-east1 # if you are first time to create model,
$gcloud ml-engine versions create v1 --model $MODEL_NAME --origin $MODEL_BINARIES --runtime-version 1.3 # otherwise just create a new version
- Visdom.
- logger for saving results.
- model.test()
- Model.
- dataloading.
- model.train()
- model.validate()
- model.test()
- tensorboard.
Fine-tuning Deep Convolutional Networks for Plant Recognition