You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
2.7 KiB
56 lines
2.7 KiB
2 years ago
|
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||
6 months ago
|
# Builds ultralytics/ultralytics:jetson-jetson-jetpack5 image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
||
|
# Supports JetPack5.x for YOLOv8 on Jetson Xavier NX, AGX Xavier, AGX Orin, Orin Nano and Orin NX
|
||
2 years ago
|
|
||
|
# Start FROM https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-pytorch
|
||
|
FROM nvcr.io/nvidia/l4t-pytorch:r35.2.1-pth2.0-py3
|
||
|
|
||
6 months ago
|
# Set environment variables
|
||
|
ENV APP_HOME /usr/src/ultralytics
|
||
|
|
||
2 years ago
|
# Downloads to user config dir
|
||
10 months ago
|
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/
|
||
2 years ago
|
|
||
|
# Install linux packages
|
||
8 months ago
|
# g++ required to build 'tflite_support' and 'lap' packages
|
||
|
# libusb-1.0-0 required for 'tflite_support' package when exporting to TFLite
|
||
|
# pkg-config and libhdf5-dev (not included) are needed to build 'h5py==3.11.0' aarch64 wheel required by 'tensorflow'
|
||
2 years ago
|
RUN apt update \
|
||
1 year ago
|
&& apt install --no-install-recommends -y gcc git zip curl htop libgl1 libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0
|
||
2 years ago
|
|
||
|
# Create working directory
|
||
6 months ago
|
WORKDIR $APP_HOME
|
||
2 years ago
|
|
||
6 months ago
|
# Copy contents and assign permissions
|
||
|
COPY . $APP_HOME
|
||
6 months ago
|
RUN git remote set-url origin https://github.com/ultralytics/ultralytics.git
|
||
6 months ago
|
ADD https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n.pt $APP_HOME
|
||
2 years ago
|
|
||
11 months ago
|
# Remove opencv-python from Ultralytics dependencies as it conflicts with opencv-python installed in base image
|
||
|
RUN grep -v "opencv-python" pyproject.toml > temp.toml && mv temp.toml pyproject.toml
|
||
1 year ago
|
|
||
7 months ago
|
# Download onnxruntime-gpu 1.15.1 for Jetson Linux 35.2.1 (JetPack 5.1). Other versions can be seen in https://elinux.org/Jetson_Zoo#ONNX_Runtime
|
||
6 months ago
|
ADD https://nvidia.box.com/shared/static/mvdcltm9ewdy2d5nurkiqorofz1s53ww.whl onnxruntime_gpu-1.15.1-cp38-cp38-linux_aarch64.whl
|
||
7 months ago
|
|
||
2 years ago
|
# Install pip packages manually for TensorRT compatibility https://github.com/NVIDIA/TensorRT/issues/2567
|
||
2 years ago
|
RUN python3 -m pip install --upgrade pip wheel
|
||
7 months ago
|
RUN pip install onnxruntime_gpu-1.15.1-cp38-cp38-linux_aarch64.whl
|
||
7 months ago
|
RUN pip install --no-cache-dir -e ".[export]"
|
||
2 years ago
|
|
||
|
|
||
|
# Usage Examples -------------------------------------------------------------------------------------------------------
|
||
|
|
||
|
# Build and Push
|
||
6 months ago
|
# t=ultralytics/ultralytics:latest-jetson-jetpack5 && sudo docker build --platform linux/arm64 -f docker/Dockerfile-jetson-jetpack5 -t $t . && sudo docker push $t
|
||
2 years ago
|
|
||
1 year ago
|
# Run
|
||
6 months ago
|
# t=ultralytics/ultralytics:latest-jetson-jetpack5 && sudo docker run -it --ipc=host $t
|
||
1 year ago
|
|
||
1 year ago
|
# Pull and Run
|
||
6 months ago
|
# t=ultralytics/ultralytics:latest-jetson-jetpack5 && sudo docker pull $t && sudo docker run -it --ipc=host $t
|
||
1 year ago
|
|
||
1 year ago
|
# Pull and Run with NVIDIA runtime
|
||
6 months ago
|
# t=ultralytics/ultralytics:latest-jetson-jetpack5 && sudo docker pull $t && sudo docker run -it --ipc=host --runtime=nvidia $t
|