Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Typing error #96

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion face_parsing/Data_preprocessing/g_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#list2
label_list = ['skin', 'nose', 'eye_g', 'l_eye', 'r_eye', 'l_brow', 'r_brow', 'l_ear', 'r_ear', 'mouth', 'u_lip', 'l_lip', 'hair', 'hat', 'ear_r', 'neck_l', 'neck', 'cloth']

folder_base = 'CelebAMaskHQ-mask-anno'
folder_base = 'CelebAMask-HQ-mask-anno'
folder_save = 'CelebAMaskHQ-mask'
img_num = 30000

Expand Down
5 changes: 3 additions & 2 deletions face_parsing/Data_preprocessing/g_partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from utils import make_folder

#### source data path
s_label = 'CelebAMask-HQ-label'
s_label = 'CelebAMaskHQ-mask'
s_img = 'CelebA-HQ-img'
#### destination training data path
d_train_label = 'train_label'
Expand Down Expand Up @@ -35,8 +35,9 @@
f_val = open('val_list.txt', 'w')
f_test = open('test_list.txt', 'w')

for idx, x in enumerate(image_list.loc[:, 1]):
for idx, x in enumerate(image_list.loc[1:, 1]):
print (idx, x)
x = int(x)
if x >= 162771 and x < 182638:
copyfile(os.path.join(s_label, str(idx)+'.png'), os.path.join(d_val_label, str(val_count)+'.png'))
copyfile(os.path.join(s_img, str(idx)+'.jpg'), os.path.join(d_val_img, str(val_count)+'.jpg'))
Expand Down
4 changes: 2 additions & 2 deletions face_parsing/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ def train(self):
# Sample images
if (step + 1) % self.sample_step == 0:
labels_sample = self.G(imgs)
labels_sample = generate_label(labels_sample)
labels_sample = torch.from_numpy(labels_sample)
labels_sample = generate_label(labels_sample, self.imsize)
#labels_sample = torch.from_numpy(labels_sample)
save_image(denorm(labels_sample.data),
os.path.join(self.sample_path, '{}_predict.png'.format(step + 1)))

Expand Down