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

Preprocess RaFD dataset #20

Open
Sampson-Lee opened this issue Jan 12, 2018 · 7 comments
Open

Preprocess RaFD dataset #20

Sampson-Lee opened this issue Jan 12, 2018 · 7 comments

Comments

@Sampson-Lee
Copy link

Sampson-Lee commented Jan 12, 2018

Hi, @yunjey
I am confused about the method of preprocessing RaFD, where the download images have initial size 618 x 1024. If I crop the images to 256 x 256, some images became partial absent, especially when the camera angle is 45 degree or 135 degree.

So I crop the initial images as follow code:

elif dataset == 'RaFD':
    box = (100, 150, 600, 700)
    if mode == 'train':
        transform = transforms.Compose([
            transforms.Lambda(lambda x: x.crop(box)),
            transforms.Resize(image_size),
            transforms.RandomHorizontalFlip(),
            transforms.ToTensor(),
            transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])
    else:
        transform = transforms.Compose([
            transforms.Lambda(lambda x: x.crop(box)),
            transforms.Resize(image_size),
            transforms.ToTensor(),
            transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])
    dataset = ImageFolder(image_path, transform)

And I get some samples like sample

But I am not sure whether the method is right, could you help me? Thanks in advance.

@Fairydetail
Copy link

Fairydetail commented Jul 3, 2018

Could you please share me with the RaFD datasets? Because I had apply it in the official website for several days, but I don't receive an apply yet.Thanks a lot! @Sampson-Lee

@Sampson-Lee
Copy link
Author

Hi, @Fairydetail
I am sorry to tell you that I can not share the RaFD because of the agreement. I think you can get an official permission after several days, as I had waited about 15 days. Good luck.

@Fairydetail
Copy link

Fairydetail commented Aug 31, 2018

I have the same problem with you. So would you mind to tell me the whether it works to crop like that. @Sampson-Lee

@Sampson-Lee
Copy link
Author

@Fairydetail I think the results are similar, although I crop in different methods

@AdarshMJ
Copy link

While training with RaFD dataset, should I also make an attribute.txt file like that of Celeb dataset? Or only train with images?

@iamzhangyunlu
Copy link

While training with RaFD dataset, should I also make an attribute.txt file like that of Celeb dataset? Or only train with images?

same problem with you, so how do you deal with the RaFD datasets?

@cy19980615
Copy link

Hi, @yunjey
I am confused about the method of preprocessing RaFD, where the download images have initial size 618 x 1024. If I crop the images to 256 x 256, some images became partial absent, especially when the camera angle is 45 degree or 135 degree.
So I crop the initial images as follow code:
elif dataset == 'RaFD':
box = (100, 150, 600, 700)
if mode == 'train':
transform = transforms.Compose([
transforms.Lambda(lambda x: x.crop(box)),
transforms.Resize(image_size),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])
else:
transform = transforms.Compose([
transforms.Lambda(lambda x: x.crop(box)),
transforms.Resize(image_size),
transforms.ToTensor(),
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])
dataset = ImageFolder(image_path, transform)

And I get some samples like
But I am not sure whether the method is right, could you help me? Thanks in advance.

hello could you share me with the RaFD dataset by mailbox:1647560307@qq.com i am Anxious to do graduation design for undergraduates,thanks very much!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants