Mosaic

class easypl.callbacks.mixers.mosaic.Mosaic(on_batch: bool = True, n_mosaics: Union[int, List[int]] = 4, num_workers: int = 1, p: float = 0.5, domen: str = 'classification')

Callback for mosaic data operations

on_batch

If True generate samples from batch otherwise from dataset.

Type

bool

p

Mix probability.

Type

float

num_workers

Number of workers for mixing operation.

Type

int

n_mosaics

Number of mosaics. If it’s list, then number of mosaic will be selected from this list.

Type

Union[int, List[int]]

domen

Name of task, in which will be mixed samples. Available: [“classification, segmentation”].

Type

str

mix(sample1: Dict, sample2: Dict) Dict

Mosaic mix method for two samples.

sample1

Sample of batch, which will be sampled with samples from sample2.

Type

Dict

sample2

Samples from batch or dataset.

Type

Dict

Returns

Mixed sample.

Return type

Dict