Skip to content

Instantly share code, notes, and snippets.

@magirtopcu
Created July 15, 2018 17:50
Show Gist options
  • Save magirtopcu/144b6a3d139e45f4e34c4c202ac1c6bc to your computer and use it in GitHub Desktop.
Save magirtopcu/144b6a3d139e45f4e34c4c202ac1c6bc to your computer and use it in GitHub Desktop.
Tensorflow object detection docker
FROM "ubuntu"
RUN apt-get update && yes | apt-get upgrade
RUN mkdir -p /tensorflow/models
RUN apt-get install -y git python-pip curl unzip
RUN curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip
RUN unzip protoc-3.2.0-linux-x86_64.zip -d protoc3
RUN mv protoc3/bin/* /usr/local/bin/
RUN mv protoc3/include/* /usr/local/include/
RUN protoc --version
RUN pip install tensorflow
RUN apt-get install -y python-pil python-lxml
RUN pip install jupyter
RUN pip install matplotlib
RUN git clone https://github.com/tensorflow/models.git /tensorflow/models
WORKDIR /tensorflow/models/research
RUN protoc object_detection/protos/*.proto --python_out=.
RUN export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim
RUN jupyter notebook --generate-config --allow-root
RUN echo "c.NotebookApp.password = u'sha1:6a3f528eec40:6e896b6e4828f525a6e20e5411cd1c8075d68619'" >> /root/.jupyter/jupyter_notebook_config.py
EXPOSE 8888
CMD ["jupyter", "notebook", "--allow-root", "--notebook-dir=/tensorflow/models/research/object_detection", "--ip='*'", "--port=8888", "--no-browser"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment