制作CelebA-HQ数据集(所有文件全在百度网盘,永久可用)

目录

1、下载img_celeba.7z

2、下载 list_landmarks_celeba.txt

3、下载celeba-hq-deltas文件夹

4、下载python文件

5、在命令行里面运行程序生成图像


整个文件夹的目录如下:

CelebA

        img_celeba.7z

        img_celeba

                img_celeba

                list_landmarks_celeba.txt

        celeba-hq-deltas

        CelebA-HQ

                celeba-64

                celeba-128

                celeba-256

                celeba-512

                celeba-1024

1、下载img_celeba.7z

链接: https://pan.baidu.com/s/1GfcwgzAr2HJYH68nLqDssg 提取码: 7ryr 。下载完后全部解压到一个文件夹中。

2、下载 list_landmarks_celeba.txt

链接: https://pan.baidu.com/s/13l-Z8exetF4p7gkoPqMYxQ 提取码: ckn5。下载好后把此txt文件放入img_celeba文件夹中。

3、下载celeba-hq-deltas文件夹

链接: https://pan.baidu.com/s/1Gb7nDHcOnuoWGukfO5fsKA 提取码: 4hcx 。下载完后不用管了,压缩包不要解压!!

4、下载python文件

 首先,在anaconda创建一个python是2.7的虚拟环境

conda create -n python2.7 python=2.7

下载依赖包

# 激活虚拟环境
conda activate python2.7

pip install numpy
pip install scipy
pip install pillow
pip install h5py
pip install cryptography

 下载生成图像的python文件

链接: https://pan.baidu.com/s/1y65nWRylR6OMOvNL2W3jtw 提取码: iavg 。

 对里面的一些代码进行修改:1、修改list_landmarks_celeba.txt文件的读取地址;2、修改生成的HQ图像的保存地址(celeba-64这些几个文件夹需要在运行代码前创建好,程序不会自动创建)。

# 把中间的Anno删掉
with open(os.path.join(celeba_dir, 'list_landmarks_celeba.txt'), 'rt') as file:

# 修改生成的celeba-hq图像的保存地址
# Save all generated images.
    root_path = '~/Project/Datasets/CelebA/CelebA-HQ'
    with ThreadPool(num_threads) as pool:
        for orig_fn, aimg64, aimg128, aimg256, aimg512, aimg1024 in pool.process_items_concurrently(fields['idx'], process_func=process_func, max_items_in_flight=num_tasks):
            aimg64.save(root_path+'/celeba-64/'+str(orig_fn))
            aimg128.save(root_path+'/celeba-128/'+str(orig_fn))
            aimg256.save(root_path+'/celeba-256/'+str(orig_fn))
            aimg512.save(root_path+'/celeba-512/'+str(orig_fn))
            aimg1024.save(root_path+'/celeba-1024/'+str(orig_fn))
            print(orig_fn)

5、在命令行里面运行程序生成图像

cd ~/celeba-hq-modified-master

python h5tool.py create_celeba_hq celeba-hq-1024x1024.h5 ~/CelebA/img_celeba ~/CelebA/celeba-hq-deltas

程序要运行很久,放着就行。 

 

 

  • 8
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值