Spaces:
Running
on
Zero
Running
on
Zero
import detectron2.data.transforms as T | |
from detectron2 import model_zoo | |
from detectron2.config import LazyCall as L | |
from .coco_loader import dataloader | |
# Data using LSJ | |
image_size = 1024 | |
dataloader.train.mapper.augmentations = [ | |
L(T.RandomFlip)(horizontal=True), # flip first | |
L(T.ResizeScale)( | |
min_scale=0.1, max_scale=2.0, target_height=image_size, target_width=image_size | |
), | |
L(T.FixedSizeCrop)(crop_size=(image_size, image_size)), | |
] | |
dataloader.train.mapper.image_format = "RGB" | |
dataloader.train.total_batch_size = 64 | |
# recompute boxes due to cropping | |
dataloader.train.mapper.recompute_boxes = True | |