Configure your own yolov7 from 0 (Little White Tutorial)

1. Download Anaconda

Official website link: https://www.anaconda.com/

It is not recommended to download from the official website here, the speed is very slow, Tsinghua source is recommended! ! !

Tsinghua source: https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
insert image description here
After the installation is complete, click win to build, find the following Annaconda command line to open

insert image description here

Second, create our virtual environment

conda create -n your_env_name python=3.8

Your_env_name here refers to the name of your own environment

python=3.8 is your Python version

Then activate our virtual environment

conda activate your_env_name

As shown in the figure, after the leftmost (base) becomes your own environment name, it means that the entry is successful

insert image description here

Third, install pytorch and cuda

pip install torch==1.12.0+cu113 torchvision==0.13.0+cu113 --extra-index-url https://download.pytorch.org/whl/cu113 

After the installation is complete, we need to download yolov7 from github, just click on github and search for yolov7

Then we need to find the path of the requirements.txt file of the downloaded file, and enter this path in the command interface just now

insert image description here

Fourth, install all yolov7 configuration files

insert image description here
Remember to delete the first line to avoid conflicts with the above-mentioned installation of pytorch and cuda commands

pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

At this point we have installed the required configuration files

Five, install pycharm

Then we need to download pycharm: https://www.jetbrains.com/pycharm/

Select Community Community Edition
insert image description here

Six, add our environment to pycharm

Then click to open our project

Find the lower right corner and
insert image description hereinsert image description here
find the environment that exists in annaconda as shown in the figure, and click ok after completion
insert image description here

Seven, test whether the installation is successful

Then open the detect.py file in the project to test whether the installation is successful

Renderings:
insert image description here

If the content is helpful to you, please like it, thank you!

Guess you like

Origin blog.csdn.net/qq_53545309/article/details/132413525