当前位置:网站首页>Fashion-Gen: The Generative Fashion Dataset and Challenge 论文解读&数据集介绍

Fashion-Gen: The Generative Fashion Dataset and Challenge 论文解读&数据集介绍

2022-07-06 09:16:00 曹家小圆宝

论文解读

论文地址:https://arxiv.org/abs/1806.08317

数据集划分

数目trainvaltest
293, 008260, 48032, 52832, 528

类别介绍

数据集中有48个主类,121个子类。
如下是训练集、测试集中类别占比
在这里插入图片描述

图片统计

如下是训练集中主类、子类的图片数目统计
在这里插入图片描述

文本描述

如下是文本描述长度的统计
在这里插入图片描述
如下是从文本中提取的颜色分布
在这里插入图片描述

chanllenge

  • Generating high-resolution images using P-GANs
  • Text-to-Image synthesis

评估方法

  • Inception Score
  • Human Evaluation(因为Inception Score没考虑文本图片之间的相关性)

数据集下载

看到FashionBERT论文里的数据集FashionGEN,想了解一下,但是官网上填了个表单就没信了,地址为:https://fashion-gen.com/于是又在网上找了相关内容,找到一个网址https://github.com/menardai/FashionGenAttnGAN

上面有3个文件(注:没有提供测试集,论文中说不会提供测试集,被集成在了论文的docker中)

  • fashiongen_256_256_train.h5
  • fashiongen_256_256_validation.h5
  • fashiongen_consume_data_example.pdf

分析代码

参考https://docs.h5py.org/en/stable/quick.html用以下代码进行分析

import h5py
import numpy as np
BATCH_SIZE = 32

def get_batch(file_h5, features, batch_number, batch_size=32):
    """Get a batch of the dataset Args: file_h5(str): path of the dataset features(list(str)): list of names of features present in the dataset that should be returned. batch_number(int): the id of the batch to be returned. batch_size(int): the mini-batch size Returns: A list of numpy arrays of the requested features"""
    list_of_arrays = []
    lb, ub = batch_number * batch_size, (batch_number + 1) * batch_size
    for feature in features:
        list_of_arrays.append(file_h5[feature][lb: ub])
    return list_of_arrays

# open the file
# file_h5 = h5py.File('fashiongen_256_256_train.h5', mode='r')
file_h5 = h5py.File('fashiongen_256_256_validation.h5', mode='r')
# define the features to be retrieved
list_of_features = ['input_image', 'input_description']
dataset_len = len(file_h5['input_image'])  
nb_batches = int(dataset_len / BATCH_SIZE)
batch_nb = np.random.randint(0, nb_batches)
# get the first batch of the data
list_of_arrays = get_batch(file_h5, list_of_features, batch_nb, BATCH_SIZE)
# close the file
file_h5.close()

得到训练集数目260490、验证集数目32528
数据集是个类似dict的结构,keys分别为
[‘index’, ‘index_2’, ‘input_brand’, ‘input_category’, ‘input_composition’, ‘input_concat_description’, ‘input_department’, ‘input_description’, ‘input_gender’, ‘input_image’, ‘input_msrpUSD’, ‘input_name’, ‘input_pose’, ‘input_productID’, ‘input_season’, ‘input_subcategory’]

图片的维度为:

(256, 256, 3)

内容分析

以验证集为例,接下来一个一个分析内容

  1. index
file_h5['index'].shape
# (32528, 1)
file_h5['index'][0:][0:]
# 输出以下
[[    24]
 [    25]
 [    26]
 ...
 [342153]
 [342154]
 [342155]]
  1. index_2
file_h5['index_2'].shape
# (32528,)
file_h5['index_2'][0:]
# 输出以下
[    0     1     2 ... 32525 32526 32527]
  1. input_brand
file_h5['input_brand'].shape
# (32528, 1)
file_h5['input_brand'][0:][0:]
# 输出以下
array([[b'Diesel'],
       [b'Diesel'],
       [b'Diesel'],
       ...,
       [b'Calvin Klein 205W39NYC'],
       [b'Calvin Klein 205W39NYC'],
       [b'Calvin Klein 205W39NYC']], dtype='|S100')
  1. input_category
file_h5['input_category'].shape
# (32528, 1)
file_h5['input_category'][0:][0:]
# 输出以下
array([[b'JACKETS & COATS'],
       [b'JACKETS & COATS'],
       [b'JACKETS & COATS'],
       ...,
       [b'SHIRTS'],
       [b'SHIRTS'],
       [b'SHIRTS']], dtype='|S100')
  1. input_composition
file_h5['input_composition'].shape
# (32528, 1)
file_h5['input_composition'][0:][0:]
# 输出以下
array([[b'90% cotton, 8% polyester, 2% elastane.'],
       [b'90% cotton, 8% polyester, 2% elastane.'],
       [b'90% cotton, 8% polyester, 2% elastane.'],
       ...,
       [b'100% cotton.'],
       [b'100% cotton.'],
       [b'100% cotton.']], dtype='|S200')
  1. input_concat_description
file_h5['input_concat_description'].shape
# (32528, 1)
file_h5['input_concat_description'][0:][0:]
# 输出以下
array([[b'Denim-like jogg jacket in blue. Fading and whiskering throughout. Spread collar. Copper tone button closures at front. Flap pockets at chest with metallic logo plaque. Seam pockets at sides. Cinch tabs at back waistband. Single button sleeve cuffs. Tone on tone stitching. Semi-sheer t-shirt in heather white. Crewneck collar. Patch pocket at breast. Tonal stitching.'],
       [b'Denim-like jogg jacket in blue. Fading and whiskering throughout. Spread collar. Copper tone button closures at front. Flap pockets at chest with metallic logo plaque. Seam pockets at sides. Cinch tabs at back waistband. Single button sleeve cuffs. Tone on tone stitching. Semi-sheer t-shirt in heather white. Crewneck collar. Patch pocket at breast. Tonal stitching.'],
       [b'Denim-like jogg jacket in blue. Fading and whiskering throughout. Spread collar. Copper tone button closures at front. Flap pockets at chest with metallic logo plaque. Seam pockets at sides. Cinch tabs at back waistband. Single button sleeve cuffs. Tone on tone stitching. Semi-sheer t-shirt in heather white. Crewneck collar. Patch pocket at breast. Tonal stitching.'],
       ...,
       [b"Long sleeve cotton poplin shirt in 'optic' white. Spread collar featuring carved silver-tone hardware. Button closure at front. Single-button barrel cuffs. Tonal stitching. Slim-fit 'uniform' twill trousers in black. Mid-rise. Four-pocket styling. Central pleat at front and back legs. Grosgrain tape striped in blue and purple at outseams. Zip-fly. Partially lined. Tonal stitching. Long sleeve coated cotton-blend trench coat in beige. Notched lapel collar. Concealed button closure at front. Detachable pin-buckle belt and welt pockets at waist. Buttoned tab at central back vent and cuffs. Epaulets. Storm flap. Unlined. Tonal stitching."],
       [b"Long sleeve cotton poplin shirt in 'optic' white. Spread collar featuring carved silver-tone hardware. Button closure at front. Single-button barrel cuffs. Tonal stitching. Slim-fit 'uniform' twill trousers in black. Mid-rise. Four-pocket styling. Central pleat at front and back legs. Grosgrain tape striped in blue and purple at outseams. Zip-fly. Partially lined. Tonal stitching. Long sleeve coated cotton-blend trench coat in beige. Notched lapel collar. Concealed button closure at front. Detachable pin-buckle belt and welt pockets at waist. Buttoned tab at central back vent and cuffs. Epaulets. Storm flap. Unlined. Tonal stitching."],
       [b"Long sleeve cotton poplin shirt in 'optic' white. Spread collar featuring carved silver-tone hardware. Button closure at front. Single-button barrel cuffs. Tonal stitching. Slim-fit 'uniform' twill trousers in black. Mid-rise. Four-pocket styling. Central pleat at front and back legs. Grosgrain tape striped in blue and purple at outseams. Zip-fly. Partially lined. Tonal stitching. Long sleeve coated cotton-blend trench coat in beige. Notched lapel collar. Concealed button closure at front. Detachable pin-buckle belt and welt pockets at waist. Buttoned tab at central back vent and cuffs. Epaulets. Storm flap. Unlined. Tonal stitching."]],
      dtype='|S800')
  1. input_department
file_h5['input_department'].shape
# (32528, 1)
file_h5['input_department'][0:][0:]
# 输出以下
array([[b'CLOTHING'],
       [b'CLOTHING'],
       [b'CLOTHING'],
       ...,
       [b'CLOTHING'],
       [b'CLOTHING'],
       [b'CLOTHING']], dtype='|S100')
  1. input_description
file_h5['input_description'].shape
# (32528, 1)
file_h5['input_description'][0:][0:]
# 输出以下
array([[b'Denim-like jogg jacket in blue. Fading and whiskering throughout. Spread collar. Copper tone button closures at front. Flap pockets at chest with metallic logo plaque. Seam pockets at sides. Cinch tabs at back waistband. Single button sleeve cuffs. Tone on tone stitching.'],
       [b'Denim-like jogg jacket in blue. Fading and whiskering throughout. Spread collar. Copper tone button closures at front. Flap pockets at chest with metallic logo plaque. Seam pockets at sides. Cinch tabs at back waistband. Single button sleeve cuffs. Tone on tone stitching.'],
       [b'Denim-like jogg jacket in blue. Fading and whiskering throughout. Spread collar. Copper tone button closures at front. Flap pockets at chest with metallic logo plaque. Seam pockets at sides. Cinch tabs at back waistband. Single button sleeve cuffs. Tone on tone stitching.'],
       ...,
       [b"Long sleeve cotton poplin shirt in 'optic' white. Spread collar featuring carved silver-tone hardware. Button closure at front. Single-button barrel cuffs. Tonal stitching."],
       [b"Long sleeve cotton poplin shirt in 'optic' white. Spread collar featuring carved silver-tone hardware. Button closure at front. Single-button barrel cuffs. Tonal stitching."],
       [b"Long sleeve cotton poplin shirt in 'optic' white. Spread collar featuring carved silver-tone hardware. Button closure at front. Single-button barrel cuffs. Tonal stitching."]],
      dtype='|S400')
  1. input_gender
file_h5['input_gender'].shape
# (32528, 1)
file_h5['input_gender'][0:][0:]
# 输出以下
array([[b'Men'],
       [b'Men'],
       [b'Men'],
       ...,
       [b'Men'],
       [b'Men'],
       [b'Men']], dtype='|S30')
  1. input_image
file_h5['input_image'].shape
# (32528, 256, 256, 3)
file_h5['input_image'][0].shape
# (256, 256, 3)
  1. input_msrpUSD
file_h5['input_msrpUSD'].shape
(32528, 1)
file_h5['input_msrpUSD'][0:][0:]
# 输出以下
array([[335.],
       [335.],
       [335.],
       ...,
       [990.],
       [990.],
       [990.]], dtype=float32)
  1. input_name
file_h5['input_name'].shape
# (32528, 1)
file_h5['input_name'][0:][0:]
# 输出以下
array([[b'Blue Faded Elshar Jogg Jacket'],
       [b'Blue Faded Elshar Jogg Jacket'],
       [b'Blue Faded Elshar Jogg Jacket'],
       ...,
       [b'White Pointed Collar Shirt'],
       [b'White Pointed Collar Shirt'],
       [b'White Pointed Collar Shirt']], dtype='|S100')
  1. ‘input_pose
file_h5['input_pose'].shape
# (32528, 1)
file_h5['input_pose'][0:][0:]
# 输出以下
array([[b'id_gridfs_1'],
       [b'id_gridfs_2'],
       [b'id_gridfs_3'],
       ...,
       [b'id_gridfs_3'],
       [b'id_gridfs_4'],
       [b'id_gridfs_5']], dtype='|S40')
  1. input_productID
file_h5['input_productID'].shape
# (32528, 1)
file_h5['input_productID'][0:][0:]
# 输出以下
array([[  86605],
       [  86605],
       [  86605],
       ...,
       [2938688],
       [2938688],
       [2938688]], dtype=int32)
  1. input_season
file_h5['input_season'].shape
(32528, 1)
file_h5['input_season'][0:][0:]
# 输出以下
array([[b'SS2014'],
       [b'SS2014'],
       [b'SS2014'],
       ...,
       [b'SS2018'],
       [b'SS2018'],
       [b'SS2018']], dtype='|S10')
  1. input_subcategory
file_h5['input_subcategory'].shape
# (32528, 1)
file_h5['input_subcategory'][0:][0:]
# 输出以下
array([[b'DENIM JACKETS'],
       [b'DENIM JACKETS'],
       [b'DENIM JACKETS'],
       ...,
       [b'SHIRTS'],
       [b'SHIRTS'],
       [b'SHIRTS']], dtype='|S100')

可视化数据

keys123
index24,25,26,2773,74,75,7693,94,95,96
index_20, 1, 2, 34, 5, 6, 78, 9, 10, 11
input_brandb’Diesel’b’Dsquared2’b’Diesel Black Gold’
input_categoryb’JACKETS & COATS’b’JEANS’b’JACKETS & COATS’
input_compositionb’90% cotton, 8% polyester, 2% elastane.’b’98% cotton, 2% elastane.’b’Body: 100% lambskin. Contrast: 100% goatskin. Lining: 51% cotton, 49% rayon. Sleeve lining: 54% acetate, 46% polyester.’
input_concat_descriptionb’Denim-like jogg jacket in blue. Fading and whiskering throughout. Spread collar. Copper tone button closures at front. Flap pockets at chest with metallic logo plaque. Seam pockets at sides. Cinch tabs at back waistband. Single button sleeve cuffs. Tone on tone stitching. Semi-sheer t-shirt in heather white. Crewneck collar. Patch pocket at breast. Tonal stitching.’b’Slim-fit jeans in light grey. Distressing and fading throughout. Seven-pocket styling. Textured black leather logo patch at back waist. Tonal stitching. Red logo tab at button-fly. Short sleeve t-shirt in deep slate blue. Crewneck collar. Tonal stitching.’b’Long sleeve suede jacket in black. Tonal grained leather paneling throughout. Stand collar. Zip closure and zippered welt pockets at front. Zippered vents at back hem. Welt pockets at interior. Fully lined. Tonal stitching. Zippered expansion panels at sleeve cuffs. Long sleeve coated denim shirt in indigo blue. Irregular overdye effect throughout in black. Spread collar. Flap pockets at breast, one with metallic logo piece. Press-stud closure at front. Tonal stitching. Three press-studs at barrel cuffs. Slim-fit cropped pleated wool trousers in black. Four-pocket styling. Tonal stitching. Button-fly.’
input_departmentb’CLOTHING’b’CLOTHING’b’CLOTHING’
input_descriptionb’Denim-like jogg jacket in blue. Fading and whiskering throughout. Spread collar. Copper tone button closures at front. Flap pockets at chest with metallic logo plaque. Seam pockets at sides. Cinch tabs at back waistband. Single button sleeve cuffs. Tone on tone stitching.’b’Slim-fit jeans in light grey. Distressing and fading throughout. Seven-pocket styling. Textured black leather logo patch at back waist. Tonal stitching. Red logo tab at button-fly.’b’Long sleeve suede jacket in black. Tonal grained leather paneling throughout. Stand collar. Zip closure and zippered welt pockets at front. Zippered vents at back hem. Welt pockets at interior. Fully lined. Tonal stitching. Zippered expansion panels at sleeve cuffs.’
input_genderb’Men’b’Men’b’Men’
input_image1在这里插入图片描述在这里插入图片描述在这里插入图片描述
input_image2在这里插入图片描述在这里插入图片描述在这里插入图片描述
input_image3在这里插入图片描述在这里插入图片描述在这里插入图片描述
input_image4在这里插入图片描述在这里插入图片描述在这里插入图片描述
input_msrpUSD335.630.1215.
input_poseb’id_gridfs_1’,b’id_gridfs_2’,b’id_gridfs_3’,b’id_gridfs_4’b’id_gridfs_1’,b’id_gridfs_2’,b’id_gridfs_3’,b’id_gridfs_4’b’id_gridfs_1’,b’id_gridfs_2’,b’id_gridfs_3’,b’id_gridfs_4’
input_productID866058677386711
input_seasonb’SS2014’b’SS2014’b’SS2014’
input_subcategoryb’DENIM JACKETS’b’JEANS’b’LEATHER JACKETS’

后续数据集内容待更新…如有问题敬请指教哦~

原网站

版权声明
本文为[曹家小圆宝]所创,转载请带上原文链接,感谢
https://blog.csdn.net/fighting_Kitty/article/details/120005988