Closed Heartful-echo closed 1 year ago
Hello @Heartful-echo,
Could you please elaborate your query with complete details and steps followed to reproduce the issue from our end.
Hi @kuaashish
Thank you for your comment.
My steps are below. $ git clone -b v0.10.0 https://github.com/google/mediapipe
$ sed -i -e "/\"imgcodecs\"/d;/\"calib3d\"/d;/\"features2d\"/d;/\"highgui\"/d;/\"video\"/d;/\"videoio\"/d" third_party/BUILD $ sed -i -e "/-ljpeg/d;/-lpng/d;/-ltiff/d;/-lImath/d;/-lIlmImf/d;/-lHalf/d;/-lIex/d;/-lIlmThread/d;/-lrt/d;/-ldc1394/d;/-lavcodec/d;/-lavformat/d;/-lavutil/d;/-lswscale/d;/-lavresample/d" third_party/BUILD
$ sed -i -e "/^ # Optimization flags/i \ \"ENABLE_NEON\": \"OFF\"," third_party/BUILD $ sed -i -e "/^ # Optimization flags/i \ \"WITH_TENGINE\": \"OFF\"," third_party/BUILD
$ sudo python3 setup.py gen_protos
Next, I want to run the following command to build, but I get an error with python3 setup.py gen_protos.
$ sudo python3 setup.py bdist_wheel
I see a file called detection_*** added in 0.10.0. This file has syntax = "proto3"; Until now it was syntax = "proto2"; I'm assuming this has an effect.
I tried changing the syntax="proto3" in the detection_*** files to syntax="proto2" and building. The whl file is created but when I write the code using this whl file I get the below error.
root@ubuntu:/mp# python3 object.py
Traceback (most recent call last):
File "object.py", line 3, in
@Heartful-echo
I could not reproduce the issue from our end. Would you please let us know the complete steps followed from the mediapipe documentation or Any link? Which you can point here that will be helpful to reproduce the issue.
@kuaashish
Can you provide the whl file of mediapipe0.10.0 for aarch64 in python3.8 environment? My aim is to use mediapipe0.10.0 on Raspberry Pi4 64bit. Thank you
I am facing the same issue, i am able to provide a Dockerfile trying to build mediapipe from source. This one creates the Proto-Error aswell.
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
gcc-8 g++-8 \
protobuf-compiler \
ca-certificates \
curl \
wget \
ffmpeg \
git \
unzip \
nodejs \
cmake \
python3-dev \
python3-opencv \
python3-pip \
libopencv-core-dev \
libopencv-highgui-dev \
libopencv-imgproc-dev \
libopencv-video-dev \
libopencv-calib3d-dev \
libopencv-features2d-dev \
software-properties-common && \
add-apt-repository -y ppa:openjdk-r/ppa && \
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/*
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 100 --slave /usr/bin/g++ g++ /usr/bin/g++-8
RUN pip3 install --upgrade setuptools
RUN pip3 install wheel
RUN pip3 install future
RUN pip3 install absl-py numpy protobuf==3.20.1
RUN pip3 install six==1.14.0
# Install bazel
ARG BAZEL_VERSION=6.1.1
RUN mkdir /bazel && \
wget --no-check-certificate -O /bazel/installer.sh "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/b\
azel-${BAZEL_VERSION}-installer-linux-x86_64.sh" && \
wget --no-check-certificate -O /bazel/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE" && \
chmod +x /bazel/installer.sh && \
/bazel/installer.sh && \
rm -f /bazel/installer.sh
# Clone Mediapipe
RUN git clone https://github.com/google/mediapipe.git
RUN cd mediapipe && \
sed -i -e "/\"imgcodecs\"/d;/\"calib3d\"/d;/\"features2d\"/d;/\"highgui\"/d;/\"video\"/d;/\"videoio\"/d" third_party/BUILD && \
sed -i -e "/-ljpeg/d;/-lpng/d;/-ltiff/d;/-lImath/d;/-lIlmImf/d;/-lHalf/d;/-lIex/d;/-lIlmThread/d;/-lrt/d;/-ldc1394/d;/-lavcodec/d;/-lavformat/d;/-lavutil/d;/-lswscale/d;/-lavresample/d" third_party/BUILD && \
sed -i 's/"WITH_WEBP": "OFF"/"WITH_WEBP": "OFF",\n "ENABLE_NEON": "OFF",\n "WITH_TENGINE": "OFF"/' third_party/BUILD
RUN apt-get update && apt-get install -y libprotobuf-dev
#replace __version__ variable in setup.py
RUN sed -i "s|__version__ = 'dev'|__version__ = '0.8'|g" mediapipe/setup.py
RUN cd mediapipe && \
python3 setup.py gen_protos
RUN cd mediapipe && \
python3 setup.py bdist_wheel
Be aware that this needs some space and time to be built but it shows how the current Proto-Error is raising.
@Heartful-echo,
We do not have official wheels for aarch64 in python now. However, Support of Raspberry Pi is in our roadmap and will be available soon.
@kuaashish
This is very good information. I hope one day MediaPipe will be available on Raspberry Pi and CPUs with the same aarch64 architecture. This case will be closed.
I appreciate your support.
OS Platform and Distribution
Ubuntu20.04 LTS
Compiler version
gcc/gcc+8
Programming Language and version
Python3.8
Installed using virtualenv? pip? Conda?(if python)
No response
MediaPipe version
0.10.0
Bazel version
5.1
XCode and Tulsi versions (if iOS)
No response
Android SDK and NDK versions (if android)
No response
Android AAR (if android)
None
OpenCV version (if running on desktop)
No response
Describe the problem
Complete Logs