Apply the same approach here, resize each image to (480, 480), | |
flip it horizontally, and brighten it: | |
import albumentations | |
import numpy as np | |
import torch | |
transform = albumentations.Compose( | |
[ | |
albumentations.Resize(480, 480), | |
albumentations.HorizontalFlip(p=1.0), | |
albumentations.RandomBrightnessContrast(p=1.0), | |
], | |
bbox_params=albumentations.BboxParams(format="coco", label_fields=["category"]), | |
) | |
The image_processor expects the annotations to be in the following format: {'image_id': int, 'annotations': List[Dict]}, | |
where each dictionary is a COCO object annotation. |