-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathyolov8.dockerfile
More file actions
45 lines (38 loc) · 1.62 KB
/
Copy pathyolov8.dockerfile
File metadata and controls
45 lines (38 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Base image for arm64 (Raspberry Pi 5). Build on the Pi directly, or use
# `docker buildx build --platform linux/arm64` from another host.
FROM python:3.11-slim
WORKDIR /app
# OpenCV + Hailo runtime dependencies.
# libgl1: cv2 image codecs
# libglib2.0-0, libsm6, libxext6, libxrender1: common cv2 dependencies
# libgomp1: OpenMP (used by some opencv-python ops)
# ffmpeg: standalone binary used by VideoAnalyzer for libx264 ultrafast
# encoding (~5x faster than cv2's mp4v at 4K on Pi 5).
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1 \
libglib2.0-0 \
libgomp1 \
libsm6 \
libxext6 \
libxrender1 \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Install the local HailoRT wheel. The user must place a wheel matching their
# host driver version into hailort-packages/ before building this image.
# Example filename: hailort-4.23.0-cp311-cp311-linux_aarch64.whl
#
# build-essential + python3-dev are needed to compile `netifaces`, a hailort
# dependency that has no pre-built wheel for cp311/aarch64. They are removed
# after install to keep the final image small.
COPY hailort-packages/*.whl /tmp/
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential python3-dev \
&& pip install --no-cache-dir /tmp/hailort-*.whl \
&& apt-get purge -y --auto-remove build-essential python3-dev \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /tmp/*.whl
COPY . .
EXPOSE 8000
CMD ["python", "web_detection.py", "--model_path", "model/yolov8n.hef", "--video_path", "video/test.mp4"]