Skip to content

Commit

Permalink
📝 docs: 更新文档
Browse files Browse the repository at this point in the history
henryzhuhr committed Jun 1, 2024
1 parent 987d54b commit 7802b7a
Showing 5 changed files with 125 additions and 107 deletions.
13 changes: 7 additions & 6 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -3,8 +3,8 @@ import { defineConfig } from 'vitepress'
// https://vitepress.dev/reference/site-config
export default defineConfig({
base: '/deep-object-detect-track/',
title: "深度学习目标检测和跟踪",
description: "深度学习目标检测和跟踪项目文档",
title: "目标检测和跟踪",
description: "目标检测和跟踪项目文档",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
@@ -13,12 +13,13 @@ export default defineConfig({

sidebar: [
{
text: '目标检测和跟踪项目文档',
text: '「项目文档」',
items: [
{ text: '项目使用文档', link: '/usage' },
{ text: '目标检测YOLOv5项目', link: '/yolo' },
{ text: '安装环境', link: '/install' },
{ text: '模型训练', link: '/train' },
{ text: '数据集制作', link: '/dataset' },
{ text: '目标检测和目标跟踪', link: '/preliminary' }
{ text: '模型部署', link: '/deploy' },
// { text: '目标检测YOLOv5项目', link: '/yolo' },
]
}
],
98 changes: 1 addition & 97 deletions docs/usage.md → docs/deploy.md
Original file line number Diff line number Diff line change
@@ -5,103 +5,7 @@ footer: true
outline: deep
---

# 项目使用文档


以 yolov5 为基础,实现目标检测和跟踪算法的训练和部署,部署 TensorRT 和 OpenVINO 两种方案。

## 环境配置

### 获取代码

::: code-group
```shell [HTTP]
git clone --recursive https://github.com/HenryZhuHR/deep-object-detect-track.git
```
```shell [SSH]
git clone --recursive git@github.com:HenryZhuHR/deep-object-detect-track.git
```
:::

进入项目目录

```shell
cd deep-object-detect-track
```

> 后续的脚本基于 deep-object-detect-track 目录下执行
如果未能获取子模块,可以手动获取
```shell
# in deep-object-detect-track directory
git submodule init
git submodule update
```

### 创建虚拟环境

确保安装了 conda ,如果没有安装,请从 [Miniconda](https://docs.anaconda.com/free/miniconda/index.html) 下载,或者快速安装

```shell
# linux x64
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
```

创建虚拟环境
```shell
# 在项目内安装环境(推荐)
conda create -p .env/dodt python=3.10 -y
conda activate ./.env/dodt
# 全局安装环境
conda create -n dodt python=3.10 -y
conda activate dodt
```
> Python 版本选择 3.10 是因为 Ubuntu 22.04 默认安装的 Python 版本是 3.10
### 安装依赖

1. 安装 PyTorch

参考官网 [INSTALL PYTORCH](https://pytorch.org/get-started/locally/) 选择配置安装 PyTorch

```shell
pip install torch torchvision \
--index-url https://download.pytorch.org/whl/cu121
```
> 链接最后的 `cu121` 是需要根据系统的 CUDA 版本进行选择
接下来安装其他依赖

```shell
pip install -r projects/yolov5/requirements.txt
pip install -r requirements.txt
```

如果涉及部署流程,需要自行修改 `requirements.txt` 文件,将下列依赖取消注释掉,然后重新执行上述命令

```txt
# Export ----------------------------------------------------------------------
# coremltools>=6.0 # CoreML export
# onnx>=1.10.0 # ONNX export
# onnx-simplifier>=0.4.1 # ONNX simplifier
# nvidia-pyindex # TensorRT export
# nvidia-tensorrt # TensorRT export
# scikit-learn<=1.1.2 # CoreML quantization
# tensorflow>=2.4.0,<=2.13.1 # TF exports (-cpu, -aarch64, -macos)
# tensorflowjs>=3.9.0 # TF.js export
# openvino-dev>=2023.0 # OpenVINO export
```
- `onnx`: ONNX 格式的模型导出支持任意设备,需要取消注释,并且其他导出依赖于 ONNX 模型
- `coremltools`: 必须依赖于 MacOS 系统
- `nvidia-*`: 确保硬件支持 NVIDIA GPU

### 下载预训练模型

[YOLOv5 Releases](https://github.com/ultralytics/yolov5/releases) 页面下载预训练模型,放置在 `weights` 目录下


## 训练模型
# 模型部署

## 导出模型

11 changes: 7 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -3,11 +3,14 @@
layout: home

hero:
name: "Deep Object detection & Tracking"
name: "Object Detection & Tracking"
# text: "基于深度学习的目标检测和跟踪项目"
tagline: 目标检测模型 YOLOv5 和跟踪算法 ByteTrack 部署过程记录
tagline: 目标检测和跟踪算法的训练和部署过程日志
actions:
- theme: brand
text: 进入文档
link: /usage
text: 项目源码
link: https://github.com/HenryZhuHR/deep-object-detect-track
- theme: alt
text: 项目文档
link: /install
---
97 changes: 97 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
lastUpdated: true
editLink: true
footer: true
outline: deep
---

# 安装环境


以 yolov5 为基础,实现目标检测和跟踪算法的训练和部署,部署 TensorRT 和 OpenVINO 两种方案。

## 环境配置

### 获取代码

::: code-group
```shell [HTTP]
git clone --recursive https://github.com/HenryZhuHR/deep-object-detect-track.git
```
```shell [SSH]
git clone --recursive git@github.com:HenryZhuHR/deep-object-detect-track.git
```
:::

进入项目目录

```shell
cd deep-object-detect-track
```

> 后续的脚本基于 deep-object-detect-track 目录下执行
如果未能获取子模块,可以手动获取
```shell
# in deep-object-detect-track directory
git submodule init
git submodule update
```

### 创建虚拟环境

确保安装了 conda ,如果没有安装,请从 [Miniconda](https://docs.anaconda.com/free/miniconda/index.html) 下载,或者快速安装

```shell
# linux x64
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
```

创建虚拟环境
```shell
# 在项目内安装环境(推荐)
conda create -p .env/dodt python=3.10 -y
conda activate ./.env/dodt
# 全局安装环境
conda create -n dodt python=3.10 -y
conda activate dodt
```
> Python 版本选择 3.10 是因为 Ubuntu 22.04 默认安装的 Python 版本是 3.10
### 安装依赖

1. 安装 PyTorch

参考官网 [INSTALL PYTORCH](https://pytorch.org/get-started/locally/) 选择配置安装 PyTorch

```shell
pip install torch torchvision \
--index-url https://download.pytorch.org/whl/cu121
```
> 链接最后的 `cu121` 是需要根据系统的 CUDA 版本进行选择
接下来安装其他依赖

```shell
pip install -r projects/yolov5/requirements.txt
pip install -r requirements.txt
```

如果涉及部署流程,需要自行修改 `requirements.txt` 文件,将下列依赖取消注释掉,然后重新执行上述命令

```txt
# Export ----------------------------------------------------------------------
# coremltools>=6.0 # CoreML export
# onnx>=1.10.0 # ONNX export
# onnx-simplifier>=0.4.1 # ONNX simplifier
# nvidia-pyindex # TensorRT export
# nvidia-tensorrt # TensorRT export
# scikit-learn<=1.1.2 # CoreML quantization
# tensorflow>=2.4.0,<=2.13.1 # TF exports (-cpu, -aarch64, -macos)
# tensorflowjs>=3.9.0 # TF.js export
# openvino-dev>=2023.0 # OpenVINO export
```
- `onnx`: ONNX 格式的模型导出支持任意设备,需要取消注释,并且其他导出依赖于 ONNX 模型
- `coremltools`: 必须依赖于 MacOS 系统
- `nvidia-*`: 确保硬件支持 NVIDIA GPU
13 changes: 13 additions & 0 deletions docs/train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
lastUpdated: true
editLink: true
footer: true
outline: deep
---

# 模型训练


## 下载预训练模型

[YOLOv5 Releases](https://github.com/ultralytics/yolov5/releases) 页面下载预训练模型,放置在 `weights` 目录下

0 comments on commit 7802b7a

Please sign in to comment.