-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[Datasets] Add size
parameter to ImageFolderDatasource
#26975
[Datasets] Add size
parameter to ImageFolderDatasource
#26975
Conversation
partition_filter: PathPartitionFilter = None, | ||
**kwargs, | ||
root: str, | ||
size: Tuple[int, int], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to do any sanity check of the user-provided size
? What's the largest image size we want to support now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a check that the size contains positive numbers.
No idea what the large image size should be, if any.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the quick fix ! One confirmation: i remember you previously mentioned our implementation assumes folder structure is same as imagenet, is this behavior still the same ? Looks like we're making it single root path now.
Also, how would user add / apply labels to each image read with ImageFolderDatasource
API ?
Behavior is identical. Previously,
To improve UX, I've renamed
By label, do you mean integer targets used for training? This datasource already creates a "label" column. |
Looks like there's some test failure in AIR. Could you help fix these? Thanks.
|
Okay, should be fixed. |
fix lint? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating our examples ! nit: You should be able to remove transforms.Resize(256)
now given the resize is already done. Not a blocker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stamp on docs
…ct#26975) If you read a folder with differently-sized images, `ImageFolderDatasource` errors. This PR fixes the issue by resizing images to a user-specified size. Signed-off-by: Rohan138 <[email protected]>
…ct#26975) If you read a folder with differently-sized images, `ImageFolderDatasource` errors. This PR fixes the issue by resizing images to a user-specified size. Signed-off-by: Stefan van der Kleij <[email protected]>
Why are these changes needed?
If you read a folder with differently-sized images,
ImageFolderDatasource
errors. This PR fixes the issue by resizing images to a user-specified size.Related issue number
Checks
scripts/format.sh
to lint the changes in this PR.