API 参考 detrium.data.transforms.mosaic detrium.data.transforms.mosaic DEIM: DETR with Improved Matching for Fast Convergence
Copyright (c) 2024 The DEIM Authors. All Rights Reserved.
class Mosaic(T.Transform)Applies Mosaic augmentation to a batch of images. Combines four randomly selected images
into a single composite image with randomized transformations.
名称 类型 默认值 output_size—320max_size—Nonerotation_range—0translation_range—(0.1, 0.1)scaling_range—(0.5, 1.5)probability—1.0fill_value—114use_cache—Truemax_cached_images—50random_pop—True
load_samples_from_dataset(self, image, target, dataset)Loads and resizes a set of images and their corresponding targets.
名称 类型 默认值 image——target——dataset——
load_samples_from_cache(self, image, target, cache)名称 类型 默认值 image——target——cache——
create_mosaic_from_cache(self, mosaic_samples, max_height, max_width)名称 类型 默认值 mosaic_samples——max_height——max_width——
create_mosaic_from_dataset(self, images, targets, max_height, max_width)Creates a mosaic image by combining multiple images.
名称 类型 默认值 images——targets——max_height——max_width——
forward(self, *inputs)Args:
inputs (tuple): Input tuple containing (image, target, dataset).
Returns:
tuple: Augmented (image, target, dataset).