WIDERFACE 数据集

目录

widerface 数据格式转换

数据集地址

Generate VOC format training data set and training process

关于数据集标签

python可视化train.txt


widerface 数据格式转换

widerface转voc_AI视觉网奇的博客-CSDN博客

数据集地址

先说一下数据下载地址,

来源1官网:WIDER FACE: A Face Detection Benchmark

比较权威的开源项目:

来源2  GitHub - biubug6/Pytorch_Retinaface: Retinaface get 80.99% in widerface hard val using mobilenet0.25.

这个项目里面数据集google和百度都撤了,dropbox的还在:

https://www.dropbox.com/s/7j70r3eeepe4r2g/retinaface_gt_v1.1.zip?dl=0

来源3:

GitHub - Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB: 💎1MB lightweight face detection model (1MB轻量级人脸检测模型)

Generate VOC format training data set and training process

  1. Download the wideface official website dataset or download the training set I provided and extract it into the ./data folder:

(1) The clean widerface data pack after filtering out the 10px*10px small face: Baidu cloud disk (extraction code: cbiu) 、Google Drive

(2) Complete widerface data compression package without filtering small faces: Baidu cloud disk (extraction code: ievk)Google Drive

关于数据集标签

验证工具需要的坐标是:x0,y0, w,h

这里有测试集下载:

WIDER FACE: A Face Detection Benchmark

验证工具,分3个等级,有mat

http://mmlab.ie.cuhk.edu.hk/projects/WIDERFace/support/eval_script/eval_tools.zip

这个是验证集:

需要:0_Parade_marchingband_1_465.jpg

python可视化train.txt

import cv2


def read_img():
    file_names=[]
    txt_path = r"WIDER_train\train_label.txt"
    f = open(txt_path, 'r')
    lines = f.readlines()
    isFirst = True
    labels = []
    words = []
    for line in lines:
        line = line.rstrip()
        if line.startswith('#'):
            if isFirst is True:
                isFirst = False
            else:
                labels_copy = labels.copy()
                words.append(labels_copy)
                labels.clear()

            path = line[2:]
            path = txt_path.replace('train_label.txt', 'images/') + path
            file_names.append(path)
        else:
            line = line.split(' ')
            label = [float(x) for x in line]
            labels.append(label)
    words.append(labels)
    return file_names,words

if __name__ == '__main__':
    file_names, words=read_img()
    small_face = 100
    max_face = 100
    for index, file in enumerate(file_names):
        img_raw=cv2.imread(file)
        labels=words[index]
        face_num=0
        has_small=False
        for label in labels:
            x1=int(label[0])
            y1=int(label[1])
            x2=int(label[0] + label[2])
            y2=int(label[1]+label[3])

            if label[4]<0:
                cv2.rectangle(img_raw, (x1, y1), (x2, y2), (0, 0, 255), 2)
            else:
                if max_face<label[2]*label[3]:
                    max_face=label[2]*label[3]
                    print(index, "max_face", label[2],label[3], file)
                if label[2]*label[3]<small_face:
                    small_face= label[2]*label[3]
                    has_small=True
                face_num+=1
                cv2.rectangle(img_raw, (x1, y1), (x2, y2), (0, 255, 0), 2)

        if has_small:
            print(index,'small', small_face,img_raw.shape[0]*img_raw.shape[1],img_raw.shape[:2], file)
        if face_num>12:
            print(index,'many',face_num,file)

    print(index, "maxx_face", max_face,"small_face",small_face)
        # cv2.imshow("sdf", img_raw)
        # cv2.waitKey()

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

AI算法网奇

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值