Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating to OVMS 2024.2 - ubuntu22 #74

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions Dockerfile.openvino
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#

ARG BASE_IMAGE
FROM ubuntu:20.04 as base
FROM ubuntu:22.04 as base

LABEL version="0.0.1"
ARG JOBS=16
Expand All @@ -29,6 +29,8 @@ ENV DEBIAN_FRONTEND=noninteractive
# Install unit tests and examples requierments
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
gcc-9 \
g++-9 \
ca-certificates \
curl \
ffmpeg \
Expand All @@ -47,16 +49,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libopencv-calib3d-dev \
libopencv-features2d-dev \
software-properties-common && \
add-apt-repository -y ppa:openjdk-r/ppa && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9 && \
apt-get update && apt-get install -y openjdk-8-jdk && \
apt-get install -y mesa-common-dev libegl1-mesa-dev libgles2-mesa-dev && \
apt-get install -y mesa-utils && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# python setup.py requirements
RUN pip3 install --upgrade setuptools
RUN pip3 install attrs matplotlib wheel future absl-py numpy opencv-contrib-python tensorflow==2.9.0 protobuf==3.20.1 six==1.14.0 tf_slim
RUN pip3 install attrs matplotlib wheel future absl-py opencv-contrib-python numpy==1.26.4 tensorflow==2.9.0 protobuf==3.20.1 six==1.14.0 tf_slim

RUN ln -s /usr/bin/python3 /usr/bin/python
RUN apt-get update && apt-get install -y protobuf-compiler
Expand All @@ -76,7 +78,6 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
vim \
ca-certificates \
python3 \
python3-numpy \
pip \
libopencv-core-dev \
libopencv-highgui-dev \
Expand All @@ -85,7 +86,6 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
libopencv-imgproc-dev \
libopencv-video-dev \
build-essential \
libjson-c4 \
unzip

# install ovms_lib requirements
Expand All @@ -105,7 +105,7 @@ azel-${BAZEL_VERSION}-installer-linux-x86_64.sh" && \
rm -f /bazel/installer.sh

#OPENVINO
ARG DLDT_PACKAGE_URL=https://storage.openvinotoolkit.org/repositories/openvino/packages/2023.0/linux/l_openvino_toolkit_ubuntu20_2023.0.0.10926.b4452d56304_x86_64.tgz
ARG DLDT_PACKAGE_URL=https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.2/linux/l_openvino_toolkit_ubuntu22_2024.2.0.15519.5c0f38f83f6_x86_64.tgz
# OV toolkit package
RUN wget -nv $DLDT_PACKAGE_URL && \
mkdir /opt/intel && \
Expand All @@ -117,7 +117,9 @@ RUN wget -nv $DLDT_PACKAGE_URL && \
WORKDIR /boost
# hadolint ignore=DL3003
RUN wget -nv https://sourceforge.net/projects/boost/files/boost/1.69.0/boost_1_69_0.tar.gz && \
tar xvf boost_1_69_0.tar.gz && cd boost_1_69_0 && ./bootstrap.sh && \
tar xf boost_1_69_0.tar.gz && cd boost_1_69_0 && ./bootstrap.sh && \
sed -i -e 's|#if PTHREAD_STACK_MIN > 0|#ifdef PTHREAD_STACK_MIN|g' boost/thread/pthread/thread_data.hpp && \
# fix for compiler >=9.5 https://github.com/boostorg/thread/pull/297/files
./b2 -j ${JOBS} cxxstd=17 link=static cxxflags='-fPIC' cflags='-fPIC' \
--with-chrono --with-date_time --with-filesystem --with-program_options --with-system \
--with-random --with-thread --with-atomic --with-regex \
Expand All @@ -126,7 +128,7 @@ install

# Main at Fix building without MediaPipe (#2129)
# Update SHA in two places here and in WORKSPACE ovms git repository
ARG OVMS_COMMIT="7f372bc9b0a94cf546ef5f1a43e4a9bf768d6f85"
ARG OVMS_COMMIT="0f60f49bbdf170a58d4a791c3afbb4136135c149"
RUN mkdir /opt/ovms
RUN wget -nv -P /opt/ovms https://raw.githubusercontent.com/openvinotoolkit/model_server/${OVMS_COMMIT}/third_party/cpprest/rest_sdk_v2.10.16.patch
RUN wget -nv -P /opt/ovms https://raw.githubusercontent.com/openvinotoolkit/model_server/${OVMS_COMMIT}/third_party/azure/azure_sdk.patch
Expand Down
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ HTTPS_PROXY := "$(https_proxy)"
OVMS_MEDIA_DOCKER_IMAGE ?= mediapipe_ovms
OVMS_MEDIA_IMAGE_TAG ?= latest
INPUT_VIDEO_LINK ?= "https://www.pexels.com/download/video/3044127/?fps=24.0&h=1080&w=1920"
# Main at Fix building without MediaPipe (#2129)
OVMS_COMMIT ?="9bb7942622d30a3272128db03f5e8b158ee81dcc"
# ov 2024.2RC2 (#2484)
OVMS_COMMIT ?="f18aa027a13e2a1672f3fe131bbddfea5f70a986"
JOBS ?= $(shell python3 -c 'import multiprocessing as mp; print(mp.cpu_count())')
DLDT_PACKAGE_URL ?= https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.1/linux/l_openvino_toolkit_ubuntu20_2024.1.0.15008.f4afc983258_x86_64.tgz
DLDT_PACKAGE_URL ?= https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.2/linux/l_openvino_toolkit_ubuntu22_2024.2.0.15519.5c0f38f83f6_x86_64.tgz

# Targets to use outside running mediapipe_ovms container
docker_build:
Expand Down Expand Up @@ -93,18 +93,18 @@ run_pose_tracking:

run_python_object_detection:
echo "Running python ovms object detection demo"
cp build/lib.linux-x86_64-cpython-38/mediapipe/examples/python/ovms_object_detection.py build/lib.linux-x86_64-cpython-38
python build/lib.linux-x86_64-cpython-38/ovms_object_detection.py
cp build/lib.linux-x86_64-cpython-310/mediapipe/examples/python/ovms_object_detection.py build/lib.linux-x86_64-cpython-310
python build/lib.linux-x86_64-cpython-310/ovms_object_detection.py

run_python_holistic_tracking:
echo "Running python ovms holistic tracking demo"
if [ ! -f video.mp4 ]; then wget -O video.mp4 $(INPUT_VIDEO_LINK); fi
cp build/lib.linux-x86_64-cpython-38/mediapipe/examples/python/ovms_holistic_tracking.py build/lib.linux-x86_64-cpython-38
python build/lib.linux-x86_64-cpython-38/ovms_holistic_tracking.py
cp build/lib.linux-x86_64-cpython-310/mediapipe/examples/python/ovms_holistic_tracking.py build/lib.linux-x86_64-cpython-310
python build/lib.linux-x86_64-cpython-310/ovms_holistic_tracking.py

run_python_face_detection:
echo "Running python ovms face detection demo"
if [ ! -f video.mp4 ]; then wget -O video.mp4 $(INPUT_VIDEO_LINK); fi
cp build/lib.linux-x86_64-cpython-38/mediapipe/examples/python/ovms_face_detection.py build/lib.linux-x86_64-cpython-38
python build/lib.linux-x86_64-cpython-38/ovms_face_detection.py
cp build/lib.linux-x86_64-cpython-310/mediapipe/examples/python/ovms_face_detection.py build/lib.linux-x86_64-cpython-310
python build/lib.linux-x86_64-cpython-310/ovms_face_detection.py

8 changes: 4 additions & 4 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ http_archive(
http_archive(
name = "pybind11",
build_file = "@pybind11_bazel//:pybind11.BUILD",
strip_prefix = "pybind11-2.10.4",
urls = ["https://github.com/pybind/pybind11/archive/v2.10.4.tar.gz"],
strip_prefix = "pybind11-2.11.1",
urls = ["https://github.com/pybind/pybind11/archive/v2.11.1.tar.gz"],
)
load("@pybind11_bazel//:python_configure.bzl", "python_configure")
python_configure(name = "local_config_python")
Expand Down Expand Up @@ -644,7 +644,7 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
git_repository(
name = "ovms",
remote = "https://github.com/openvinotoolkit/model_server",
commit = "9bb7942622d30a3272128db03f5e8b158ee81dcc", # ov 2024.1RC2 (#2418)
commit = "0f60f49bbdf170a58d4a791c3afbb4136135c149", # ov 2024.2RC2 (#2484)
)

# DEV ovms - adjust local repository path for build
Expand Down Expand Up @@ -699,7 +699,7 @@ git_repository(
remote = "https://github.com/tensorflow/serving.git",
tag = "2.13.0",
patch_args = ["-p1"],
patches = ["@ovms//external:net_http.patch", "@ovms//external:listen.patch"]
patches = ["@ovms//external:net_http.patch", "@ovms//external:listen.patch", "@ovms//external:partial.patch"]
# ^^^^^^^^^^^^
# make bind address configurable
# ^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion mediapipe/modules/pose_detection/pose_detection_cpu.pbtxt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ node {
}
#Input name: input_1:0; mapping_name: input_1:0; shape: (1,3,224,224); precision: FP32; layout: N...
#Output name: Identity:0; mapping_name: Identity; shape: (1,2254,12); precision: FP32; layout: N...
#Output name: Identity_1; mapping_name: Identity_1; shape: (1,2254,1); precision: FP32; layout: N...
#Output name: Identity_1:0; mapping_name: Identity_1; shape: (1,2254,1); precision: FP32; layout: N...

# Generates a single side packet containing a vector of SSD anchors based on
# the specification in the options.
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ absl-py
attrs>=19.1.0
flatbuffers>=2.0
matplotlib
numpy
numpy<2.0.0
opencv-contrib-python
protobuf>=3.11,<4
sounddevice>=0.4.4
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,6 @@ def run(self):
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
Expand Down
2 changes: 1 addition & 1 deletion setup_opencv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if [ -z "$1" ]
echo "Installing OpenCV from source"
if [[ -x "$(command -v apt)" ]]; then
apt update && apt install -y build-essential git
apt install -y cmake ffmpeg libavformat-dev libdc1394-22-dev libgtk2.0-dev \
apt install -y cmake ffmpeg libavformat-dev libdc1394-dev libgtk2.0-dev \
libjpeg-dev libpng-dev libswscale-dev libtbb2 libtbb-dev \
libtiff-dev
elif [[ -x "$(command -v dnf)" ]]; then
Expand Down
1 change: 0 additions & 1 deletion third_party/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ cmake(
"-lavformat",
"-lavutil",
"-lswscale",
"-lavresample",
"-ldl",
"-lm",
"-lpthread",
Expand Down