mirror of
https://github.com/ultralytics/ultralytics.git
synced 2025-09-15 15:48:41 +08:00
Use opencv-python-headless in Dockerfiles (#21647)
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
5b55b3cea3
commit
11e43791f4
@ -39,7 +39,8 @@ WORKDIR /ultralytics
|
||||
|
||||
# Copy contents and configure git
|
||||
COPY . .
|
||||
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config
|
||||
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config && \
|
||||
sed -i'' -e 's/"opencv-python/"opencv-python-headless/' pyproject.toml
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt .
|
||||
|
||||
# Install pip packages
|
||||
|
||||
@ -31,7 +31,8 @@ WORKDIR /ultralytics
|
||||
|
||||
# Copy contents and configure git
|
||||
COPY . .
|
||||
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config
|
||||
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config && \
|
||||
sed -i'' -e 's/"opencv-python/"opencv-python-headless/' pyproject.toml
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt .
|
||||
|
||||
# Install pip packages
|
||||
|
||||
@ -19,10 +19,10 @@ ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \
|
||||
|
||||
# Install linux packages
|
||||
# gnupg required for Edge TPU install
|
||||
# Java runtime environment (default-jre) required for Sony IMX export
|
||||
# Java runtime environment (default-jre-headless) required for Sony IMX export
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
python3-pip git zip unzip wget curl htop libgl1 libglib2.0-0 libpython3-dev gnupg default-jre \
|
||||
python3-pip git zip unzip wget curl htop libgl1 libglib2.0-0 libpython3-dev gnupg default-jre-headless \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create working directory
|
||||
@ -30,7 +30,8 @@ WORKDIR /ultralytics
|
||||
|
||||
# Copy contents and configure git
|
||||
COPY . .
|
||||
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config
|
||||
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config && \
|
||||
sed -i'' -e 's/"opencv-python/"opencv-python-headless/' pyproject.toml
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt .
|
||||
|
||||
# Install pip packages
|
||||
|
||||
@ -35,7 +35,8 @@ WORKDIR /ultralytics
|
||||
|
||||
# Copy contents and configure git
|
||||
COPY . .
|
||||
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config
|
||||
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config && \
|
||||
sed -i'' -e 's/"opencv-python/"opencv-python-headless/' pyproject.toml
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt .
|
||||
|
||||
# Download onnxruntime-gpu 1.8.0 and tensorrt 8.2.0.6
|
||||
|
||||
@ -28,7 +28,8 @@ WORKDIR /ultralytics
|
||||
|
||||
# Copy contents and configure git
|
||||
COPY . .
|
||||
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config
|
||||
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config && \
|
||||
sed -i'' -e 's/"opencv-python/"opencv-python-headless/' pyproject.toml
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt .
|
||||
|
||||
# Replace pyproject.toml TF.js version with 'tensorflowjs>=3.9.0' for JetPack5 compatibility
|
||||
|
||||
@ -30,7 +30,8 @@ WORKDIR /ultralytics
|
||||
|
||||
# Copy contents and configure git
|
||||
COPY . .
|
||||
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config
|
||||
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config && \
|
||||
sed -i'' -e 's/"opencv-python/"opencv-python-headless/' pyproject.toml
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt .
|
||||
|
||||
# Pip install numpy, onnxruntime-gpu, torch, torchvision and ultralytics
|
||||
|
||||
@ -19,10 +19,10 @@ ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \
|
||||
|
||||
# Install linux packages
|
||||
# gnupg required for Edge TPU install
|
||||
# Java runtime environment (default-jre) required for Sony IMX export
|
||||
# Java runtime environment (default-jre-headless) required for Sony IMX export
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
python3-pip git zip unzip wget curl htop libgl1 libglib2.0-0 libpython3-dev gnupg default-jre \
|
||||
python3-pip git zip unzip wget curl htop libgl1 libglib2.0-0 libpython3-dev gnupg default-jre-headless \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create working directory
|
||||
@ -30,7 +30,8 @@ WORKDIR /ultralytics
|
||||
|
||||
# Copy contents and configure git
|
||||
COPY . .
|
||||
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config
|
||||
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config && \
|
||||
sed -i'' -e 's/"opencv-python/"opencv-python-headless/' pyproject.toml
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt .
|
||||
|
||||
# Install pip packages
|
||||
|
||||
Loading…
Reference in New Issue
Block a user