Shortcuts

mmengine.utils.check_prerequisites

mmengine.utils.check_prerequisites(prerequisites, checker, msg_tmpl='Prerequisites "{}" are required in method "{}" but not found, please install them first.')[源代码]

A decorator factory to check if prerequisites are satisfied.

参数:
  • prerequisites (str of list[str]) – Prerequisites to be checked.

  • checker (callable) – The checker method that returns True if a prerequisite is meet, False otherwise.

  • msg_tmpl (str) – The message template with two variables.

返回:

A specific decorator.

返回类型:

decorator