shlogg · Early preview
Super Kai (Kazuya Ito) @superkai_kazuya

CenterCrop In PyTorch: A Comprehensive Guide

CenterCrop() crops zero or more images, centering on them. Use size=(100, 100) for a square crop or size=600 for a rectangular crop.

Buy Me a Coffee☕
*Memos:

My post explains OxfordIIITPet().

CenterCrop() can crop zero or more images, centering on them as shown below:
*Memos:

The 1st argument for initialization is size(Required-Type:int, float or tuple/list(int or float) or size()):
*Memos:

It's [height, width].
It must be 0 <= x.
A tuple/list must be the 1D with 1 or 2 elements.
A single value(int, float or tuple/list(int or float) means [size, size].


The 1st argument is img(Required-Type:PIL Image or tensor(int, float, complex or bool)):
*Memos:

A tensor must be the 2D or more D of zero or more elements.
Don't use...