Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

Dockerfile-python-export 1.9 KB

You have to be logged in to leave a comment. Sign In
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
  1. # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
  2. # Builds ultralytics/ultralytics:latest-python-export image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
  3. # Full-featured image with export capabilities for YOLO model conversion
  4. # Build from lightweight Ultralytics Python image
  5. FROM ultralytics/ultralytics:latest-python
  6. # Install export-specific system packages
  7. # gnupg required for Edge TPU install
  8. # Java runtime environment (default-jre-headless) required for Sony IMX export
  9. RUN apt-get update && \
  10. apt-get install -y --no-install-recommends gnupg default-jre-headless && \
  11. apt-get clean && \
  12. rm -rf /var/lib/apt/lists/*
  13. # Install export dependencies and run exports to AutoInstall packages
  14. RUN uv pip install --system -e ".[export]" && \
  15. # Need lower version of 'numpy' for Sony IMX export
  16. uv pip install --system numpy==1.26.4 && \
  17. # Run exports to AutoInstall packages
  18. yolo export model=yolo11n.pt format=edgetpu imgsz=32 && \
  19. yolo export model=yolo11n.pt format=ncnn imgsz=32 && \
  20. yolo export model=yolo11n.pt format=imx imgsz=32 && \
  21. uv pip install --system paddlepaddle x2paddle && \
  22. # Remove extra build files
  23. rm -rf tmp /root/.config/Ultralytics/persistent_cache.json
  24. # Usage Examples -------------------------------------------------------------------------------------------------------
  25. # Build and Push
  26. # t=ultralytics/ultralytics:latest-python-export && sudo docker build -f docker/Dockerfile-python-export -t $t . && sudo docker push $t
  27. # Run
  28. # t=ultralytics/ultralytics:latest-python-export && sudo docker run -it --ipc=host $t
  29. # Pull and Run
  30. # t=ultralytics/ultralytics:latest-python-export && sudo docker pull $t && sudo docker run -it --ipc=host $t
  31. # Pull and Run with local volume mounted
  32. # t=ultralytics/ultralytics:latest-python-export && sudo docker pull $t && sudo docker run -it --ipc=host -v "$(pwd)"/shared/datasets:/datasets $t
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...