yolo人脸检测数据集_自定义数据集上的Yolo-V5对象检测

yolo人脸检测数据集

计算机视觉 (Computer Vision)

Step by step instructions to train Yolo-v5 & do Inference(from ultralytics) to count the blood cells and localize them.

循序渐进的说明来训练Yolo-v5和进行推理(来自Ultralytics )以对血细胞进行计数并将其定位。

I vividly remember that I tried to do an object detection model to count the RBC, WBC, and platelets on microscopic blood-smeared images using Yolo v3-v4, but I couldn’t get as much as accuracy I wanted and the model never made it to the production.

我生动地记得我曾尝试过使用Yolo v3-v4尝试建立对象检测模型以对显微血涂图像上的RBC,WBC和血小板进行计数,但是我无法获得想要的精度,而且该模型从未成功它的生产。

Now recently I came across the release of the Yolo-v5 model from Ultralytics, which is built using PyTorch. I was a bit skeptical to start, owing to my previous failures, but after reading the manual in their Github repo, I was very confident this time and I wanted to give it a shot.

最近,我遇到了Ultralytics发行的Yolo-v5模型,该模型是使用PyTorch构建的。 由于之前的失败,我对起步有些怀疑,但是在阅读他们的Github存储库中的手册后,这次我非常有信心,我想尝试一下。

And it worked like a charm, Yolo-v5 is easy to train and easy to do inference.

Yolo-v5就像是一种魅力,易于训练且易于推理。

So this post summarizes my hands-on experience on the Yolo-v5 model on the Blood Cell Count dataset. Let’s get started.

因此,本篇文章总结了我在血细胞计数数据集的Yolo-v5模型上的动手经验。 让我们开始吧。

Ultralytics recently launched Yolo-v5. For time being, the first three versions of Yolo were created by Joseph Redmon. But the newer version has higher mean Average Precision and faster inference times than others. Along with that it’s built on top of PyTorch made the training & inference process very fast and the results are great.

Ultralytics最近发布了Yolo-v5。 目前,Yolo的前三个版本是由Joseph Redmon创建的。 但是较新版本具有更高的平均平均精度和更快的推理时间。 此外,它还建立在PyTorch的基础上,使训练和推理过程变得非常快,并且效果很好。

Image for post
Source: Ultralytics
资料来源:Ultralytics

So let’s break down the steps in our training process.

因此,让我们分解一下培训过程中的步骤。

  1. Data — Preprocessing (Yolo-v5 Compatible)

    数据-预处理(与Yolo-v5兼容)

  2. Model — Training

    模型—培训

  3. Inference

    推理

And if you wish to follow along simultaneously, open up these notebooks,

如果您希望同时进行操作,请打开这些笔记本,

Google Colab Notebook — Training and Validation: link

Google Colab Notebook —培训和验证: 链接

Google Colab Notebook — Inference: link

Google Colab Notebook —推论: 链接

1.数据-预处理(与Yolo-v5兼容) (1. Data — Preprocessing (Yolo-v5 Compatible))

I used the dataset BCCD dataset available in Github, the dataset has blood smeared microscopic images and it’s corresponding bounding box annotations are available in an XML file.

我使用了Github中可用的BCCD数据集,该数据集具有涂血的显微图像,并且在XML文件中提供了相应的边界框注释。

Dataset Structure:- BCCD
- Annotations
- BloodImage_00000.xml
- BloodImage_00001.xml
...- JpegImages
- BloodImage_00001.jpg
- BloodImage_00001.jpg
...

Sample Image and its annotation :

样本图片及其注释:

Image for post
Sample Input Image
样本输入图像
Image for post
Labels in the .XML file
.XML文件中的标签

Upon mapping the annotation values as bounding boxes in the image will results like this,

在将注释值映射为图像中的边框时,将得到如下结果:

Image for post

But to train the Yolo-v5 model, we need to organize our dataset structure and it requires images (.jpg/.png, etc.,) and it’s corresponding labels in .txt format.

但是要训练Yolo-v5模型,我们需要组织我们的数据集结构,它需要图像(.jpg / .png等)及其对应的.txt格式标签。

Yolo-v5 Dataset Structure:- BCCD
- Images
- Train (.jpg files)
- Valid (.jpg files)- Labels
- Train (.txt files)
- Valid (.txt files)

And then the format of .txt files should be :

.txt文件的格式应为:

STRUCTURE OF .txt FILE :

.txt文件的结构:

- One row per object.

-每个对象一行。

- Each row is class x_center y_center width height format.

-每行都是x_center y_center width高度高度格式。

- Box coordinates must be in normalized xywh format (from 0–1). If your boxes are in pixels, divide x_center and width by image width, and y_center and height by image height.

-框坐标必须为标准化的xywh格式(从0到1)。 如果您的框以像素为单位,则将x_center和width除以图像宽度,将y_center和height除以图像高度。

- Class numbers are zero-indexed (start from 0).

-类号为零索引(从0开始)。

An Example label with class 1 (RBC) and class 2 (WBC) along with each of their x_center, y_center, width, height (All normalized 0–1) looks like the below one.

带有第1类(RBC)和第2类(WBC)以及它们的x_center,y_center,宽度,高度(全部归一化为0-1)的示例标签如下所示。

# class x_center y_c
  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
YOLOv5是一种流行的目标检测算法,可用于人脸识别。为了训练YOLOv5进行人脸识别,我们需要一个数据集,并对其进行标注。 人脸识别数据集标注是指在训练数据集中的每个图像上,用边界框(Bounding Box)标记出人脸的位置。此过程需要手动绘制矩形来框出每个人脸的边界,确保框选到完整的人脸区域。 为了获得高质量的标注数据集,需要考虑以下几点: 1. 准备真实的人脸图像数据集,包括样本丰富且具有多样性,例如不同摄像条件、不同人种和角度。 2. 使用专业的标注工具,如LabelImg、VIA等,手动绘制边界框。为了减少标注错误,可以使用自动标注算法来辅助标注过程。 3. 标注每个人脸的位置和大小,以最小的边界框来准确地框选出每个人脸。确保边界框尽可能地贴合人脸,同时不包含多余的部分。 4. 标注时需要注意人脸外围可能存在的背景、头部戴帽、遮挡等因素,确保标注的边界框仅包含人脸区域。 5. 使用统一的标注规则和标签,以便后续训练算法的输入格式一致。 6. 由于YOLOv5是一种实时目标检测算法,可以考虑引入动态标注,即在视频序列中标注每一帧中的人脸位置。 总结而言,YOLOv5人脸识别数据集标注需要手动绘制每个图像中人脸的边界框,保证框选到完整的人脸区域,并注意遮挡、背景以及统一的标注规则。这样标注完成后,我们就可以用这个标注好的数据集来训练YOLOv5模型,实现准确的人脸识别

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值