MCPcopy Create free account

hub / github.com/open-mmlab/mmengine / functions

Functions2,962 in github.com/open-mmlab/mmengine

↓ 13 callersMethodget_text
Read text from a given ``filepath`` with 'r' mode. Args: filepath (str or Path): Path to read data. encoding (str): T
mmengine/fileio/backends/local_backend.py:37
↓ 13 callersMethodget_text
(self, filepath, encoding='utf-8')
tests/test_fileio/test_fileclient.py:618
↓ 13 callersMethodinfer_client
Infer a suitable file client based on the URI and arguments. Args: file_client_args (dict, optional): Arguments to instantiate a
mmengine/fileio/file_client.py:163
↓ 13 callersMethodinit_weights
(self)
tests/test_model/test_base_module.py:194
↓ 13 callersFunctionjoin_path
r"""Concatenate all file paths. Join one or more filepath components intelligently. The return value is the concatenation of filepath and any
mmengine/fileio/io.py:340
↓ 13 callersMethodjoin_path
r"""Concatenate all file paths. Join one or more filepath components intelligently. The return value is the concatenation of filepath
mmengine/fileio/backends/petrel_backend.py:249
↓ 13 callersMethodnew
Return a new data element with same type. If ``metainfo`` and ``data`` are None, the new data element will have same metainfo and data
mmengine/structures/base_data_element.py:264
↓ 13 callersMethoduncalled_modules
Returns a set of submodules that were never called during the trace of the graph. This may be because they were unused, or because th
mmengine/analysis/jit_analysis.py:338
↓ 12 callersMethodbackward
(ctx, grad_output: torch.Tensor)
tests/test_analysis/test_flop_count.py:29
↓ 12 callersMethodbuild_train_loop
Build training loop. Examples of ``loop``:: # `EpochBasedTrainLoop` will be used loop = dict(by_epoch=True, max_epoc
mmengine/runner/runner.py:1485
↓ 12 callersMethodclose
Close an opened object.
mmengine/visualization/visualizer.py:1147
↓ 12 callersMethodget_subset_
The in-place version of ``get_subset`` to convert dataset to a subset of original dataset. This method will convert the original data
mmengine/dataset/base_dataset.py:554
↓ 12 callersMethodinitialize_count_status
Initialize gradient accumulation related attributes. ``OptimWrapper`` can be used without calling ``initialize_iter_status``. However
mmengine/optim/optimizer/optimizer_wrapper.py:300
↓ 12 callersMethodlist_dir_or_file
Scan a directory to find the interested directories or files in arbitrary order. Note: :meth:`list_dir_or_file` returns t
mmengine/fileio/backends/local_backend.py:474
↓ 12 callersFunctionprod
(*args, **kwargs)
mmengine/analysis/jit_handles.py:19
↓ 11 callersMethod_init_dist_env
Initialize the distributed environment.
tests/test_dist/test_utils.py:344
↓ 11 callersFunctionapply_to
Apply function to each element in dict, list or tuple that matches with the expression. For examples, if you want to convert each element in
mmengine/utils/misc.py:220
↓ 11 callersFunctionbuild_optim_wrapper
Build function of OptimWrapper. If ``constructor`` is set in the ``cfg``, this method will build an optimizer wrapper constructor, and use op
mmengine/optim/optimizer/builder.py:181
↓ 11 callersFunctioncheck_type
Check whether the type of value is in ``valid_type``. Args: name (str): value name. value (Any): value. valid_type (Type,
mmengine/visualization/utils.py:45
↓ 11 callersMethoddraw_circles
Draw single or multiple circles. Args: center (Union[np.ndarray, torch.Tensor]): The x coordinate of each line' s
mmengine/visualization/visualizer.py:628
↓ 11 callersFunctiondump
Dump data to json/yaml/pickle strings or files. This method provides a unified api for dumping data as strings or to files, and also supports
mmengine/fileio/io.py:864
↓ 11 callersMethodfull_init
Load annotation file and set ``BaseDataset._fully_initialized`` to True. If ``lazy_init=False``, ``full_init`` will be called during
mmengine/dataset/base_dataset.py:277
↓ 11 callersFunctionimport_modules_from_strings
Import modules from the given list of strings. Args: imports (list | str | None): The given module names to be imported. allow_fa
mmengine/utils/misc.py:43
↓ 11 callersMethodisdir
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/petrel_backend.py:194
↓ 11 callersMethoditems
A generator to get the name and corresponding :obj:`OptimWrapper`
mmengine/optim/optimizer/optimizer_wrapper_dict.py:163
↓ 11 callersMethodregister_backend
Register a backend to FileClient. This method can be used as a normal class method or a decorator. .. code-block:: python
mmengine/fileio/file_client.py:231
↓ 11 callersFunctionreset_string_io
(io)
tests/test_utils/test_progressbar.py:12
↓ 11 callersMethodset_op_handle
Sets additional operator handles, or replaces existing ones. If a handle is ``None``, the op will be explicitly ignored. Otherwise, h
mmengine/analysis/jit_analysis.py:355
↓ 11 callersMethodswitch_scope_and_registry
Temporarily switch default scope to the target scope, and get the corresponding registry. If the registry of the corresponding scope
mmengine/registry/registry.py:225
↓ 10 callersMethod_get_runtime_info_hook
(self, runner)
tests/test_hooks/test_runtime_info_hook.py:202
↓ 10 callersMethod_init_dist_env
Initialize the distributed environment.
tests/test_dist/test_dist.py:124
↓ 10 callersMethod_init_dist_env
Initialize the distributed environment.
tests/test_dist/test_utils.py:215
↓ 10 callersMethodcopytree
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/local_backend.py:241
↓ 10 callersMethodget_subset
Return a subset of dataset. This method will return a subset of original dataset. If type of indices is int, ``get_subset_`` will ret
mmengine/dataset/base_dataset.py:597
↓ 10 callersFunctionimfrombytes
(content)
tests/test_fileio/test_fileclient.py:24
↓ 10 callersMethodis_equal
(self, x, y)
tests/test_structures/test_data_element.py:66
↓ 10 callersMethodisdir
Check whether a file path is a directory. Args: filepath (str or Path): Path to be checked whether it is a direct
mmengine/fileio/file_client.py:363
↓ 10 callersMethodmodel
(self)
mmengine/_strategy/deepspeed.py:71
↓ 10 callersMethodnumpy
Convert all tensors to np.ndarray in data.
mmengine/structures/base_data_element.py:557
↓ 10 callersMethodput_text
Write text to a given ``filepath`` with 'w' mode. Note: ``put_text`` will create a directory if the directory of ``fi
mmengine/fileio/backends/local_backend.py:80
↓ 10 callersMethodremove
(filepath)
tests/test_fileio/test_backends/test_petrel_backend.py:427
↓ 10 callersMethodresume
Resume model from checkpoint. Args: filename (str): Accept local filepath, URL, ``torchvision://xxx``, ``open-mml
mmengine/runner/runner.py:1997
↓ 10 callersMethodset_metainfo
Set or change key-value pairs in ``metainfo_field`` by parameter ``metainfo``. Args: metainfo (dict): A dict contains the
mmengine/structures/base_data_element.py:220
↓ 10 callersMethodtracer_warnings
Sets which warnings to print when tracing the graph to calculate statistics. There are three modes. Defaults to 'no_tracer_warning'. A
mmengine/analysis/jit_analysis.py:444
↓ 10 callersMethodupdate
Update progressbar. Args: num_tasks (int): Update step size.
mmengine/utils/progressbar.py:56
↓ 10 callersMethodupdate_params
Update parameters in :attr:`optimizer`.
mmengine/optim/optimizer/base.py:28
↓ 9 callersMethod__init__
(self, optimizer: OptimizerType, param_name: str, begin: in
mmengine/optim/scheduler/param_scheduler.py:51
↓ 9 callersMethod__init__
(self, lin_op: str = 'addmm')
tests/test_analysis/test_jit_analysis.py:76
↓ 9 callersMethod_init_dist_env
Initialize the distributed environment.
tests/test_dist/test_dist.py:361
↓ 9 callersMethod_parse_trace_config
Used to parse the parameter 'on_trace_ready'.
mmengine/hooks/profiler_hook.py:178
↓ 9 callersMethod_spawn_processes
(self)
mmengine/testing/_internal/distributed.py:153
↓ 9 callersMethodbuild_dataloader
Build dataloader. The method builds three components: - Dataset - Sampler - Dataloader An example of ``data
mmengine/runner/runner.py:1328
↓ 9 callersMethodby_module
Returns the statistics for all submodules, aggregated over all operators. Returns: Counter(str): statistics counter group
mmengine/analysis/jit_analysis.py:306
↓ 9 callersMethodcall_hook
Call all hooks. Args: fn_name (str): The function name in each hook to be called, such as "before_train_epoch".
mmengine/runner/_flexible_runner.py:1259
↓ 9 callersMethodcopy_if_symlink_fails
Create a symbolic link pointing to src named dst. If failed to create a symbolic link pointing to src, directly copy src to dst inste
mmengine/fileio/backends/local_backend.py:435
↓ 9 callersMethodcopyfile
(src, dst)
tests/test_fileio/test_backends/test_petrel_backend.py:441
↓ 9 callersMethoddraw_binary_masks
Draw single or multiple binary masks. Args: binary_masks (np.ndarray, torch.Tensor): The binary_masks to draw wit
mmengine/visualization/visualizer.py:852
↓ 9 callersMethodget_last_value
Return the last computed value by current scheduler. Returns: list: A list of the last computed value of the optimizer's
mmengine/optim/scheduler/param_scheduler.py:154
↓ 9 callersMethodoverwrite_default_scope
Overwrite the current default scope with `scope_name`
mmengine/registry/default_scope.py:83
↓ 9 callersFunctionparameter_count
Count parameters of a model and its submodules. Adopted from https://github.com/facebookresearch/fvcore/blob/main/fvcore/nn/parameter_count.p
mmengine/analysis/complexity_analysis.py:270
↓ 9 callersMethodregister_hook
Register a hook into the hook list. The hook will be inserted into a priority queue, with the specified priority (See :class:`Priorit
mmengine/runner/runner.py:1843
↓ 9 callersMethodrun
Launch validation.
mmengine/runner/loops.py:370
↓ 9 callersFunctiontensor2ndarray
If the type of value is torch.Tensor, convert the value to np.ndarray. Args: value (np.ndarray, torch.Tensor): value. Returns:
mmengine/visualization/utils.py:13
↓ 8 callersMethod_check_scheduler_state_dict
(self, construct, construct2,
tests/test_optim/test_scheduler/test_momentum_scheduler.py:638
↓ 8 callersMethod_check_scheduler_state_dict
(self, construct, construct2,
tests/test_optim/test_scheduler/test_param_scheduler.py:672
↓ 8 callersMethod_check_scheduler_state_dict
(self, construct, construct2,
tests/test_optim/test_scheduler/test_lr_scheduler.py:532
↓ 8 callersMethod_count_function
(self, func, inputs, name)
tests/test_analysis/test_flop_count.py:846
↓ 8 callersMethod_get_ema_hook
(self, runner)
tests/test_hooks/test_ema_hook.py:80
↓ 8 callersMethod_hook
(cls, item)
mmengine/config/config.py:121
↓ 8 callersFunction_load_checkpoint
Load checkpoint from somewhere (modelzoo, file, url). Args: filename (str): Accept local filepath, URL, ``torchvision://xxx``,
mmengine/runner/checkpoint.py:531
↓ 8 callersMethod_replace_prefix
(self, filepath: Union[str, Path])
mmengine/fileio/backends/petrel_backend.py:81
↓ 8 callersMethodafter_val_epoch
Decide whether to stop the training process. Args: runner (Runner): The runner of the training process. metrics (dict
mmengine/hooks/early_stopping_hook.py:133
↓ 8 callersMethodbuild_test_loop
Build test loop. Examples of ``loop``:: # `TestLoop` will be used loop = dict() # custom test loop
mmengine/runner/runner.py:1577
↓ 8 callersMethodcanonical_module_name
Returns the canonical module name of the given ``name``, which might be different from the given ``name`` if the module is shared. Th
mmengine/analysis/jit_analysis.py:396
↓ 8 callersFunctioncheck_type_and_length
Check whether the type of value is in ``valid_type``. If type of the ``value`` is list, check whether its length is equal with or greater than
mmengine/visualization/utils.py:75
↓ 8 callersMethoddraw_bboxes
Draw single or multiple bboxes. Args: bboxes (Union[np.ndarray, torch.Tensor]): The bboxes to draw with the forma
mmengine/visualization/visualizer.py:712
↓ 8 callersMethoddraw_lines
Draw single or multiple line segments. Args: x_datas (Union[np.ndarray, torch.Tensor]): The x coordinate of each
mmengine/visualization/visualizer.py:565
↓ 8 callersMethoddraw_polygons
Draw single or multiple bboxes. Args: polygons (Union[Union[np.ndarray, torch.Tensor],\ List[Union[np.ndarray, to
mmengine/visualization/visualizer.py:777
↓ 8 callersMethodget
Read bytes from a given ``filepath`` with 'rb' mode. Args: filepath (str or Path): Path to read data. Returns:
mmengine/fileio/backends/petrel_backend.py:85
↓ 8 callersFunctionget_metric_value
Get the metric value specified by an indicator, which can be either a metric name or a full name with evaluator prefix. Args: indicat
mmengine/evaluator/utils.py:5
↓ 8 callersFunctionis_npu_available
Returns True if Ascend PyTorch and npu devices exist.
mmengine/device/utils.py:66
↓ 8 callersMethodisdir
(self)
tests/test_fileio/test_fileclient.py:110
↓ 8 callersMethodjoin_path
r"""Concatenate all file paths. Join one or more filepath components intelligently. The return value is the concatenation of filepath
mmengine/fileio/backends/local_backend.py:159
↓ 8 callersMethodload_or_resume
Load or resume checkpoint.
mmengine/runner/runner.py:1679
↓ 8 callersMethodparse_uri_prefix
Parse the prefix of a uri. Args: uri (str | Path): Uri to be parsed that contains the file prefix. Examples:
mmengine/fileio/file_client.py:136
↓ 8 callersMethodpop
Pop property in data and metainfo as the same as python.
mmengine/structures/base_data_element.py:425
↓ 8 callersMethodstate_dict
(self)
mmengine/_strategy/deepspeed.py:97
↓ 8 callersFunctiontrack_progress_rich
Track the progress of parallel task execution with a progress bar. The built-in :mod:`multiprocessing` module is used for process pools and tasks
mmengine/utils/progressbar_rich.py:48
↓ 8 callersMethoduncalled_modules_warnings
Sets if warnings from uncalled submodules are shown. Defaults to true. A submodule is considered "uncalled" if it is never called dur
mmengine/analysis/jit_analysis.py:495
↓ 8 callersFunctionupdate_init_info
Update the `_params_init_info` in the module if the value of parameters are changed. Args: module (obj:`nn.Module`): The module of Py
mmengine/model/weight_init.py:15
↓ 8 callersMethodupdate_parameters
Update the parameters of the model. This method will execute the ``avg_func`` to compute the new parameters and update the model's par
mmengine/model/averaged_model.py:91
↓ 8 callersFunctionvalue2list
If the type of ``value`` is ``valid_type``, convert the value to list and expand to ``expand_dim``. Args: value (Any): value.
mmengine/visualization/utils.py:27
↓ 7 callersMethod__init__
(self, save_dir: Optional[str] = None, init_kwargs: Optional[dict] = None)
mmengine/visualization/vis_backend.py:1350
↓ 7 callersMethod__init__
(self, *, bias=0, bias_prob=None, layer=None)
mmengine/model/weight_init.py:133
↓ 7 callersMethod__init__
(self, component1=None, component2=None, component3=None,
tests/test_model/test_base_module.py:74
↓ 7 callersMethod_check_default_optimizer
(self, optimizer, model, prefix='')
tests/test_optim/test_optimizer/test_optimizer.py:130
↓ 7 callersFunction_get_device_id
Get device id of current machine.
mmengine/logging/logger.py:394
↓ 7 callersFunction_get_package_and_cfg_path
Get package name and relative config path. Args: cfg_path (str): External relative config path with 'package::'. Returns: Tu
mmengine/config/utils.py:115
↓ 7 callersMethod_get_root_registry
Return the root registry.
mmengine/registry/registry.py:327
↓ 7 callersMethodafter_train_iter
Record logs after training iteration. Args: runner (Runner): The runner of the training process. batch_idx (int): The
mmengine/hooks/logger_hook.py:165
← previousnext →101–200 of 2,962, ranked by callers