Sign inSign up

javasoze/image-classifier

By javasoze

•Updated over 7 years ago

image classifier based on keras and tensorflow

Image
0

372

javasoze/image-classifier repository overview

⁠image-classifier

image classifier based on keras and tensorflow

⁠Prerequisites

⁠Install

docker pull javasoze/image-classifier

⁠Creating trainning data

create a directory with training data using directory names as labels, e.g. using training as the top-level directory name:

train
  /dog
     dog-img1.jpeg
     dog-img2.jpeg
     ...
  /cat
     cat-img1.jpeg
     img2.png
     img3.jpeg

⁠Training

create a directory to store models:

mkdir models

run classifier virtual machine:

docker run \
-it \
--mount type=bind,source="$(pwd)"/train,target=/train \
--mount type=bind,source="$(pwd)"/models,target=/models \
javasoze/image-classifier bash

once inside virtual machine's shell:

python train.py -d /train -o /models

Model will be output to models directory

⁠Prediction

Given a new image to predict, e.g. kitten.jpeg:

Let's first create an input directory:

mkdir input

Now copy it to the input directory we just created

again, run the classifier virtual machine:

docker run \
-it \
--mount type=bind,source="$(pwd)"/input,target=/input,readonly \
--mount type=bind,source="$(pwd)"/models,target=/models,readonly \
javasoze/image-classifier bash

once inside virtual machine's shell:

python predict.py -m /models -f /input/kitten.jpeg

⁠Credits

Tag summary

Content type

Image

Digest

Size

860.9 MB

Last updated

over 7 years ago

docker pull javasoze/image-classifier