Comments (14)
Hi, @lovejing0306, I'm sorry to infer you that the beard model has been unavailable since the training machine has been broken. But you can get it by simply modify the preprocessor and config file. It wouldn't take long for even only one GPU.
If you have any questions for you training, please contract me again.
from hisd.
Hi, @lovejing0306, I'm sorry to infer you that the beard model has been unavailable since the training machine has been broken. But you can get it by simply modify the preprocessor and config file. It wouldn't take long for even only one GPU. If you have any questions for you training, please contract me again.
Thanks for your reply, I will try it .
from hisd.
Hi, @lovejing0306, I'm sorry to infer you that the beard model has been unavailable since the training machine has been broken. But you can get it by simply modify the preprocessor and config file. It wouldn't take long for even only one GPU. If you have any questions for you training, please contract me again.
Hi, I am sorry to bother you. I want to remove beard in face. So I modify the preprocessor and config file as below:
preprocessor:
parser = argparse.ArgumentParser()
parser.add_argument('--img_path', type=str, default=None)
parser.add_argument('--label_path', type=str)
parser.add_argument("--target_path", type=str)
parser.add_argument("--start", type=int, default=3002)
parser.add_argument("--end", type=int, default=30002)
opts = parser.parse_args()
target_path = opts.target_path
os.makedirs(target_path, exist_ok=True)
Tags_Attributes = {
# 'Bangs': ['with', 'without'],
# 'Eyeglasses': ['with', 'without'],
# 'HairColor': ['black', 'blond', 'brown'],
'Beard': ['with', 'without'],
}
for tag in Tags_Attributes.keys():
for attribute in Tags_Attributes[tag]:
open(os.path.join(target_path, f'{tag}_{attribute}.txt'), 'w')
# celeba-hq
celeba_imgs = opts.img_path
celeba_label = opts.label_path
with open(celeba_label) as f:
lines = f.readlines()
for line in tqdm.tqdm(lines[opts.start:opts.end]):
line = line.split()
# filename = os.path.join(os.path.abspath(celeba_imgs), line[0])
filename = line[0]
# Use only gender and age as tag-irrelevant conditions. Add other labels if you want.
if int(line[25]) == 1:
with open(os.path.join(target_path, 'Beard_without.txt'), mode='a') as f:
f.write(f'{filename} {line[21]} {line[40]}\n')
elif int(line[25]) == -1:
with open(os.path.join(target_path, 'Beard_with.txt'), mode='a') as f:
f.write(f'{filename} {line[21]} {line[40]}\n')
the config file :
# logger options
image_save_iter: 1000 # How often do you want to save output images during training
snapshot_save_iter: 10000 # How often do you want to save trained models
log_iter: 10 # How often do you want to log the training stats
# optimization options
total_iterations: 600000
batch_size: 8
num_workers: 1
weight_decay: 0
beta1: 0
beta2: 0.99
init: kaiming
lr_dis: 0.0001
lr_gen_mappers: 0.000001
lr_gen_others: 0.0001
#
adv_w: 1
sty_w: 1
rec_w: 1
style_dim: 256
noise_dim: 32
discriminators:
# No normalization (Attribute-specific)
channels: [32, 64, 128, 256, 512, 512, 512]
extractors:
# No normalization (Tag-specific)
channels: [32, 64, 128, 256, 512, 512, 512]
encoder:
# Instance Normalization (Shared)
channels: [64, 128, 256]
translators:
# Adaptive Instance Normalization (Tag-specific)
channels: [64, 64, 64, 64, 64, 64, 64, 64]
decoder:
# Instance Normalization (Shared)
channels: [256, 128, 64]
mappers:
# No normalization (Attribute-specific)
# Last num of pre_channels should be equal to the first num of post_channels
pre_channels: [256, 256, 256]
post_channels: [256, 256, 256]
img_dir: /datasets/face_parsing/CelebAMask-HQ/CelebA-HQ-img-512
tags:
-
name: Beard
tag_irrelevant_conditions_dim: 2
attributes:
-
name: 'with'
filename: /datasets/face_parsing/CelebAMask-HQ/Beard_with.txt
-
name: 'without'
filename: /datasets/face_parsing/CelebAMask-HQ/Beard_without.txt
# data options
input_dim: 3 # number of image channels
new_size: 256 # first resize the shortest image side to this size
crop_image_height: 256 # random crop image of this height
crop_image_width: 256 # random crop image of this width
Can you tell me, the preprocessor and config file is right ?
from hisd.
I think they are right and you can have a try to train with them~
from hisd.
I think they are right and you can have a try to train with them~
Hi, bother you again. I use the preprocessor and config file in my training code, but I meet two questions.
Question 1, the training visual quality is not really well, only few images implement the transfer from beard to no beard.
Question 2, the training visual quality get worse from 100000 steps.
I save the visual image in baidu cloud. Can you give me some advice ?
链接: https://pan.baidu.com/s/1HGcRhnIkWpdyMJ4NHJ5XCQ 提取码: fhh7
I am looking forward to your reply.
from hisd.
I think there are some points you can try:
- turn off the ALI part in discriminator by setting s[:] = 0 after
Line 38 in 8b07324
- since the images with beard are always male, modify the preprocess file to:
if int(line[25]) == 1 and int(line[25]) == 1:
with open(os.path.join(target_path, 'Beard_without.txt'), mode='a') as f:
f.write(f'{filename} {line[40]}\n')
elif int(line[25]) == -1 and int(line[25]) == 1:
with open(os.path.join(target_path, 'Beard_with.txt'), mode='a') as f:
f.write(f'{filename} {line[40]}\n')
from hisd.
Thanks for your advice @imlixinyang , I want to confirm these points with you.
About 1, I update the code as below, is right ?
def forward(self, x, s, y, i):
s[:] = 0
f = self.conv(x)
fsy = torch.cat([f, tile_like(s, f), tile_like(y, f)], 1)
return self.fcs[i](fsy).view(f.size(0), 2, -1)
About 2, remove the female samples from the dataset ?
from hisd.
Yes. Please have a try and tell me the results.
from hisd.
Yes. Please have a try and tell me the results.
OK, thanks. I prepared two sets of experiments. The first is remove female samples, second is remove female samples + update code s[:] = 0
.
from hisd.
Hi, I am coming @imlixinyang .
I spent two weeks for "remove female samples" and "remove female samples + update code s[:] = 0".
The first set of experiments is "remove female samples" , the intermediate results in this link 链接: https://pan.baidu.com/s/1D8N8qqwrXB6qOueaBIwL0A 提取码: tab0
I found that there is a color deviation by view the training visual quality in the first set of experiments.
The second set of experiment is "remove female samples + update code s[:] = 0", the intermediate results in this link 链接: https://pan.baidu.com/s/1Ui6gABqD4GVFODxJrgv8wg 提取码: n87a
By setting s[:] = 0, the color deviation problem disappeared. But there are new questions, I summarize the problems as follow:
- some results show the identity information of person is changed
- some results show the image information is not well reconstructed
- the transfer results is not good enough
Can you give me some advice about improve generation quality ?
from hisd.
Thank you for your sharing results. In the rebuttal of HiSD, we also conduct experiments for beard and the results for latent-guided tasks are:
By removing female samples and updating code s[:] = 0, I think most of our settings are the same but you get unsatisfying results, especially for reference-guided task. In my training, HiSD is always trained with multiple tag and I suspect that the joint training of other tags may help the disentanglement and quality. Removing female examples severely decreases the number of images, which may be a major problem of beard model. Maybe you could use two more tags to see if it would help (not sure).
Any further experiments and questions are welcomed here and I would try my best to help you. @lovejing0306
from hisd.
Thanks for your reply.
I am very interested in your work, so I want to have a deeply discussion with you. Would you mind adding my wechat (my ID: lovejing0306) ?
Looking forward for reply. @imlixinyang
from hisd.
hello, after modified s[:] = 0, I met a problem,
Have you ever met this before? Looking forward to your replay!
from hisd.
hello, after modified s[:] = 0, I met a problem, Have you ever met this before? Looking forward to your replay!
If you want to set s[:] = 0, you should write the code 's = torch.zeros_like(s)'
from hisd.
Related Issues (20)
- Virtual memory usage is too large HOT 4
- About Mutil-Gpus for training? HOT 7
- How many tags can this project train at the same time? HOT 3
- Another size of image HOT 5
- Data imbalance HOT 1
- 作者您好,想请问一下关于discriminator的问题 HOT 6
- 请求RaFD数据集 HOT 4
- A few questions about training tricks HOT 6
- 请教一下您的生成器和鉴别器模型是基于哪篇文章的 HOT 1
- 您好,请教一下论文中实验部分的一些问题,望指点 HOT 5
- 如何处理检查点文件? HOT 2
- 如何设置custom datasets? HOT 6
- 可以用m1芯片运行吗? HOT 3
- 更换数据集 HOT 2
- 关于生成图片模糊的问题 HOT 2
- Multi-tag task HOT 5
- 使用AFHQ数据集训练模型 HOT 13
- 求一个RaFD或者emotionnet数据集,想在celebA上做一下联合训练,有老哥有吗?我RaFD一直没申请到,emotionnet在网上下载的好像也是有问题的。
- 请教关于生成结果图像质量下降等问题 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hisd.