Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/open-mmlab/mmengine
/ functions
Functions
2,962 in github.com/open-mmlab/mmengine
⨍
Functions
2,962
◇
Types & classes
482
↳
Endpoints
21
↓ 7 callers
Method
before_train
All subclasses should override this method, if they need any operations before train. Args: runner (Runner): The runner o
mmengine/hooks/hook.py:42
↓ 7 callers
Function
build_temporary_directory
Build a temporary directory containing many files to test ``FileClient.list_dir_or_file``. . \n | -- dir1 \n | -- | -- text3.txt \n
tests/test_fileio/test_backends/test_petrel_backend.py:18
↓ 7 callers
Method
build_val_loop
Build validation loop. Examples of ``loop``: # `ValLoop` will be used loop = dict() # custom validation
mmengine/runner/runner.py:1534
↓ 7 callers
Method
by_module_and_operator
Returns the statistics for all submodules, separated out by operator type for each submodule. The operator handle determines the name
mmengine/analysis/jit_analysis.py:291
↓ 7 callers
Function
color_val_matplotlib
Convert various input in RGB order to normalized RGB matplotlib color tuples, Args: colors (Union[str, tuple, List[Union[str, tuple]]]
mmengine/visualization/utils.py:94
↓ 7 callers
Method
copyfile
Copy a file src to dst and return the destination file. src and dst should have the same prefix. If dst specifies a directory, the fi
mmengine/fileio/backends/petrel_backend.py:318
↓ 7 callers
Function
func
()
tests/data/config/py_config/test_dump_pickle_support.py:6
↓ 7 callers
Function
get_installed_path
Get installed path of package. Args: package (str): Name of package. Example: >>> get_installed_path('mmcls') >>> '.
mmengine/utils/package_utils.py:36
↓ 7 callers
Function
get_mock_runner
()
tests/test_hooks/test_early_stopping_hook.py:77
↓ 7 callers
Function
get_model_complexity_info
Interface to get the complexity of a model. The parameter `inputs` are fed to the forward method of model. If `inputs` is not specified, the
mmengine/analysis/print_helper.py:677
↓ 7 callers
Function
is_method_overridden
Check if a method of base class is overridden in derived class. Args: method (str): the method name to check. base_class (type):
mmengine/utils/misc.py:403
↓ 7 callers
Method
isdir
Check whether a file path is a directory. Args: filepath (str or Path): Path to be checked whether it is a direct
mmengine/fileio/backends/local_backend.py:122
↓ 7 callers
Method
label_to_onehot
Convert the label-format input to one-hot. Args: label (torch.Tensor): The label-format input. The format of item
mmengine/structures/label_data.py:31
↓ 7 callers
Method
merge_from_dict
Merge list into cfg_dict. Merge the dict parsed by MultipleKVAction into this cfg. Args: options (dict): dict of configs
mmengine/config/config.py:1581
↓ 7 callers
Function
mkdir_or_exist
(dir_name, mode=0o777)
mmengine/utils/path.py:26
↓ 7 callers
Method
parse_losses
Parses the raw outputs (losses) of the network. Args: losses (dict): Raw output of the network, which usually contain
mmengine/model/base_model/base_model.py:147
↓ 7 callers
Method
seed
int: A number to set random modules.
mmengine/runner/runner.py:571
↓ 7 callers
Method
set_field
Special method for set union field, used as property.setter functions.
mmengine/structures/base_data_element.py:453
↓ 7 callers
Method
statistics
Access statistics method by name. Args: method_name (str): Name of method. Returns: Any: Depends on correspo
mmengine/logging/history_buffer.py:122
↓ 7 callers
Method
update
Update the log history. If the length of the buffer exceeds ``self._max_length``, the oldest element will be removed from the buffer.
mmengine/logging/history_buffer.py:60
↓ 7 callers
Method
update_params
Update parameters in :attr:`optimizer`. Args: loss (torch.Tensor): A tensor for back propagation. step_kwargs (dict):
mmengine/optim/optimizer/optimizer_wrapper.py:175
↓ 6 callers
Method
__exit__
(self, type, value, traceback)
mmengine/utils/timer.py:52
↓ 6 callers
Method
__init__
Initialize BaseModule, inherited from `torch.nn.Module`
mmengine/model/base_module.py:39
↓ 6 callers
Method
_before_epoch
All subclasses should override this method, if they need any operations before each epoch. Args: runner (Runner): The run
mmengine/hooks/hook.py:284
↓ 6 callers
Method
_collect_scalars
Collect log information to compose a dict according to mode. Args: custom_cfg (List[dict]): A copy of ``self.custom_cfg`` with in
mmengine/runner/log_processor.py:341
↓ 6 callers
Function
_get_bases_name
(m)
mmengine/model/weight_init.py:127
↓ 6 callers
Method
_get_epoch
Get current epoch according to mode. Args: runner (Runner): The runner of the training/testing/validation process
mmengine/runner/log_processor.py:527
↓ 6 callers
Method
_is_posion_valid
Judge whether the position is in image. Args: position (np.ndarray): The position to judge which last dim must be
mmengine/visualization/visualizer.py:369
↓ 6 callers
Method
_parse_windows_size
Parse window_size defined in custom_cfg to int value. Args: runner (Runner): The runner of the training/testing/validation
mmengine/runner/log_processor.py:459
↓ 6 callers
Method
_prepared_components
(self)
mmengine/_strategy/base.py:971
↓ 6 callers
Method
_search_child
Depth-first search for the corresponding registry in its children. Note that the method only search for the corresponding registry from
mmengine/registry/registry.py:522
↓ 6 callers
Method
_set_device
Recursively set device for `BaseDataPreprocessor` instance. Args: device (torch.device): the desired device of the parameters and
mmengine/model/base_model/base_model.py:283
↓ 6 callers
Method
_substitute_env_variables
Substitute environment variables in config with actual values. Sometimes, we want to change some items in the config with environment
mmengine/config/config.py:692
↓ 6 callers
Method
all_keys
Returns: list: Contains all keys in metainfo and data.
mmengine/structures/base_data_element.py:343
↓ 6 callers
Method
build_log_processor
Build test log_processor. Examples of ``log_processor``: # `LogProcessor` will be used log_processor = dict()
mmengine/runner/runner.py:1619
↓ 6 callers
Method
cat
(tmp_objs)
tests/test_structures/test_instance_data.py:35
↓ 6 callers
Method
copytree
(src, dst)
tests/test_fileio/test_backends/test_petrel_backend.py:444
↓ 6 callers
Function
delete_and_reset_method
(obj, method)
tests/test_fileio/test_fileclient.py:66
↓ 6 callers
Function
delete_and_reset_method
(obj, method)
tests/test_fileio/test_backends/test_petrel_backend.py:99
↓ 6 callers
Method
evaluate
Invoke ``evaluate`` method of each metric and collect the metrics dictionary. Args: size (int): Length of the entire vali
mmengine/evaluator/evaluator.py:62
↓ 6 callers
Method
fromstring
Build a Config instance from config text. Args: cfg_str (str): Config text. file_format (str): Config file format cor
mmengine/config/config.py:508
↓ 6 callers
Method
full_init
Loop to ``full_init`` each dataset.
mmengine/dataset/dataset_wrapper.py:107
↓ 6 callers
Function
generic_activation_jit
This method returns a handle that counts the number of activation from the output shape for the specified operation. Args: op_name (s
mmengine/analysis/jit_handles.py:57
↓ 6 callers
Function
get_config
Get config from external package. Args: cfg_path (str): External relative config path. pretrained (bool): Whether to save pretrai
mmengine/hub/hub.py:14
↓ 6 callers
Function
get_git_hash
Get the git hash of the current repo. Args: fallback (str, optional): The fallback string when git hash is unavailable. Defau
mmengine/utils/version_utils.py:67
↓ 6 callers
Method
get_image
Get the drawn image. The format is RGB. Returns: np.ndarray: the drawn image which channel is RGB.
mmengine/visualization/visualizer.py:309
↓ 6 callers
Function
is_installed
Check package whether installed. Args: package (str): Name of package to be checked.
mmengine/utils/package_utils.py:6
↓ 6 callers
Function
is_mlu_available
Returns True if Cambricon PyTorch and mlu devices exist.
mmengine/device/utils.py:71
↓ 6 callers
Function
is_str
Whether the input is an string instance. Note: This method is deprecated since python 2 is no longer supported.
mmengine/utils/misc.py:35
↓ 6 callers
Method
isfile
Check whether a file path is a file. Args: filepath (str or Path): Path to be checked whether it is a file. Returns:
mmengine/fileio/backends/local_backend.py:141
↓ 6 callers
Function
load_checkpoint
Load checkpoint from a file or URI. Args: model (Module): Module to load checkpoint. filename (str): Accept local filepath, URL,
mmengine/runner/checkpoint.py:611
↓ 6 callers
Method
load_checkpoint
Load checkpoint from given ``filename``. Args: filename (str): Accept local filepath, URL, ``torchvision://xxx``,
mmengine/runner/runner.py:2107
↓ 6 callers
Method
load_state_dict
(self, state_dict: dict)
mmengine/_strategy/deepspeed.py:104
↓ 6 callers
Method
metainfo_items
Returns: iterator: An iterator object whose element is (key, value) tuple pairs for ``metainfo``.
mmengine/structures/base_data_element.py:375
↓ 6 callers
Method
metainfo_keys
Returns: list: Contains all keys in metainfo_fields.
mmengine/structures/base_data_element.py:322
↓ 6 callers
Method
optim_context
Enables the context for mixed precision training, and enables the context for disabling gradient synchronization during gradient accum
mmengine/optim/optimizer/apex_optimizer_wrapper.py:166
↓ 6 callers
Function
patch_env
(local_rank, cuda_visible_devices)
tests/test_logging/test_logger.py:246
↓ 6 callers
Method
prepare
Prepare model and some components. Args: model (:obj:`torch.nn.Module` or dict): The model to be run. It can be a
mmengine/_strategy/base.py:137
↓ 6 callers
Function
pseudo_collate
Convert list of data sampled from dataset into a batch of data, of which type consistent with the type of each data_itement in ``data_batch``.
mmengine/dataset/utils.py:45
↓ 6 callers
Method
put
Write data to a given ``filepath`` with 'wb' mode. Note: ``put`` should create a directory if the directory of ``filepath``
mmengine/fileio/file_client.py:316
↓ 6 callers
Method
put
Write bytes to a given ``filepath``. Args: obj (bytes): Data to be saved. filepath (str or Path): Path to write data.
mmengine/fileio/backends/petrel_backend.py:129
↓ 6 callers
Method
scale_lr
Automatically scaling learning rate in training according to the ratio of ``base_batch_size`` in ``autoscalelr_cfg`` and real batch si
mmengine/runner/runner.py:928
↓ 6 callers
Function
scandir
Scan a directory to find the interested files. Args: dir_path (str | :obj:`Path`): Path of the directory. suffix (str | tuple(str
mmengine/utils/path.py:39
↓ 6 callers
Method
set_epoch
Sets the epoch for this sampler. When :attr:`shuffle=True`, this ensures all replicas use a different random ordering for each epoch.
mmengine/dataset/sampler.py:93
↓ 6 callers
Function
set_multi_processing
Set multi-processing related environment. Args: mp_start_method (str): Set the method which should be used to start child pro
mmengine/utils/dl_utils/setup_env.py:9
↓ 6 callers
Method
setup_dist_env
(self)
tests/test_hooks/test_sync_buffers_hook.py:70
↓ 6 callers
Method
show
Show the drawn image. Args: drawn_img (np.ndarray, optional): The image to show. If drawn_img is None, it will sh
mmengine/visualization/visualizer.py:231
↓ 5 callers
Method
__init__
(self)
tests/test_runner/test_checkpoint.py:33
↓ 5 callers
Method
__init__
( self, conv_dim: int, input_dim: int, output_dim: int, kernel_size: i
tests/test_analysis/test_flop_count.py:63
↓ 5 callers
Method
_analyze
(self)
mmengine/analysis/jit_analysis.py:559
↓ 5 callers
Method
_check_sgd_optimizer
(self, optimizer, model,
tests/test_optim/test_optimizer/test_optimizer.py:155
↓ 5 callers
Method
_get_checkpoint_loader
Finds a loader that supports the given path. Falls back to the local loader if no other loader is found. Args: path (str)
mmengine/runner/checkpoint.py:293
↓ 5 callers
Method
_get_cur_loop
Get current loop according to mode. Args: runner (Runner): The runner of the training/validation/testing process.
mmengine/runner/log_processor.py:553
↓ 5 callers
Method
_get_ori_dataset_idx
Convert global idx to local index. Args: idx (int): Global index of ``RepeatDataset``. Returns: Tuple[int, i
mmengine/dataset/dataset_wrapper.py:119
↓ 5 callers
Method
_init_visualizer
Initialize visualizers. Args: cfg (ConfigType): Config containing the visualizer information. Returns: Visua
mmengine/infer/infer.py:555
↓ 5 callers
Function
_is_builtin_module
Check if a module is a built-in module. Arg: module_name: name of module.
mmengine/config/utils.py:159
↓ 5 callers
Method
_mock_method
(self, optim_wrapper)
tests/test_optim/test_optimizer/test_optimizer_wrapper.py:308
↓ 5 callers
Method
add_scalar
Record the scalar data to disk. Args: name (str): The scalar identifier. value (int, float, torch.Tensor, np.ndarray)
mmengine/visualization/vis_backend.py:263
↓ 5 callers
Method
add_scalars
Record the scalars' data. Args: scalar_dict (dict): Key-value pair storing the tag and corresponding values.
mmengine/visualization/visualizer.py:1115
↓ 5 callers
Method
after_load_checkpoint
Resume ema parameters from checkpoint. Args: runner (Runner): The runner of the testing process.
mmengine/hooks/ema_hook.py:173
↓ 5 callers
Method
after_test_iter
Show or Write the predicted results. Args: runner (Runner): The runner of the training process. batch_idx (int): The
mmengine/hooks/naive_visualization_hook.py:60
↓ 5 callers
Method
after_train_iter
All subclasses should override this method, if they need any operations after each training iteration. Args: runner (Runn
mmengine/hooks/hook.py:221
↓ 5 callers
Method
after_val_epoch
All subclasses should override this method, if they need any operations after each validation epoch. Args: runner (Runner
mmengine/hooks/hook.py:146
↓ 5 callers
Method
ancestor_mode
Sets how to determine the ancestor modules of an operator. Must be one of "owner" or "caller". * "caller": an operator belongs to all
mmengine/analysis/jit_analysis.py:461
↓ 5 callers
Method
before_run
Initialize the profiler. Through the runner parameter, the validity of the parameter is further determined.
mmengine/hooks/profiler_hook.py:153
↓ 5 callers
Method
build_lazy
If class attribute ``lazy`` is False, the LazyObject will be built and returned. Args: value (Any): The value to be built
mmengine/config/config.py:206
↓ 5 callers
Function
build_temporary_directory
Build a temporary directory containing many files to test ``FileClient.list_dir_or_file``. . \n | -- dir1 \n | -- | -- text3.txt \n
tests/test_fileio/test_io.py:26
↓ 5 callers
Function
build_temporary_directory
Build a temporary directory containing many files to test ``FileClient.list_dir_or_file``. . \n | -- dir1 \n | -- | -- text3.txt \n
tests/test_fileio/test_backends/test_local_backend.py:26
↓ 5 callers
Method
build_visualizer
Build a global asscessable Visualizer. Args: visualizer (Visualizer or dict, optional): A Visualizer object or a
mmengine/runner/runner.py:773
↓ 5 callers
Method
by_operator
Returns the statistics for a requested module, grouped by operator type. The operator handle determines the name associated with each
mmengine/analysis/jit_analysis.py:273
↓ 5 callers
Method
children
(self)
mmengine/registry/registry.py:217
↓ 5 callers
Method
copyfile_from_local
Upload a local file src to dst and return the destination file. Args: src (str or Path): A local file to be copied. d
mmengine/fileio/backends/petrel_backend.py:407
↓ 5 callers
Method
copytree
Recursively copy an entire directory tree rooted at src to a directory named dst and return the destination directory. src and dst sh
mmengine/fileio/backends/petrel_backend.py:364
↓ 5 callers
Method
cpu
Convert all tensors to CPU in data.
mmengine/structures/base_data_element.py:492
↓ 5 callers
Method
every_n_inner_iters
Test whether current inner iteration can be evenly divided by n. Args: batch_idx (int): Current batch index of the training, vali
mmengine/hooks/hook.py:354
↓ 5 callers
Function
fmt
(x: float)
mmengine/analysis/print_helper.py:39
↓ 5 callers
Method
get_local_path
Download data from ``filepath`` and write the data to local path. ``get_local_path`` is decorated by :meth:`contxtlib.contextmanager`. It
mmengine/fileio/file_client.py:404
↓ 5 callers
Method
get_log_after_iter
Format log string after training, validation or testing iteration. Args: runner (Runner): The runner of training phase.
mmengine/runner/log_processor.py:124
↓ 5 callers
Method
get_lr
Get the learning rate of the optimizer. Provide unified interface to get learning rate of optimizer. Returns: Dict[str,
mmengine/optim/optimizer/base.py:95
↓ 5 callers
Function
get_object_from_string
Get object from name. Args: obj_name (str): The name of the object. Examples: >>> get_object_from_string('torch.optim.sgd.SG
mmengine/utils/misc.py:505
← previous
next →
201–300 of 2,962, ranked by callers