feat: initial HSAP platform
Huaxu Sentinel Active Safety Platform with embedded algorithm code, Docker Compose setup, and vendored dataset scaffolds for clone-and-run. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
59
algorithms/dms_yolo/code/docker/Dockerfile
Normal file
59
algorithms/dms_yolo/code/docker/Dockerfile
Normal file
@@ -0,0 +1,59 @@
|
||||
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
||||
|
||||
# Builds ultralytics/ultralytics:latest image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
||||
# Image is CUDA-optimized for YOLO single/multi-GPU training and inference
|
||||
|
||||
# Start FROM PyTorch image https://hub.docker.com/r/pytorch/pytorch or nvcr.io/nvidia/pytorch:25.02-py3
|
||||
FROM pytorch/pytorch:2.9.1-cuda12.8-cudnn9-runtime
|
||||
|
||||
# Set environment variables
|
||||
# Avoid DDP error "MKL_THREADING_LAYER=INTEL is incompatible with libgomp.so.1 library"
|
||||
# Suppress TensorFlow cuDNN, cuBLAS, and cuFFT Registration Warnings and PyTorch NNPACK warnings
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PIP_NO_CACHE_DIR=1 \
|
||||
PIP_BREAK_SYSTEM_PACKAGES=1 \
|
||||
MKL_THREADING_LAYER=GNU \
|
||||
OMP_NUM_THREADS=1 \
|
||||
TF_CPP_MIN_LOG_LEVEL=3 \
|
||||
TORCH_CPP_LOG_LEVEL=ERROR
|
||||
|
||||
# Downloads to user config dir
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.Unicode.ttf \
|
||||
/root/.config/Ultralytics/
|
||||
|
||||
# Install linux packages
|
||||
# gnupg required for Edge TPU install
|
||||
# libsm6 required by libqxcb to create QT-based windows for visualization; set 'QT_DEBUG_PLUGINS=1' to test in docker
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
gcc git zip unzip wget curl htop libgl1 libglib2.0-0 gnupg libsm6 && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create working directory
|
||||
WORKDIR /ultralytics
|
||||
|
||||
# Copy contents and configure git
|
||||
COPY . .
|
||||
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.4.0/yolo26n.pt .
|
||||
|
||||
# Install pip packages (uv already installed in base image)
|
||||
RUN uv pip install --system -e "." albumentations faster-coco-eval wandb && \
|
||||
# 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 && docker build -f docker/Dockerfile -t $t .
|
||||
# Example (push): docker push $t
|
||||
# Example (pull): t=ultralytics/ultralytics:latest && docker pull $t
|
||||
# Example (run-gpu): docker run -it --ipc=host --runtime=nvidia --gpus all $t
|
||||
# Example (run-gpu-subset): docker run -it --ipc=host --runtime=nvidia --gpus "device=2,3" $t
|
||||
# Note: device=2,3 maps to CUDA 0,1 inside the container.
|
||||
# Example (run-with-volume): docker run -it --ipc=host --runtime=nvidia --gpus all -v "$PWD/shared/datasets:/datasets" $t
|
||||
# Example (tag-release): t=ultralytics/ultralytics:latest tnew=ultralytics/ultralytics:vX.Y && docker tag $t $tnew && docker push $tnew
|
||||
55
algorithms/dms_yolo/code/docker/Dockerfile-arm64
Normal file
55
algorithms/dms_yolo/code/docker/Dockerfile-arm64
Normal file
@@ -0,0 +1,55 @@
|
||||
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
||||
|
||||
# Builds ultralytics/ultralytics:latest-arm64 image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
||||
# Image is aarch64-compatible for Apple M1, M2, M3, Raspberry Pi and other ARM architectures
|
||||
|
||||
# Start FROM Ubuntu image https://hub.docker.com/_/ubuntu with "FROM arm64v8/ubuntu:22.04" (deprecated)
|
||||
# Start FROM Debian image for arm64v8 https://hub.docker.com/r/arm64v8/debian (deprecated)
|
||||
# Start FROM official arm64v8 Ubuntu 24.04 image https://hub.docker.com/layers/arm64v8/ubuntu/24.04/
|
||||
FROM arm64v8/ubuntu:24.04
|
||||
|
||||
# Set environment variables (suppress PyTorch NNPACK warnings)
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PIP_NO_CACHE_DIR=1 \
|
||||
PIP_BREAK_SYSTEM_PACKAGES=1 \
|
||||
TORCH_CPP_LOG_LEVEL=ERROR
|
||||
|
||||
# Downloads to user config dir
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.Unicode.ttf \
|
||||
/root/.config/Ultralytics/
|
||||
|
||||
# Install linux packages
|
||||
# TensorFlow on aarch64 may require pkg-config and libhdf5-dev if h5py builds from source.
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
python3-pip git zip unzip wget curl htop gcc libgl1 libglib2.0-0 gnupg && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create working directory
|
||||
WORKDIR /ultralytics
|
||||
|
||||
# Copy contents and configure git
|
||||
COPY . .
|
||||
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.4.0/yolo26n.pt .
|
||||
|
||||
# Install pip packages, create python symlink, and remove build files
|
||||
RUN python3 -m pip install uv && \
|
||||
uv pip install --system -e ".[export]" --break-system-packages && \
|
||||
# Creates a symbolic link to make 'python' point to 'python3'
|
||||
ln -sf /usr/bin/python3 /usr/bin/python && \
|
||||
# Remove extra build files
|
||||
rm -rf /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-arm64 && docker build --platform linux/arm64 -f docker/Dockerfile-arm64 -t $t .
|
||||
# Example (push): docker push $t
|
||||
# Example (pull): t=ultralytics/ultralytics:latest-arm64 && 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
|
||||
43
algorithms/dms_yolo/code/docker/Dockerfile-conda
Normal file
43
algorithms/dms_yolo/code/docker/Dockerfile-conda
Normal file
@@ -0,0 +1,43 @@
|
||||
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
||||
|
||||
# Builds ultralytics/ultralytics:latest-conda image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
||||
# Image is optimized for Ultralytics Anaconda (https://anaconda.org/conda-forge/ultralytics) installation and usage
|
||||
|
||||
# Start FROM miniconda3 image https://hub.docker.com/r/continuumio/miniconda3
|
||||
FROM continuumio/miniconda3:latest
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PIP_NO_CACHE_DIR=1 \
|
||||
PIP_BREAK_SYSTEM_PACKAGES=1
|
||||
|
||||
# Downloads to user config dir
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.Unicode.ttf \
|
||||
/root/.config/Ultralytics/
|
||||
|
||||
# Install linux packages and conda packages
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends libgl1 && \
|
||||
apt-get clean && \
|
||||
# Install conda packages
|
||||
# mkl required to fix 'OSError: libmkl_intel_lp64.so.2: cannot open shared object file: No such file or directory'
|
||||
conda config --set solver libmamba && \
|
||||
conda install -y pytorch torchvision pytorch-cuda=12.1 -c pytorch -c nvidia && \
|
||||
conda install -y -c conda-forge ultralytics mkl && \
|
||||
conda clean -afy && \
|
||||
# Remove extra build files
|
||||
rm -rf /var/lib/apt/lists/* /root/.config/Ultralytics/persistent_cache.json
|
||||
|
||||
# Copy model
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n.pt .
|
||||
|
||||
# Usage --------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# Production builds: https://github.com/ultralytics/ultralytics/blob/main/.github/workflows/docker.yml
|
||||
# Example (build): t=ultralytics/ultralytics:latest-conda && docker build -f docker/Dockerfile-conda -t $t .
|
||||
# Example (push): docker push $t
|
||||
# Example (pull): t=ultralytics/ultralytics:latest-conda && 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
|
||||
19
algorithms/dms_yolo/code/docker/Dockerfile-cpu
Normal file
19
algorithms/dms_yolo/code/docker/Dockerfile-cpu
Normal file
@@ -0,0 +1,19 @@
|
||||
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
||||
|
||||
# Builds ultralytics/ultralytics:latest-cpu image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
||||
# Lightweight CPU image optimized for inference (extends latest-python)
|
||||
|
||||
# Build from Ultralytics Python image
|
||||
FROM ultralytics/ultralytics:latest-python
|
||||
|
||||
# Set default command to bash
|
||||
CMD ["/bin/bash"]
|
||||
|
||||
# Usage --------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# Production builds: https://github.com/ultralytics/ultralytics/blob/main/.github/workflows/docker.yml
|
||||
# Example (build): t=ultralytics/ultralytics:latest-cpu && docker build -f docker/Dockerfile-cpu -t $t .
|
||||
# Example (push): docker push $t
|
||||
# Example (pull): t=ultralytics/ultralytics:latest-cpu && 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
|
||||
26
algorithms/dms_yolo/code/docker/Dockerfile-export
Normal file
26
algorithms/dms_yolo/code/docker/Dockerfile-export
Normal file
@@ -0,0 +1,26 @@
|
||||
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
||||
|
||||
# Builds ultralytics/ultralytics:latest-export image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
||||
# Export-optimized derivative of ultralytics/ultralytics:latest for testing and benchmarks
|
||||
# Includes all export format dependencies and pre-installed export packages
|
||||
|
||||
FROM ultralytics/ultralytics:latest
|
||||
|
||||
# Install export dependencies and run exports to AutoInstall packages
|
||||
# Numpy 1.26.4 required for TensorFlow export compatibility
|
||||
# Note tensorrt installed on-demand as depends on runtime environment CUDA version
|
||||
RUN uv pip install --system -e ".[export]" "onnxruntime-gpu" paddlepaddle x2paddle numpy==1.26.4 && \
|
||||
# Run exports to AutoInstall packages \
|
||||
yolo export model=tmp/yolo26n.pt format=edgetpu imgsz=32 && \
|
||||
yolo export model=tmp/yolo26n.pt format=ncnn imgsz=32 && \
|
||||
# Remove temporary 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-export && docker build -f docker/Dockerfile-export -t $t .
|
||||
# Example (push): docker push $t
|
||||
# Example (pull): t=ultralytics/ultralytics:latest-export && docker pull $t
|
||||
# Example (run): docker run -it --ipc=host --runtime=nvidia --gpus all $t
|
||||
# Example (run-with-volume): docker run -it --ipc=host --runtime=nvidia --gpus all -v "$PWD/shared/datasets:/datasets" $t
|
||||
69
algorithms/dms_yolo/code/docker/Dockerfile-jetson-jetpack4
Normal file
69
algorithms/dms_yolo/code/docker/Dockerfile-jetson-jetpack4
Normal file
@@ -0,0 +1,69 @@
|
||||
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
||||
|
||||
# Builds ultralytics/ultralytics:latest-jetson-jetpack4 image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
||||
# Supports JetPack4.x for YOLO on Jetson Nano, TX2, Xavier NX, AGX Xavier
|
||||
|
||||
# Start FROM https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-cuda
|
||||
FROM nvcr.io/nvidia/l4t-cuda:10.2.460-runtime
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
PYTHONDONTWRITEBYTECODE=1
|
||||
|
||||
# Downloads to user config dir
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.Unicode.ttf \
|
||||
/root/.config/Ultralytics/
|
||||
|
||||
# Add NVIDIA repositories for TensorRT dependencies
|
||||
RUN wget -q -O - https://repo.download.nvidia.com/jetson/jetson-ota-public.asc | apt-key add - && \
|
||||
echo "deb https://repo.download.nvidia.com/jetson/common r32.7 main" > /etc/apt/sources.list.d/nvidia-l4t-apt-source.list && \
|
||||
echo "deb https://repo.download.nvidia.com/jetson/t194 r32.7 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list
|
||||
|
||||
# Install dependencies
|
||||
# pkg-config and libhdf5-dev (not included) are needed to build 'h5py==3.11.0' aarch64 wheel required by 'tensorflow'
|
||||
# gnupg required for Edge TPU install
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
git python3.8 python3.8-dev python3-pip python3-libnvinfer libopenmpi-dev libopenblas-base libomp-dev gcc && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create symbolic links for python3.8 and pip3
|
||||
RUN ln -sf /usr/bin/python3.8 /usr/bin/python3 && \
|
||||
ln -sf /usr/bin/pip3 /usr/bin/pip
|
||||
|
||||
# Create working directory
|
||||
WORKDIR /ultralytics
|
||||
|
||||
# Copy contents and configure git
|
||||
COPY . .
|
||||
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.4.0/yolo26n.pt .
|
||||
|
||||
# Replace pyproject.toml TF.js version with 'tensorflowjs>=3.9.0' for JetPack4 compatibility
|
||||
RUN sed -i 's/^\( *"tensorflowjs\)>=.*\(".*\)/\1>=3.9.0\2/' pyproject.toml
|
||||
|
||||
# Install pip packages (pip must be upgraded first before installing uv due to missing setuptools)
|
||||
RUN python3 -m pip install --upgrade pip && \
|
||||
python3 -m pip install uv
|
||||
# Install pip packages and remove extra build files
|
||||
# Onnxruntime and TensorRT from https://elinux.org/Jetson_Zoo and https://forums.developer.nvidia.com/t/pytorch-for-jetson/72048
|
||||
RUN uv pip install --system \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/onnxruntime_gpu-1.8.0-cp38-cp38-linux_aarch64.whl \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/tensorrt-8.2.0.6-cp38-none-linux_aarch64.whl \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/torch-1.11.0a0+gitbc2c6ed-cp38-cp38-linux_aarch64.whl \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/torchvision-0.12.0a0+9b5a3fe-cp38-cp38-linux_aarch64.whl && \
|
||||
uv pip install --system -e ".[export]" && \
|
||||
# Remove extra build files
|
||||
rm -rf *.whl /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-jetson-jetpack4 && docker build --platform linux/arm64 -f docker/Dockerfile-jetson-jetpack4 -t $t .
|
||||
# Example (push): docker push $t
|
||||
# Example (pull): t=ultralytics/ultralytics:latest-jetson-jetpack4 && docker pull $t
|
||||
# Example (run): docker run -it --ipc=host --runtime=nvidia $t
|
||||
# Example (run-with-volume): docker run -it --ipc=host --runtime=nvidia -v "$PWD/shared/datasets:/datasets" $t
|
||||
58
algorithms/dms_yolo/code/docker/Dockerfile-jetson-jetpack5
Normal file
58
algorithms/dms_yolo/code/docker/Dockerfile-jetson-jetpack5
Normal file
@@ -0,0 +1,58 @@
|
||||
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
||||
|
||||
# Builds ultralytics/ultralytics:latest-jetson-jetpack5 image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
||||
# Supports JetPack5.1.2 for YOLO on Jetson Xavier NX, AGX Xavier, AGX Orin, Orin Nano and Orin NX
|
||||
|
||||
# Start FROM https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-jetpack
|
||||
FROM nvcr.io/nvidia/l4t-jetpack:r35.4.1
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PIP_NO_CACHE_DIR=1 \
|
||||
PIP_BREAK_SYSTEM_PACKAGES=1
|
||||
|
||||
# Downloads to user config dir
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.Unicode.ttf \
|
||||
/root/.config/Ultralytics/
|
||||
|
||||
# Install dependencies
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
git python3-pip libopenmpi-dev libopenblas-base libomp-dev \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create working directory
|
||||
WORKDIR /ultralytics
|
||||
|
||||
# Copy contents and configure git
|
||||
COPY . .
|
||||
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.4.0/yolo26n.pt .
|
||||
|
||||
# Replace pyproject.toml TF.js version with 'tensorflowjs>=3.9.0' for JetPack5 compatibility and install packages
|
||||
RUN sed -i 's/^\( *"tensorflowjs\)>=.*\(".*\)/\1>=3.9.0\2/' pyproject.toml && \
|
||||
python3 -m pip install --upgrade pip uv
|
||||
|
||||
# Pip install onnxruntime-gpu, torch, torchvision and ultralytics, then remove build files
|
||||
RUN uv pip install --system \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/onnxruntime_gpu-1.18.0-cp38-cp38-linux_aarch64.whl \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/torch-2.2.0-cp38-cp38-linux_aarch64.whl \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/torchvision-0.17.2+c1d70fe-cp38-cp38-linux_aarch64.whl && \
|
||||
# Need lower version of 'numpy' for TensorRT export
|
||||
uv pip install --system numpy==1.23.5 && \
|
||||
uv pip install --system -e ".[export]" && \
|
||||
# Remove extra build files
|
||||
rm -rf *.whl /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-jetson-jetpack5 && docker build --platform linux/arm64 -f docker/Dockerfile-jetson-jetpack5 -t $t .
|
||||
# Example (push): docker push $t
|
||||
# Example (pull): t=ultralytics/ultralytics:latest-jetson-jetpack5 && docker pull $t
|
||||
# Example (run): docker run -it --ipc=host --runtime=nvidia $t
|
||||
# Example (run-with-volume): docker run -it --ipc=host --runtime=nvidia -v "$PWD/shared/datasets:/datasets" $t
|
||||
55
algorithms/dms_yolo/code/docker/Dockerfile-jetson-jetpack6
Normal file
55
algorithms/dms_yolo/code/docker/Dockerfile-jetson-jetpack6
Normal file
@@ -0,0 +1,55 @@
|
||||
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
||||
|
||||
# Builds ultralytics/ultralytics:latest-jetson-jetpack6 image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
||||
# Supports JetPack6.1 for YOLO on Jetson AGX Orin, Orin NX and Orin Nano Series
|
||||
|
||||
# Start FROM https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-jetpack
|
||||
FROM nvcr.io/nvidia/l4t-jetpack:r36.4.0
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PIP_NO_CACHE_DIR=1 \
|
||||
PIP_BREAK_SYSTEM_PACKAGES=1
|
||||
|
||||
# Downloads to user config dir
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.Unicode.ttf \
|
||||
/root/.config/Ultralytics/
|
||||
|
||||
# Install dependencies and cleanup
|
||||
ADD https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/arm64/cuda-keyring_1.1-1_all.deb .
|
||||
RUN dpkg -i cuda-keyring_1.1-1_all.deb && \
|
||||
apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
git python3-pip libopenmpi-dev libopenblas-base libomp-dev libcusparselt0 libcusparselt-dev && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* cuda-keyring_1.1-1_all.deb
|
||||
|
||||
# Create working directory
|
||||
WORKDIR /ultralytics
|
||||
|
||||
# Copy contents and configure git
|
||||
COPY . .
|
||||
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.4.0/yolo26n.pt .
|
||||
|
||||
# Pip install onnxruntime-gpu, torch, torchvision and ultralytics, then remove build files
|
||||
RUN python3 -m pip install --upgrade pip uv && \
|
||||
uv pip install --system \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/onnxruntime_gpu-1.20.0-cp310-cp310-linux_aarch64.whl \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/torch-2.5.0a0+872d972e41.nv24.08-cp310-cp310-linux_aarch64.whl \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/torchvision-0.20.0a0+afc54f7-cp310-cp310-linux_aarch64.whl && \
|
||||
uv pip install --system -e ".[export]" && \
|
||||
# Remove extra build files
|
||||
rm -rf *.whl /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-jetson-jetpack6 && docker build --platform linux/arm64 -f docker/Dockerfile-jetson-jetpack6 -t $t .
|
||||
# Example (push): docker push $t
|
||||
# Example (pull): t=ultralytics/ultralytics:latest-jetson-jetpack6 && docker pull $t
|
||||
# Example (run): docker run -it --ipc=host --runtime=nvidia $t
|
||||
# Example (run-with-volume): docker run -it --ipc=host --runtime=nvidia -v "$PWD/shared/datasets:/datasets" $t
|
||||
27
algorithms/dms_yolo/code/docker/Dockerfile-jupyter
Normal file
27
algorithms/dms_yolo/code/docker/Dockerfile-jupyter
Normal file
@@ -0,0 +1,27 @@
|
||||
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
||||
|
||||
# Builds ultralytics/ultralytics:latest-jupyter image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
||||
# Image provides JupyterLab interface for interactive YOLO development and includes tutorial notebooks
|
||||
|
||||
# Start from Python-based Ultralytics image for full Python environment
|
||||
FROM ultralytics/ultralytics:latest-python
|
||||
|
||||
# Install JupyterLab for interactive development
|
||||
RUN uv pip install --system jupyterlab && \
|
||||
# Create persistent data directory structure
|
||||
mkdir -p /data/{datasets,weights,runs} && \
|
||||
# Configure YOLO directories
|
||||
yolo settings datasets_dir="/data/datasets" weights_dir="/data/weights" runs_dir="/data/runs" && \
|
||||
rm -rf tmp /root/.config/Ultralytics/persistent_cache.json
|
||||
|
||||
# Start JupyterLab with tutorial notebook
|
||||
ENTRYPOINT ["/usr/local/bin/jupyter", "lab", "--allow-root", "--ip=0.0.0.0", "/ultralytics/examples/tutorial.ipynb"]
|
||||
|
||||
# Usage --------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# Production builds: https://github.com/ultralytics/ultralytics/blob/main/.github/workflows/docker.yml
|
||||
# Example (build): t=ultralytics/ultralytics:latest-jupyter && docker build -f docker/Dockerfile-jupyter -t $t .
|
||||
# Example (push): docker push $t
|
||||
# Example (pull): t=ultralytics/ultralytics:latest-jupyter && docker pull $t
|
||||
# Example (run): docker run -it --ipc=host -p 8888:8888 $t
|
||||
# Example (run-with-volume): docker run -it --ipc=host -p 8888:8888 -v "$PWD/datasets:/data/datasets" $t
|
||||
51
algorithms/dms_yolo/code/docker/Dockerfile-nvidia-arm64
Normal file
51
algorithms/dms_yolo/code/docker/Dockerfile-nvidia-arm64
Normal file
@@ -0,0 +1,51 @@
|
||||
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
||||
|
||||
# Builds ultralytics/ultralytics:latest-nvidia-arm64 image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
||||
# Supports JetPack 7.0 and DGX OS for YOLO on Jetson AGX Thor (T5000) and DGX Spark
|
||||
|
||||
# Start FROM PyTorch image nvcr.io/nvidia/pytorch:25.10-py3
|
||||
FROM nvcr.io/nvidia/pytorch:25.10-py3
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PIP_NO_CACHE_DIR=1 \
|
||||
PIP_BREAK_SYSTEM_PACKAGES=1
|
||||
|
||||
# Downloads to user config dir
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.Unicode.ttf \
|
||||
/root/.config/Ultralytics/
|
||||
|
||||
# Install linux packages
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends libgl1 && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create working directory
|
||||
WORKDIR /ultralytics
|
||||
|
||||
# Copy contents and configure git
|
||||
COPY . .
|
||||
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.4.0/yolo26n.pt .
|
||||
|
||||
# Install pip packages (uv already installed in base image)
|
||||
RUN uv pip install --system \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/onnxruntime_gpu-1.24.0-cp312-cp312-linux_aarch64.whl --break-system-packages && \
|
||||
# Reinstall torch and torchvision to ensure CUDA 13.0 compatibility
|
||||
uv pip install --system --force-reinstall torch torchvision --index-url https://download.pytorch.org/whl/cu130 --break-system-packages && \
|
||||
uv pip install --system -e ".[export]" --break-system-packages && \
|
||||
# Remove extra build files
|
||||
rm -rf *.whl /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-nvidia-arm64 && docker build --platform linux/arm64 -f docker/Dockerfile-nvidia-arm64 -t $t .
|
||||
# Example (push): docker push $t
|
||||
# Example (pull): t=ultralytics/ultralytics:latest-nvidia-arm64 && docker pull $t
|
||||
# Example (run): docker run -it --ipc=host --runtime=nvidia $t
|
||||
# Example (run-with-volume): docker run -it --ipc=host --runtime=nvidia -v "$PWD/shared/datasets:/datasets" $t && docker push $tnew
|
||||
50
algorithms/dms_yolo/code/docker/Dockerfile-python
Normal file
50
algorithms/dms_yolo/code/docker/Dockerfile-python
Normal file
@@ -0,0 +1,50 @@
|
||||
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
||||
|
||||
# Builds ultralytics/ultralytics:latest-python image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
||||
# Lightweight CPU image optimized for YOLO inference
|
||||
|
||||
# Use official Python base image for reproducibility (3.11.10 for export and 3.12.10 for inference)
|
||||
FROM python:3.11.10-slim-bookworm
|
||||
|
||||
# Set environment variables (suppress PyTorch NNPACK warnings)
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PIP_NO_CACHE_DIR=1 \
|
||||
PIP_BREAK_SYSTEM_PACKAGES=1 \
|
||||
TORCH_CPP_LOG_LEVEL=ERROR
|
||||
|
||||
# Downloads to user config dir
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \
|
||||
https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.Unicode.ttf \
|
||||
/root/.config/Ultralytics/
|
||||
|
||||
# Install linux packages
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
python3-pip git zip unzip wget curl htop libgl1 libglib2.0-0 && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create working directory
|
||||
WORKDIR /ultralytics
|
||||
|
||||
# Copy contents and configure git
|
||||
COPY . .
|
||||
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.4.0/yolo26n.pt .
|
||||
|
||||
# Install pip packages
|
||||
RUN pip install uv && \
|
||||
uv pip install --system -e . --extra-index-url https://download.pytorch.org/whl/cpu --index-strategy unsafe-best-match && \
|
||||
# Remove extra build files
|
||||
rm -rf tmp ~/.cache /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 && docker build -f docker/Dockerfile-python -t $t .
|
||||
# Example (push): docker push $t
|
||||
# Example (pull): t=ultralytics/ultralytics:latest-python && 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
|
||||
34
algorithms/dms_yolo/code/docker/Dockerfile-python-export
Normal file
34
algorithms/dms_yolo/code/docker/Dockerfile-python-export
Normal file
@@ -0,0 +1,34 @@
|
||||
# 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 (IMX can only export to YOLO11)
|
||||
yolo export model=tmp/yolo26n.pt format=edgetpu imgsz=32 && \
|
||||
yolo export model=tmp/yolo26n.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
|
||||
39
algorithms/dms_yolo/code/docker/Dockerfile-runner
Normal file
39
algorithms/dms_yolo/code/docker/Dockerfile-runner
Normal file
@@ -0,0 +1,39 @@
|
||||
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
||||
|
||||
# Builds GitHub actions CI runner image for deployment to DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
||||
# Image is CUDA-optimized for YOLO single/multi-GPU training and inference tests
|
||||
|
||||
# Start FROM Ultralytics GPU image
|
||||
FROM ultralytics/ultralytics:latest
|
||||
|
||||
# Set additional environment variables for runner
|
||||
ARG RUNNER_VERSION=2.329.0
|
||||
ENV RUNNER_ALLOW_RUNASROOT=1 \
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /actions-runner
|
||||
|
||||
# Download and unpack the runner from https://github.com/actions/runner and install dependencies
|
||||
RUN FILENAME=actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz && \
|
||||
curl -fLso "$FILENAME" "https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/${FILENAME}" && \
|
||||
tar xzf "$FILENAME" && \
|
||||
rm "$FILENAME" && \
|
||||
# Install runner dependencies \
|
||||
uv pip install --system pytest-cov && \
|
||||
./bin/installdependencies.sh && \
|
||||
apt-get update && \
|
||||
apt-get install -y --no-install-recommends libicu-dev && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# JSON ENTRYPOINT command to configure and start runner with default TOKEN and NAME
|
||||
ENTRYPOINT ["sh", "-c", "./config.sh --url https://github.com/ultralytics/ultralytics --token ${GITHUB_RUNNER_TOKEN:-TOKEN} --name ${GITHUB_RUNNER_NAME:-NAME} --labels gpu-latest --replace && ./run.sh"]
|
||||
|
||||
# Usage --------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# Production builds: https://github.com/ultralytics/ultralytics/blob/main/.github/workflows/docker.yml
|
||||
# Example (build): t=ultralytics/ultralytics:latest-runner && docker build -f docker/Dockerfile-runner -t $t .
|
||||
# Example (push): docker push $t
|
||||
# Example (pull): t=ultralytics/ultralytics:latest-runner && docker pull $t
|
||||
# Example (run): docker run -d --restart unless-stopped -e GITHUB_RUNNER_TOKEN=TOKEN -e GITHUB_RUNNER_NAME=NAME --ipc=host --runtime=nvidia --gpus all $t
|
||||
Reference in New Issue
Block a user