Utilities. This functions are not required for competitors but was developed to prepare the dataset for the competition.

Utils

The following functions are copied from the PyTorch reference model (https://github.com/pytorch/vision.git).

class SmoothedValue[source]

SmoothedValue(window_size=20, fmt=None)

Track a series of values and provide access to smoothed values over a window or the global series average.

all_gather[source]

all_gather(data)

Run all_gather on arbitrary picklable data (not necessarily tensors) Args: data: any picklable object Returns: list[data]: list of data gathered from each rank

reduce_dict[source]

reduce_dict(input_dict, average=True)

Args: input_dict (dict): all the values will be reduced average (bool): whether to do average or sum Reduce the values in the dictionary from all processes so that all processes have the averaged results. Returns a dict with the same fields as input_dict, after reduction.

class MetricLogger[source]

MetricLogger(delimiter='\t')

collate_fn[source]

collate_fn(batch)

warmup_lr_scheduler[source]

warmup_lr_scheduler(optimizer, warmup_iters, warmup_factor)

mkdir[source]

mkdir(path)

setup_for_distributed[source]

setup_for_distributed(is_master)

This function disables printing when not in master process

is_dist_avail_and_initialized[source]

is_dist_avail_and_initialized()

get_world_size[source]

get_world_size()

get_rank[source]

get_rank()

is_main_process[source]

is_main_process()

save_on_master[source]

save_on_master(*args, **kwargs)

init_distributed_mode[source]

init_distributed_mode(args)