- Reprint please note the original sources, thank: blog.csdn.net/pentiumcm/a…
Deep learning – Construction and use of yoloV5 algorithm environment (GPU/CPU)
First, environmental dependence
- anacoda
- Python > = 3.8
- CUDA, cudnn
- The torch > = 1.6
Ii. Construction process
1. The GPU environment
- Anaconda installation and use: refer to my another blog: blog.csdn.net/pentiumCM/a…
- CUDA installation:Developer.nvidia.com/cuda-10.2-d… Download and install directly.
- Create a Python environment:
Conda create -n yolov5 python=3.8Copy the code
- Install PyTorch in Python: for the version, see pytorch.org/
Conda install Pytorch TorchVision TorchAudio CudatoolKit =10.2 -c PytorchCopy the code
-
Download the source code for Yolov5:Github.com/ultralytics…
-
Install python dependencies:
pip install -r requirements.txt Copy the code
2. The CPU environment
When we don’t have an NVIDIA graphics card in our computer, we can use the CPU version of Pytorch to experiment with YoloV5. Specific adjustments are as follows:
-
No need to install CUDA, CUDNN
-
Pytorch install command:
Conda install Pytorch ==1.6.0 TorchVision == 0.7.0cpuOnly -c PytorchCopy the code
The other steps are the same as GPU.
Use of YoloV5
-
Using pre-trained models:
-
Run the detect.py file directly under the root of the project, and the generated detection results are in the Output folder
-
Direct use of the camera:
python detect.py --source 0 Copy the code
-