|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FROM tensorflow/tensorflow:nightly-devel |
|
|
|
|
|
|
|
RUN git clone --depth 1 https://github.com/tensorflow/models.git && \ |
|
mv models /tensorflow/models |
|
|
|
|
|
|
|
|
|
RUN apt-get -y update && apt-get install -y gpg-agent && \ |
|
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" && \ |
|
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \ |
|
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \ |
|
apt-get update -y && apt-get install google-cloud-sdk -y |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RUN export DEBIAN_FRONTEND=noninteractive && \ |
|
apt-get install -y protobuf-compiler python-pil python-lxml python-tk && \ |
|
pip install Cython && \ |
|
pip install contextlib2 && \ |
|
pip install jupyter && \ |
|
pip install matplotlib |
|
|
|
|
|
RUN git clone --depth 1 https://github.com/cocodataset/cocoapi.git && \ |
|
cd cocoapi/PythonAPI && \ |
|
make -j8 && \ |
|
cp -r pycocotools /tensorflow/models/research && \ |
|
cd ../../ && \ |
|
rm -rf cocoapi |
|
|
|
|
|
RUN curl -OL "https://github.com/google/protobuf/releases/download/v3.0.0/protoc-3.0.0-linux-x86_64.zip" && \ |
|
unzip protoc-3.0.0-linux-x86_64.zip -d proto3 && \ |
|
mv proto3/bin/* /usr/local/bin && \ |
|
mv proto3/include/* /usr/local/include && \ |
|
rm -rf proto3 protoc-3.0.0-linux-x86_64.zip |
|
|
|
|
|
RUN cd /tensorflow/models/research && \ |
|
protoc object_detection/protos/*.proto --python_out=. |
|
|
|
|
|
ENV PYTHONPATH $PYTHONPATH:/tensorflow/models/research:/tensorflow/models/research/slim |
|
|
|
|
|
|
|
|
|
RUN apt-get install -y wget vim emacs nano |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RUN mkdir -p /tmp/pet_faces_tfrecord/ && \ |
|
cd /tmp/pet_faces_tfrecord && \ |
|
curl "http://download.tensorflow.org/models/object_detection/pet_faces_tfrecord.tar.gz" | tar xzf - |
|
|
|
|
|
|
|
RUN cd /tmp && \ |
|
curl -O "http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_0.75_depth_300x300_coco14_sync_2018_07_03.tar.gz" && \ |
|
tar xzf ssd_mobilenet_v1_0.75_depth_300x300_coco14_sync_2018_07_03.tar.gz && \ |
|
rm ssd_mobilenet_v1_0.75_depth_300x300_coco14_sync_2018_07_03.tar.gz |
|
|
|
|
|
|
|
RUN cd /tmp && \ |
|
curl -L -o tflite.zip \ |
|
https://storage.googleapis.com/download.tensorflow.org/models/tflite/frozengraphs_ssd_mobilenet_v1_0.75_quant_pets_2018_06_29.zip && \ |
|
unzip tflite.zip -d tflite && \ |
|
rm tflite.zip |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ENV ANDROID_HOME /opt/android-sdk-linux |
|
ENV ANDROID_NDK_HOME /opt/android-ndk-r14b |
|
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools |
|
|
|
|
|
RUN cd /opt && \ |
|
curl -OL https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip && \ |
|
unzip sdk-tools-linux-4333796.zip -d ${ANDROID_HOME} && \ |
|
rm sdk-tools-linux-4333796.zip |
|
|
|
|
|
|
|
|
|
RUN yes | sdkmanager --licenses |
|
|
|
|
|
RUN yes | sdkmanager \ |
|
"tools" \ |
|
"platform-tools" \ |
|
"platforms;android-27" \ |
|
"platforms;android-23" \ |
|
"build-tools;27.0.3" \ |
|
"build-tools;23.0.3" |
|
|
|
|
|
RUN cd /opt && \ |
|
curl -L -o android-ndk.zip http://dl.google.com/android/repository/android-ndk-r14b-linux-x86_64.zip && \ |
|
unzip -q android-ndk.zip && \ |
|
rm -f android-ndk.zip |
|
|
|
|
|
RUN cd /tensorflow && \ |
|
printf '\n\n\nn\ny\nn\nn\nn\ny\nn\nn\nn\nn\nn\nn\n\ny\n%s\n\n\n' ${ANDROID_HOME}|./configure |
|
|
|
|
|
WORKDIR /tensorflow |
|
|