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

data_transforms #25

Closed
MarcanBat2a opened this issue Mar 15, 2021 · 8 comments
Closed

data_transforms #25

MarcanBat2a opened this issue Mar 15, 2021 · 8 comments

Comments

@MarcanBat2a
Copy link

Hi !
Is it possible to use a data transform dictionary?
Like this :

data_transforms = {   
    'train': transforms.Compose([
        transforms.Resize([224,224]),
        transforms.RandomHorizontalFlip(),
        transforms.ToTensor(),
        transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
    ]),
    'val': transforms.Compose([
        transforms.Resize([224,224]),
        transforms.ToTensor(),
        transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
    ]),
    'test': transforms.Compose([
        transforms.Resize([224,224]),
        transforms.ToTensor(),
        transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
    ]),
}

And do you have an example for the dataset_metadata ?

@raghavmecheri
Copy link
Contributor

Hey @MarcanBat2a, thanks for reaching out!
I've opened an issue based on your point about a dictionary for the transform, we'll try and get to it by the weekend (do let us know if you'd be willing to help out with it!)

As for the dataset_metadata, I apologize: this package is still a little lacking in documentation. However, you should find a couple of examples of the same here:

  1. Simple Metadata
  2. Regex Metadata
  3. Collate Metadata

@MarcanBat2a
Copy link
Author

Thank you @raghavmecheri for your reply !
I don't have time at the moment but I would be delighted to be able to participate in my free time

@MarcanBat2a
Copy link
Author

I have an another question :
is it possible to have the number of each class for each phase (train, val and test) ?

@raghavmecheri
Copy link
Contributor

Thank you @raghavmecheri for your reply !
I don't have time at the moment but I would be delighted to be able to participate in my free time

Sure, of course! We have a couple of issues open at the moment, and I plan to add a few more when I'm free. @JamesBollas is going to be working on #26 though, so we're good on that front :)

@raghavmecheri
Copy link
Contributor

I have an another question :
is it possible to have the number of each class for each phase (train, val and test) ?

I'm not sure what you mean? The dataset_metadata field takes a split key -- is that what you're looking for? More on the same can be found here

@MarcanBat2a
Copy link
Author

@raghavmecheri No, but I managed otherwise.
For information, for each training I create a json file which corresponds to all the input parameters.
So I wanted to know the number of images in my dataloader ["train"] for each class, same thing for dataloader ["val"].

@raghavmecheri
Copy link
Contributor

@raghavmecheri No, but I managed otherwise.
For information, for each training I create a json file which corresponds to all the input parameters.
So I wanted to know the number of images in my dataloader ["train"] for each class, same thing for dataloader ["val"].

Got it! You should just be able to check the sizes that you receive from the BetterLoader just like how this example does it :)

@raghavmecheri
Copy link
Contributor

@MarcanBat2a We've just released v0.2.2, which closes this issue. PyPi should also install this version by default now.

Thanks for bringing this issue to our attention, do let us know if you have any other ideas to improve BetterLoader! :)

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

2 participants