Skip to content

a1046700338/yolo5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

CI CPU testing YOLOv5 Citation Docker Pulls
Open In Colab Open In Kaggle Join Forum

yolov5

YOLOv5🚀是一个在COCO数据集上预训练的物体检测架构和模型系列,它代表了Ultralytics对未来视觉AI方法的公开研究,其中包含了在数千小时的研究和开发中所获得的经验和最佳实践。

准备

使用yolo前需要配置的环境

  1. 安装Anconda
  2. Anconda 虚拟环境添加新路径 conda config --add envs_dirs 你的envs路径
  3. Anconda 清华源配置
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --set show_channel_urls yes

若安装paddle出错,可以修改镜像源

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
  1. 创建yolo虚拟空间
conda create -n 命名 python=选择合适的python版本

像这样

conda create -n yolo python=3.8
  1. 进入yolo虚拟空间
conda activate yolo
  1. git yolo仓库,我用的yolo版本是v5 选择合适的目录(不要有中文命名的目录)打开cmd
git clone [email protected]:ultralytics/yolov5.git

使用了加速源下载,放心下载不会慢 7. 进入下载好的yolo目录,下载依赖

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

如果需要使用wandb,还要下载一个 wandb

pip install wandb -i https://pypi.tuna.tsinghua.edu.cn/simple
  1. 数据标注 使用labelimg进行数据标注
    也可以直接下载数据集,这个数据集网站非常好用,链接
    进入yolo虚拟空间中,下载labelimg
pip install labelimg -i https://pypi.tuna.tsinghua.edu.cn/simple

使用

使用本项目

项目地址 | Gitee

git clone仓库到本地

git clone [email protected]:a1046700338/yolo5.git or git clone https://github.com/a1046700338/yolo5.git

使用PyCharm打开yolo项目

File -> Settings -> Project:yolo5 -> Python Interpreter -> add -> Conda Enviroment -> Existing Enviroment -> 选择你的虚拟环境路径 -> ok

添加你的数据集

将你的数据集文件复制到项目根目录下,并在 data 目录下创建一个yaml文件,自行命名,
yaml文件内容:

train: ../train/images #你的数据集路径
val: ../valid/images	#你的有效集路径

nc: 2	#你的classes数量
names: ['mask', 'no-mask'] #数组内是你的classes,标签

之后修改 train.py 第460行代码,即可

    parser.add_argument('--data', type=str, default='data/文件名.yaml', help='data.yaml path')

运行

所有环境配置好后,运行 train.py

About

基于yolov5的口罩检测训练模型

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages