face01lib.damo_yolo.damo_internal.utils package
Submodules
face01lib.damo_yolo.damo_internal.utils.boxes module
face01lib.damo_yolo.damo_internal.utils.checkpoint module
face01lib.damo_yolo.damo_internal.utils.debug_utils module
face01lib.damo_yolo.damo_internal.utils.demo_utils module
face01lib.damo_yolo.damo_internal.utils.dist module
This file contains primitives for multi-gpu communication. This is useful when doing distributed training.
- all_gather(data, group=None)[ソース]
Run all_gather on arbitrary picklable data (not necessarily tensors). :param data: any picklable object :param group: a torch process group. By default, will use a group which
contains all ranks on gloo backend.
- 戻り値:
list of data gathered from each rank
- 戻り値の型:
list[data]
- gather(data, dst=0, group=None)[ソース]
Run gather on arbitrary picklable data (not necessarily tensors). :param data: any picklable object :param dst: destination rank :type dst: int :param group: a torch process group. By default, will use a group which
contains all ranks on gloo backend.
- 戻り値:
- on dst, a list of data gathered from each rank. Otherwise,
an empty list.
- 戻り値の型:
list[data]
- get_local_rank() int [ソース]
- 戻り値:
The rank of the current process within the local (per-machine) process group.
- get_local_size() int [ソース]
- 戻り値:
The size of the per-machine process group, i.e. the number of processes per machine.
face01lib.damo_yolo.damo_internal.utils.imports module
face01lib.damo_yolo.damo_internal.utils.logger module
- class StreamToLoguru(level='INFO', caller_names=('apex', 'pycocotools'))[ソース]
ベースクラス:
object
stream object that redirects writes to a logger instance.
- setup_logger(save_dir, distributed_rank=0, mode='a')[ソース]
setup logger for training and testing. :param save_dir: location to save log file :type save_dir: str :param distributed_rank: device rank when multi-gpu environment :type distributed_rank: int :param mode: log file write mode, append or override. default is a. :type mode: str
- 戻り値:
logger instance.
face01lib.damo_yolo.damo_internal.utils.metric module
- class AverageMeter(window_size=50)[ソース]
ベースクラス:
object
Track a series of values and provide access to smoothed values over a window or the global series average.
- property avg
- property global_avg
- property latest
- property median
- property total
- class MeterBuffer(window_size=20)[ソース]
ベースクラス:
defaultdict
Computes and stores the average and current value
face01lib.damo_yolo.damo_internal.utils.model_utils module
- replace_module(module, replaced_module_type, new_module_type, replace_func=None)[ソース]
Replace given type in module to a new type. mostly used in deploy.
- パラメータ:
module (nn.Module) -- model to apply replace operation.
replaced_module_type (Type) -- module type to be replaced.
new_module_type (Type)
replace_func (function) -- python function to describe replace logic. Defalut value None.
- 戻り値:
module that already been replaced.
- 戻り値の型:
model (nn.Module)