Last active
April 4, 2024 21:45
-
-
Save ternaus/db2df39d4c5dba3806c8017fff15f705 to your computer and use it in GitHub Desktop.
Example of the application of RandomResizedCrop in Albumentations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import albumentations as A | |
import cv2 | |
bgr_image = cv2.imread("cat1.jpeg") | |
image = cv2.cvtColor(bgr_image, cv2.COLOR_BGR2RGB) | |
transform = A.Compose([A.RandomResizedCrop(size=(512, 512), | |
scale=(0.08, 1), | |
ratio=(0.75, 1.33), | |
interpolation=cv2.INTER_AREA, p=0.5)]) | |
transformed = transform(image=image) | |
transformed_image = transformed["image"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment