face-attribute-prediction icon indicating copy to clipboard operation
face-attribute-prediction copied to clipboard

where can I get "celeA train test val.txt"?

Open xugangtongji opened this issue 5 years ago • 3 comments

did you make it by yourself? what the format of it?

xugangtongji avatar Jul 01 '19 07:07 xugangtongji

the same question:where is the val_40_att_list.txt and test_40_att_list.txt

yisampi avatar Jul 05 '19 06:07 yisampi

I've solved it. The list_eval_partition.txt and list_attr_celeba.txt file can be download from celebA official site.

import os

train_list = []
val_list = []
test_list = []
with open("Anno/list_eval_partition.txt") as f:
    for line in f.readlines():
        row = line.strip().split(" ")
        img_name = row[0]
        label = row[-1]
        if label == "0":
            train_list.append(img_name)
        if label == "1":
            val_list.append(img_name)
        if label == "2":
            test_list.append(img_name)

with open("Anno/list_attr_celeba.txt", encoding="utf-8") as f:
    for line in f.readlines():
        row = line.strip().split(" ")
        row = [i.replace("-1", "0") for i in row if i != ""]
        if len(row) == 41:
            img_name = row[0]
            if img_name in train_list:
                with open("train_attr_list.txt", "a", encoding="utf-8") as ff:
                    ff.writelines(" ".join(row) + "\n")
            if img_name in val_list:
                with open("val_attr_list.txt", "a", encoding="utf-8") as ff:
                    ff.writelines(" ".join(row) + "\n")
            if img_name in test_list:
                with open("test_attr_list.txt", "a", encoding="utf-8") as ff:
                    ff.writelines(" ".join(row) + "\n")

yumaofan avatar May 19 '20 03:05 yumaofan

I've solved it. The list_eval_partition.txt and list_attr_celeba.txt file can be download from celebA official site.

import os

train_list = []
val_list = []
test_list = []
with open("Anno/list_eval_partition.txt") as f:
    for line in f.readlines():
        row = line.strip().split(" ")
        img_name = row[0]
        label = row[-1]
        if label == "0":
            train_list.append(img_name)
        if label == "1":
            val_list.append(img_name)
        if label == "2":
            test_list.append(img_name)

with open("Anno/list_attr_celeba.txt", encoding="utf-8") as f:
    for line in f.readlines():
        row = line.strip().split(" ")
        row = [i.replace("-1", "0") for i in row if i != ""]
        if len(row) == 41:
            img_name = row[0]
            if img_name in train_list:
                with open("train_attr_list.txt", "a", encoding="utf-8") as ff:
                    ff.writelines(" ".join(row) + "\n")
            if img_name in val_list:
                with open("val_attr_list.txt", "a", encoding="utf-8") as ff:
                    ff.writelines(" ".join(row) + "\n")
            if img_name in test_list:
                with open("test_attr_list.txt", "a", encoding="utf-8") as ff:
                    ff.writelines(" ".join(row) + "\n")

Can you repeat the model? My model seems like not converge fast? Are the training parameters same as default? Is the training data same as original img_align_celeba? image

Haoyayu avatar Feb 22 '23 12:02 Haoyayu