Commit 6a69a8ba authored by Juan Diego Gonzales Zuniga's avatar Juan Diego Gonzales Zuniga
Browse files

phase1 update and debug

parent 222a66d5
# Debug Docker image after installation
# Image to debug on phase2
FROM local/dockervino:phase2 as phase2
FROM local/dockervino:phase1 as phase1
MAINTAINER jdg:juan-diego.gonzales-zuniga@kontron.com
ENV tools=$INTEL_OPENVINO_DIR/deployment_tools
......@@ -9,8 +8,6 @@ ENV optimizer=$tools/model_optimizer
ENV converter=$tools/tools/model_downloader/converter.py
ENV models=/root/openvino_models
# Copy models from phase2
COPY --from=phase2 /root/openvino_models/ir /root/openvino_models/ir
WORKDIR $INTEL_OPENVINO_DIR/deployment_tools
RUN apt install -y x11-utils vim strace libtool autoconf libmosquittopp-dev mosquitto mosquitto-clients lsb-release pciutils kmod git
RUN pip3 install paho-mqtt scipy
......
......@@ -32,12 +32,12 @@ input=cam
device=CPU
######## CPU 3D Pose Estimation ###
if [ "$device" == CPU ]; then
app=/opt/intel/openvino/deployment_tools/open_model_zoo/demos/python_demos/human_pose_estimation_3d_demo/human_pose_estimation_3d_demo.py
app=/opt/intel/openvino/deployment_tools/open_model_zoo/demos/human_pose_estimation_3d_demo/python/human_pose_estimation_3d_demo.py
model=${models_dir}/public/human-pose-estimation-3d-0001/FP32/human-pose-estimation-3d-0001.xml
fi
###### NCS2 3D Pose Estimation #####
if [ "$device" == MYRIAD ]; then
app=/opt/intel/openvino/deployment_tools/open_model_zoo/demos/python_demos/human_pose_estimation_3d_demo/human_pose_estimation_3d_demo.py
app=/opt/intel/openvino/deployment_tools/open_model_zoo/demos/human_pose_estimation_3d_demo/python/human_pose_estimation_3d_demo.py
model=${models_dir}/public/human-pose-estimation-3d-0001/FP16/human-pose-estimation-3d-0001.xml
fi
......
......@@ -2,158 +2,94 @@
# Replace openvinoTar with the openvinoversion
# The openvinoTar is erased after installation
FROM ubuntu:18.04
MAINTAINER jdg:juan-diego.gonzales-zuniga@kontron.com
WORKDIR /
SHELL ["/bin/bash", "-xo", "pipefail", "-c"]
# Dependencies
ARG DEPENDENCIES="autoconf \
automake \
build-essential \
cmake \
cpio \
curl \
gnupg2 \
libdrm2 \
libglib2.0-0 \
lsb-release \
libgtk-3-0 \
libtool \
udev \
unzip \
dos2unix \
sudo \
wget \
git"
RUN apt-get update && \
apt-get install -y --no-install-recommends ${DEPENDENCIES} && \
rm -rf /var/lib/apt/lists/*
WORKDIR /thirdparty
RUN sed -Ei 's/# deb-src /deb-src /' /etc/apt/sources.list && \
apt-get update && \
apt-get source ${DEPENDENCIES} && \
rm -rf /var/lib/apt/lists/*
# setup Python
ENV PYTHON python3.6
RUN apt-get update && \
apt-get install -y --no-install-recommends python3-pip python3-dev lib${PYTHON} && \
rm -rf /var/lib/apt/lists/*
# Openvino Version and copy from host
ARG openvinoTar=l_openvino_toolkit_p_2021.1.110
ENV INTEL_OPENVINO_DIR=/opt/intel/openvino_2021.1.110
ARG TEMP_DIR=/tmp/openvino_installer
WORKDIR ${TEMP_DIR}
COPY ./$openvinoTar.tgz $TEMP_DIR
ENV TZ=Europe/Paris
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# install product by installation script
RUN tar -xzf ${TEMP_DIR}/*.tgz --strip 1
RUN sed -i 's/decline/accept/g' silent.cfg && \
${TEMP_DIR}/install.sh -s silent.cfg && \
${INTEL_OPENVINO_DIR}/install_dependencies/install_openvino_dependencies.sh && \
cp ${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/external/97-myriad-usbboot.rules /etc/udev/rules.d/ && \
ldconfig
WORKDIR /tmp
RUN rm -rf ${TEMP_DIR}
# for GPU
ARG GMMLIB=19.3.2
ARG IGC_CORE=1.0.2597
ARG IGC_OPENCL=1.0.2597
ARG INTEL_OPENCL=19.41.14441
ARG INTEL_OCLOC=19.41.14441
ARG TEMP_DIR=/tmp/opencl
WORKDIR ${TEMP_DIR}
RUN apt-get update && \
apt-get install -y --no-install-recommends ocl-icd-libopencl1=2.2.11-1ubuntu1 && \
rm -rf /var/lib/apt/lists/* && \
curl -L "https://github.com/intel/compute-runtime/releases/download/${INTEL_OPENCL}/intel-gmmlib_${GMMLIB}_amd64.deb" --output "intel-gmmlib_${GMMLIB}_amd64.deb" && \
curl -L "https://github.com/intel/compute-runtime/releases/download/${INTEL_OPENCL}/intel-igc-core_${IGC_CORE}_amd64.deb" --output "intel-igc-core_${IGC_CORE}_amd64.deb" && \
curl -L "https://github.com/intel/compute-runtime/releases/download/${INTEL_OPENCL}/intel-igc-opencl_${IGC_OPENCL}_amd64.deb" --output "intel-igc-opencl_${IGC_OPENCL}_amd64.deb" && \
curl -L "https://github.com/intel/compute-runtime/releases/download/${INTEL_OPENCL}/intel-opencl_${INTEL_OPENCL}_amd64.deb" --output "intel-opencl_${INTEL_OPENCL}_amd64.deb" && \
curl -L "https://github.com/intel/compute-runtime/releases/download/${INTEL_OPENCL}/intel-ocloc_${INTEL_OCLOC}_amd64.deb" --output "intel-ocloc_${INTEL_OCLOC}_amd64.deb" && \
dpkg -i ${TEMP_DIR}/*.deb && \
ldconfig && \
rm -rf ${TEMP_DIR}
# for VPU
WORKDIR /opt
RUN curl -L https://github.com/libusb/libusb/archive/v1.0.22.zip --output v1.0.22.zip && \
unzip v1.0.22.zip
WORKDIR /opt/libusb-1.0.22
RUN ./bootstrap.sh && \
./configure --disable-udev --enable-shared && \
make -j4
RUN apt-get update && \
apt-get install -y --no-install-recommends libusb-1.0-0-dev=2:1.0.21-2 && \
rm -rf /var/lib/apt/lists/*
WORKDIR /opt/libusb-1.0.22/libusb
RUN /bin/mkdir -p '/usr/local/lib' && \
/bin/bash ../libtool --mode=install /usr/bin/install -c libusb-1.0.la '/usr/local/lib' && \
/bin/mkdir -p '/usr/local/include/libusb-1.0' && \
/usr/bin/install -c -m 644 libusb.h '/usr/local/include/libusb-1.0' && \
/bin/mkdir -p '/usr/local/lib/pkgconfig'
WORKDIR /opt/libusb-1.0.22/
RUN /usr/bin/install -c -m 644 libusb-1.0.pc '/usr/local/lib/pkgconfig' && \
ldconfig
# for HDDL
WORKDIR /tmp
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libboost-filesystem1.65-dev=1.65.1+dfsg-0ubuntu5 \
libboost-thread1.65-dev=1.65.1+dfsg-0ubuntu5 \
libjson-c3=0.12.1-1.3 libxxf86vm-dev=1:1.1.4-1 && \
rm -rf /var/lib/apt/lists/*
# dev package dependencies
WORKDIR /tmp
RUN ${PYTHON} -m pip install --no-cache-dir setuptools && \
${PYTHON} -m pip install --upgrade pip && \
${PYTHON} -m pip install tensorflow==1.15.3 && \
find "${INTEL_OPENVINO_DIR}/" -type f -name "*requirements*.*" -path "*/${PYTHON}/*" -exec ${PYTHON} -m pip install --no-cache-dir -r "{}" \; && \
find "${INTEL_OPENVINO_DIR}/" -type f -name "*requirements*.*" -not -path "*/post_training_optimization_toolkit/*" -not -name "*windows.txt" -not -name "*ubuntu16.txt" -not -path "*/python3*/*" -not -path "*/python2*/*" -exec ${PYTHON} -m pip install --no-cache-dir -r "{}" \;
WORKDIR ${INTEL_OPENVINO_DIR}/deployment_tools/open_model_zoo/tools/accuracy_checker
RUN source ${INTEL_OPENVINO_DIR}/bin/setupvars.sh && \
${PYTHON} -m pip install --no-cache-dir -r ${INTEL_OPENVINO_DIR}/deployment_tools/open_model_zoo/tools/accuracy_checker/requirements.in && \
${PYTHON} ${INTEL_OPENVINO_DIR}/deployment_tools/open_model_zoo/tools/accuracy_checker/setup.py install
WORKDIR ${INTEL_OPENVINO_DIR}/deployment_tools/tools/post_training_optimization_toolkit
RUN if [ -f requirements.txt ]; then \
${PYTHON} -m pip install --no-cache-dir -r ${INTEL_OPENVINO_DIR}/deployment_tools/tools/post_training_optimization_toolkit/requirements.txt && \
${PYTHON} ${INTEL_OPENVINO_DIR}/deployment_tools/tools/post_training_optimization_toolkit/setup.py install; \
fi;
# Post-installation cleanup and setting up OpenVINO environment variables
RUN if [ -f "${INTEL_OPENVINO_DIR}"/bin/setupvars.sh ]; then \
printf "\nsource \${INTEL_OPENVINO_DIR}/bin/setupvars.sh\n" >> /root/.bashrc; \
fi;
RUN find "${INTEL_OPENVINO_DIR}/" -name "*.*sh" -type f -exec dos2unix {} \;
RUN ${INTEL_OPENVINO_DIR}/deployment_tools/demo/demo_benchmark_app.sh
RUN ln -s ${INTEL_OPENVINO_DIR} /opt/intel/openvino
# Add video group
RUN usermod -aG video root
WORKDIR ${INTEL_OPENVINO_DIR}
FROM ubuntu18_data_dev:2021.3 as build
USER root
ENV downloader=${INTEL_OPENVINO_DIR}/deployment_tools/tools/model_downloader/downloader.py
ENV converter=${INTEL_OPENVINO_DIR}/deployment_tools/tools/model_downloader/converter.py
ENV optimizer=${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/mo.py
ENV tools=${INTEL_OPENVINO_DIR}/deployment_tools
ENV models=/root/openvino_models
WORKDIR $models
RUN apt update && \
apt install sudo && \
${INTEL_OPENVINO_DIR}/deployment_tools/demo/demo_benchmark_app.sh
# Downloading Human Pose Detection
RUN python3 $downloader --name human-pose-estimation-0001 --output_dir $models/ir
# Downloading Face Detection
RUN python3 $downloader --name face-detection-retail-0004 --output_dir $models/ir
# Downloading Age gender Recognition
RUN python3 $downloader --name age-gender-recognition-retail-0013 --output_dir $models/ir
# Downloaing Emotion Recognition
RUN python3 $downloader --name emotions-recognition-retail-0003 --output_dir $models/ir
# Downloading Head Pose Estimation
RUN python3 $downloader --name head-pose-estimation-adas-0001 --output_dir $models/ir
# Download tracker networks
RUN $downloader --name person-detection-retail-0013 --output_dir $models/ir
RUN $downloader --name person-reidentification-retail-0277 --output_dir $models/ir
# Downloading SSD Detection
RUN python3 $downloader --name ssd300 --output_dir $models
RUN python3 $optimizer \
--input_model $models/public/ssd300/models/VGGNet/VOC0712Plus/SSD_300x300_ft/VGG_VOC0712Plus_SSD_300x300_ft_iter_160000.caffemodel \
--input_proto $models/public/ssd300/models/VGGNet/VOC0712Plus/SSD_300x300_ft/deploy.prototxt \
--output_dir $models/ir/ssd300/FP32 --model_name ssd300 --data_type FP32
RUN python3 $optimizer \
--input_model $models/public/ssd300/models/VGGNet/VOC0712Plus/SSD_300x300_ft/VGG_VOC0712Plus_SSD_300x300_ft_iter_160000.caffemodel \
--input_proto $models/public/ssd300/models/VGGNet/VOC0712Plus/SSD_300x300_ft/deploy.prototxt \
--output_dir $models/ir/ssd300/FP16 --model_name ssd300 --data_type FP16
# Downloading Human Pose Detection 3D
RUN python3 $downloader --list $tools/open_model_zoo/demos/human_pose_estimation_3d_demo/python/models.lst
RUN python3 $converter --list $tools/open_model_zoo/demos/human_pose_estimation_3d_demo/python/models.lst --o $models/ir --mo $optimizer
# Download Yolo v3
RUN python3 $downloader --name yolo-v3-tf
#wget https://download.01.org/opencv/public_models/022020/yolo_v3/yolov3.pb && \
#wget https://download.01.org/opencv/public_models/022020/yolo_v3/yolo_v3_new.json
# Optimizer on Yolov3
RUN python3 $optimizer \
--input_model $models/public/yolo-v3-tf/yolo-v3.pb \
--transformations_config $models/public/yolo-v3-tf/yolo-v3.json \
--input_shape [1,416,416,3] \
--output_dir $models/ir/yolo/FP32 \
--model_name yolo_v3 \
--data_type FP32
RUN python3 $optimizer \
--input_model $models/public/yolo-v3-tf/yolo-v3.pb \
--transformations_config $models/public/yolo-v3-tf/yolo-v3.json \
--input_shape [1,416,416,3] \
--output_dir $models/ir/yolo/FP16 \
--model_name yolo_v3 \
--data_type FP16
WORKDIR $models
# Download smallest maskrcnn
RUN python3 $downloader --name mask_rcnn_inception_v2_coco
# Optimizer on maskrcnn
RUN python3 $optimizer \
--input_model $models/public/mask_rcnn_inception_v2_coco/mask_rcnn_inception_v2_coco_2018_01_28/frozen_inference_graph.pb \
--transformations_config $tools/model_optimizer/extensions/front/tf/mask_rcnn_support.json \
--tensorflow_object_detection_api_pipeline $models/public/mask_rcnn_inception_v2_coco/mask_rcnn_inception_v2_coco_2018_01_28/pipeline.config \
--output_dir $models/ir/mask_rcnn/FP32 \
--model_name mask_rcnn_inception_v2 \
--data_type FP32 --reverse_input_channels
RUN python3 $optimizer \
--input_model $models/public/mask_rcnn_inception_v2_coco/mask_rcnn_inception_v2_coco_2018_01_28/frozen_inference_graph.pb \
--transformations_config $tools/model_optimizer/extensions/front/tf/mask_rcnn_support.json \
--tensorflow_object_detection_api_pipeline $models/public/mask_rcnn_inception_v2_coco/mask_rcnn_inception_v2_coco_2018_01_28/pipeline.config \
--output_dir $models/ir/mask_rcnn/FP16 \
--model_name mask_rcnn_inception_v2 \
--data_type FP16 --reverse_input_channels
CMD ["/bin/bash"]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment