mirror of
https://github.com/ultralytics/ultralytics
synced 2026-04-21 22:17:16 +00:00
34 lines
1.7 KiB
Text
34 lines
1.7 KiB
Text
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
|
|
|
# Builds ultralytics/ultralytics:latest-python-export image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
|
# Full-featured image with export capabilities for YOLO model conversion
|
|
|
|
# Build from lightweight Ultralytics Python image
|
|
FROM ultralytics/ultralytics:latest-python
|
|
|
|
# Install export-specific system packages
|
|
# gnupg required for Edge TPU install
|
|
# Java runtime environment (default-jre-headless) required for Sony IMX export
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends gnupg default-jre-headless && \
|
|
apt-get clean && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install export dependencies and run exports to AutoInstall packages
|
|
RUN uv pip install --system -e ".[export]" && \
|
|
# Run exports to AutoInstall packages
|
|
yolo export model=tmp/yolo11n.pt format=edgetpu imgsz=32 && \
|
|
yolo export model=tmp/yolo11n.pt format=ncnn imgsz=32 && \
|
|
yolo export model=tmp/yolo11n.pt format=imx imgsz=32 && \
|
|
uv pip install --system paddlepaddle x2paddle && \
|
|
# Remove extra build files
|
|
rm -rf tmp /root/.config/Ultralytics/persistent_cache.json
|
|
|
|
# Usage --------------------------------------------------------------------------------------------------------------
|
|
|
|
# Production builds: https://github.com/ultralytics/ultralytics/blob/main/.github/workflows/docker.yml
|
|
# Example (build): t=ultralytics/ultralytics:latest-python-export && docker build -f docker/Dockerfile-python-export -t $t .
|
|
# Example (push): docker push $t
|
|
# Example (pull): t=ultralytics/ultralytics:latest-python-export && docker pull $t
|
|
# Example (run): docker run -it --ipc=host $t
|
|
# Example (run-with-volume): docker run -it --ipc=host -v "$PWD/shared/datasets:/datasets" $t
|