目录
Generate VOC format training data set and training process
widerface 数据格式转换
widerface转voc_AI视觉网奇的博客-CSDN博客
数据集地址
先说一下数据下载地址,
来源1官网:WIDER FACE: A Face Detection Benchmark
比较权威的开源项目:
这个项目里面数据集google和百度都撤了,dropbox的还在:
https://www.dropbox.com/s/7j70r3eeepe4r2g/retinaface_gt_v1.1.zip?dl=0
来源3:
Generate VOC format training data set and training process
- 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()