In my case, I have a mask image for each sample image, so when I do tencrop on each image, I would like to do the same operation on the mask image.
I am curious about that if the tencrop operation is random or not?
For example, if I do tencrop for the same image twice, are cropped images the same?
Based on the docs, it should be deterministic:
Crop the given PIL Image into four corners and the central crop plus the flipped version of these (horizontal flipping is used by default)
Thanks for your reply. I have also read that piece, but I am not sure since it does not point out that clearly.
Maybe I should write a sample code to test it. Thanks again.
We can have a look at the source code to be sure it’s not random.
As you can see, internally TenCrop
is calling FiveCrop
, which uses the provided size
to get the crops in this line of code.
Great! This is what I need. Thanks a lot.