Skip to content

Commit

Permalink
add:yolov10
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyoujiang committed May 31, 2024
1 parent 5733519 commit 927e097
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Here are some examples that can be run:

| Example | Type | Model/Data Size | Docker Image Size | Command |
| ------------------------------------------------ | ------------------------ | --------------- | ---------- | --------------------------------------- |
| 🆕 [yolov10](/reComputer/scripts/yolov10/README.md) | Computer Vision | 7.2M | 5.74 GB | `reComputer run yolov10` |
| 🆕 llama3 | Text (LLM) | 4.9GB | 10.5GB | `reComputer run llama3` |
| 🆕 [ollama](https://github.com/ollama/ollama) | Inference Server | * | 10.5GB | `reComputer run ollama` |
| LLaVA | Text + Vision (VLM) | 13GB | 14.4GB | `reComputer run llava` |
Expand All @@ -53,7 +54,7 @@ Here are some examples that can be run:
| nanoowl | Vision Transformers(ViT) | 613MB | 15.1GB | `reComputer run nanoowl` |
| [nanodb](../reComputer/scripts/nanodb/readme.md) | Vector Database | 76GB | 7.0GB | `reComputer run nanodb` |
| whisper | Audio | 1.5GB | 6.0GB | `reComputer run whisper` |
| [🆕 yolov8-rail-inspection](/reComputer/scripts/yolov8-rail-inspection/readme.md) |Computer Vision | 6M | 13.8GB | `reComputer run yolov8-rail-inspection` |
| [yolov8-rail-inspection](/reComputer/scripts/yolov8-rail-inspection/readme.md) |Computer Vision | 6M | 13.8GB | `reComputer run yolov8-rail-inspection` |

> Note: You should have enough space to run example, like `LLaVA`, at least `27.4GB` totally
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "jetson-examples"
version = "0.1.1"
version = "0.1.2"
authors = [{ name = "luozhixin", email = "[email protected]" }]
description = "Running Gen AI models and applications on NVIDIA Jetson devices with one-line command"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion reComputer/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.1"
__version__ = "0.1.2"
14 changes: 14 additions & 0 deletions reComputer/scripts/yolov10/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM dustynv/l4t-pytorch:r35.3.1
WORKDIR /opt

RUN pip3 install --no-cache-dir --verbose gradio==4.31.5

RUN git clone https://github.com/THU-MIG/yolov10.git && \
cd yolov10 && \
sed -i '/opencv-python>=4.6.0/ s/^/# /' pyproject.toml && \
sed -i '/torch>=1.8.0/ s/^/# /' pyproject.toml && \
sed -i '/torchvision>=0.9.0/ s/^/# /' pyproject.toml && \
pip3 install -e . && \
mkdir weights

CMD cd /opt/yolov10 && ls weights && python3 app.py
63 changes: 63 additions & 0 deletions reComputer/scripts/yolov10/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# AudioCraft Deployment on Jetson in One Line

## Hello

💡 Here's an example of quickly deploying YOLOv10 on a Jetson device.

🔥 Hightlights:
- **Yolov10** is a state-of-the-art real-time object detection model. 🚀🔍
- **Jetson-examples** is a toolkit designed to deploy containerized applications on NVIDIA Jetson devices. ✨
- **Jetson** is powerful AI hardware platform for edge computing.💻

🛠️ Follow the tutorial below to quickly experience the performance of YOLOv10 on edge computing devices.

<div align="center">
<img alt="yolov10" width="1200px" src="./assets/webui.png">
</div>

## Getting Started

- install **jetson-examples** by pip:
```sh
pip3 install jetson-examples
```
- restart reComputer
```sh
sudo restart
```
- run audiocraft on jetson in one line:
```sh
reComputer run yolov10
```
- Please visit http:https://127.0.0.1:7860

## Change Model

This example will automatically download the YOLOv10s model at startup. If you want to try different models, please use the following command to download the model and then select the appropriate model through the WebUI.


> **Note:** You can also download the model via a browser and copy the model to `/home/$USER/reComputer/yolov10/weights`.
| Model | Download Command |
|:-----:|:----:|
| [YOLOv10-N](https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10n.pt) | `sudo wget -P /home/$USER/reComputer/yolov10/weights https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10n.pt` |
| [YOLOv10-S](https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10s.pt) | `sudo wget -P /home/$USER/reComputer/yolov10/weights https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10s.pt` |
| [YOLOv10-M](https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10m.pt) | `sudo wget -P /home/$USER/reComputer/yolov10/weights https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10m.pt` |
| [YOLOv10-B](https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10b.pt) | `sudo wget -P /home/$USER/reComputer/yolov10/weights https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10b.pt` |
| [YOLOv10-L](https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10l.pt) | `sudo wget -P /home/$USER/reComputer/yolov10/weights https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10l.pt` |
| [YOLOv10-X](https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10x.pt) | `sudo wget -P /home/$USER/reComputer/yolov10/weights https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10x.pt` |


## Build Docker Image
Our provided container is built based on the `jetson-container`. This example provide a Dockerfile, allowing you to build a more suitable container according to your needs.

```sh
sudo docker build -t yolov10-jetson .
```

> **Note:** Additionally, you can train models, test models, and export models within the Docker container environment. For detailed information, please refer to here.
## Reference
- https://github.com/THU-MIG/yolov10
- https://github.com/dusty-nv/jetson-containers

Binary file added reComputer/scripts/yolov10/assets/webui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions reComputer/scripts/yolov10/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

sudo docker rmi youjiang9977/yolov10-jetson:5.1.1
sudo rm -rf /home/$USER/reComputer/yolov10
52 changes: 52 additions & 0 deletions reComputer/scripts/yolov10/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash


# check L4T_VERSION
# reference https://github.com/dusty-nv/jetson-containers/blob/master/jetson_containers/l4t_version.sh
ALLOWED_L4T_VERSIONS=("35.3.1")

ARCH=$(uname -i)
if [ $ARCH = "aarch64" ]; then
L4T_VERSION_STRING=$(head -n 1 /etc/nv_tegra_release)

if [ -z "$L4T_VERSION_STRING" ]; then
L4T_VERSION_STRING=$(dpkg-query --showformat='${Version}' --show nvidia-l4t-core)
L4T_VERSION_ARRAY=(${L4T_VERSION_STRING//./ })
L4T_RELEASE=${L4T_VERSION_ARRAY[0]}
L4T_REVISION=${L4T_VERSION_ARRAY[1]}
else
L4T_RELEASE=$(echo $L4T_VERSION_STRING | cut -f 2 -d ' ' | grep -Po '(?<=R)[^;]+')
L4T_REVISION=$(echo $L4T_VERSION_STRING | cut -f 2 -d ',' | grep -Po '(?<=REVISION: )[^;]+')
fi

L4T_REVISION_MAJOR=${L4T_REVISION:0:1}
L4T_REVISION_MINOR=${L4T_REVISION:2:1}

L4T_VERSION="$L4T_RELEASE.$L4T_REVISION"
echo $L4T_VERSION
elif [ $ARCH != "x86_64" ]; then
echo "unsupported architecture: $ARCH"
exit 1
fi

echo "L4T_VERSION: $L4T_VERSION"
if [[ ! " ${ALLOWED_L4T_VERSIONS[@]} " =~ " ${L4T_VERSION} " ]]; then
echo "L4T_VERSION is not in the allowed versions list. Exiting."
exit 1
fi

# make dirs
BASE_PATH=/home/$USER/reComputer
sudo mkdir -p $BASE_PATH/yolov10/weights
sudo mkdir -p $BASE_PATH/yolov10/run
echo "create workspace at $BASE_PATH/yolov10"

# download models
echo "download yolov10 models"
WEIGHTS_FILE=$BASE_PATH/yolov10/weights/yolov10s.pt
if [ ! -f $WEIGHTS_FILE ]; then
sudo wget -P $BASE_PATH/yolov10/weights https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10s.pt
else
echo "Weights file already exists: $WEIGHTS_FILE"
fi

7 changes: 7 additions & 0 deletions reComputer/scripts/yolov10/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

sudo docker run -it --rm --net=host --runtime nvidia \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /home/$USER/reComputer/yolov10/weights:/opt/yolov10/weights \
-v /home/$USER/reComputer/yolov10/runs:/opt/yolov10/runs \
youjiang9977/yolov10-jetson:5.1.1

0 comments on commit 927e097

Please sign in to comment.