Skip to content

Custom dataset #635

Answered by rwightman
cyrilzakka asked this question in Q&A
Aug 24, 2023 · 8 comments · 1 reply
Discussion options

You must be logged in to vote

@cyrilzakka

  • resize longest means longest edge gets scaled to the target size, so the shortest edge will be < than the target size and padding needs to be used, this is wanted if you need to fit the full image into the model, but often scales it down too much for these small sizes like 224, esp if there are large aspect ratios
  • resize shortest (the default in pytorch Resize() if you just pass in a single int), resizes the shortest edge to target size, longest edge will be > target so you typically need to crop after for a square output (instead of pad)

I wrote a pair of transforms a little while back that lets you slide between fully shortest and fully longest with a float input, and then…

Replies: 8 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by cyrilzakka
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@rwightman
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #605 on September 15, 2023 23:04.