Dataset之CASIA-WebFace:CASIA-WebFace 数据集的简介、安装、使用方法之详细攻略

Dataset之CASIA-WebFace:CASIA-WebFace 数据集的简介、安装、使用方法之详细攻略

 

 

 

目录

CASIA-WebFace 数据集的简介

1、英文原文介绍

CASIA-WebFace 数据集的安装

CASIA-WebFace 数据集的使用方法

1、基础用法


 

 

 

 

 

 

CASIA-WebFace 数据集的简介

        CASIA-WebFace数据集包含了10575 个人的494414 张图像。CASIA-webface数据库,压缩包有4个多g,里面包含了10000个人,一共50万张人脸图片,无论是做SVM,DNN还是别的训练,都是非常好的数据库。

1、英文原文介绍

     Pushing by big data and deep convolutional neural network (CNN), the performance of face recognition is becoming comparable to human. Using private large scale training datasets, several groups achieve very high performance on LFW, i.e., 97% to 99%. While there are many open source implementations of CNN, none of large scale face dataset is publicly available. The current situation in the field of face recognition is that data is more important than algorithm. To solve this problem, we propose a semi-automatical way to collect face images from Internet and build a large scale dataset containing 10,575 subjects and 494,414 images, called CASIA-WebFace. To the best of our knowledge, the size of this dataset rank second in the literature, only smaller than the private dataset of Facebook (SCF). We encourage those data-consuming methods training on this dataset and reporting performance on LFW.
        在大数据和深度卷积神经网络(美国有线电视新闻网)的推动下,人脸识别的性能已与人类相比。使用私有的大规模训练数据集,若干组在LFW上实现非常高的性能,即97%到99%。虽然有许多开源的美国有线电视新闻网的实现,没有大规模的面部数据集是公开可用的。人脸识别领域的研究现状是数据比算法更重要。为了解决这个问题,我们提出了一种半自动的方式来收集来自互联网的人脸图像,并建立一个大型数据集包含10575个主题和494414个图像,称为CASIA WebFACTS。据我们所知,该数据集的大小在文献中排名第二,仅比脸谱网(SCF)的私有数据集小。我们鼓励在这个数据集上的数据消耗方法训练和LFW上的报告性能。

 

 

 

CASIA-WebFace 数据集的安装

因为数据集太大,4个多G,无法直接给各位网友,获取方法:
T1、官网下载
T2、留言向博主索取!

 

 

 

 

CASIA-WebFace 数据集的使用方法

更新……

 

1、基础用法

  • 通过人脸识别方法提取人脸特征;
  • 使用每个名人的mainphoto作为它的种子(因为mainphoto一般都是正脸,而且不会出现其他人);
  • 使用那些只有1个人脸的图片去增加每个名人的种子的数量;
  • 在photo gallery剩下的图片中,通过与种子的相似度来找到属于每个名人的其余照片。
  • 裁剪人脸,将同一个名人的脸单独存入一个路径内,之后再进行人工纠错,进一步提高数据集纯度。

 

 

2、Tensorflow以CASIA-Webface为例子读取tfrecords数据数据

import mxnet as mx
import argparse
import PIL.Image
import io
import numpy as np
import cv2
import tensorflow as tf
import os


def parse_function(example_proto):
    features = {'image_raw': tf.FixedLenFeature([], tf.string),
                'label': tf.FixedLenFeature([], tf.int64)}
    features = tf.parse_single_example(example_proto, features)
    # You can do more image distortion here for training data
    img = tf.image.decode_jpeg(features['image_raw'])
    img = tf.reshape(img, shape=(112, 112, 3))
    r, g, b = tf.split(img, num_or_size_splits=3, axis=-1)
    img = tf.concat([b, g, r], axis=-1)
    img = tf.cast(img, dtype=tf.float32)
    #归一化
    img = tf.subtract(img, 127.5)
    img = tf.multiply(img,  0.0078125)
    #一些图像增强操作
    img = tf.image.random_flip_left_right(img)
    label = tf.cast(features['label'], tf.int64)
    return img, label



if __name__ == '__main__':
    args = parse_args()
    config = tf.ConfigProto(allow_soft_placement=True)
    sess = tf.Session(config=config)
    # training datasets api config
    tfrecords_f = os.path.join(args.tfrecords_file_path, 'tran.tfrecords')
    dataset = tf.data.TFRecordDataset(tfrecords_f)
    dataset = dataset.map(parse_function)
    #队列缓冲区长度30000,并且打乱顺序
    dataset = dataset.shuffle(buffer_size=30000)
    #这样每次迭代就是32张图片
    dataset = dataset.batch(32)
    iterator = dataset.make_initializable_iterator()
    next_element = iterator.get_next()
    # begin iteration
    for i in range(1000):
        sess.run(iterator.initializer)
        while True:
            try:
                images, labels = sess.run(next_element)
                plt.imshow(images[0])
                fig = plt.gcf()
                plt.show()
                fig.savefig('test.jpg')
            except tf.errors.OutOfRangeError:
                print("End of dataset")






 

 

 

 

 

 

 

 

参考文章:https://zhuanlan.zhihu.com/p/64518637

  • 9
    点赞
  • 45
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 92
    评论
评论 92
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

一个处女座的程序猿

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

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

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

打赏作者

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

抵扣说明:

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

余额充值