Shortcuts

mmedit.apis.inferencers.conditional_inferencer

Module Contents

Classes

ConditionalInferencer

inferencer that predicts with conditional models.

class mmedit.apis.inferencers.conditional_inferencer.ConditionalInferencer(config: Union[mmedit.utils.ConfigType, str], ckpt: Optional[str], device: Optional[str] = None, extra_parameters: Optional[Dict] = None, seed: int = 2022, **kwargs)[源代码]

Bases: mmedit.apis.inferencers.base_mmedit_inferencer.BaseMMEditInferencer

inferencer that predicts with conditional models.

func_kwargs[源代码]
extra_parameters[源代码]
preprocess(label: mmedit.apis.inferencers.base_mmedit_inferencer.InputsType) Dict[源代码]

Process the inputs into a model-feedable format.

参数

label (InputsType) – Input label for condition models.

返回

Results of preprocess.

返回类型

results(Dict)

forward(inputs: mmedit.apis.inferencers.base_mmedit_inferencer.InputsType) mmedit.apis.inferencers.base_mmedit_inferencer.PredType[源代码]

Forward the inputs to the model.

visualize(preds: mmedit.apis.inferencers.base_mmedit_inferencer.PredType, result_out_dir: str = None) List[numpy.ndarray][源代码]

Visualize predictions.

参数
  • preds (List[Union[str, np.ndarray]]) – Forward results by the inferencer.

  • data (List[Dict]) – Not needed by this kind of inferencer.

  • result_out_dir (str) – Output directory of image. Defaults to ‘’.

返回

Result of visualize

返回类型

List[np.ndarray]

_pred2dict(data_sample: mmedit.structures.EditDataSample) Dict[源代码]

Extract elements necessary to represent a prediction into a dictionary. It’s better to contain only basic data elements such as strings and numbers in order to guarantee it’s json-serializable.

参数

data_sample (EditDataSample) – The data sample to be converted.

返回

The output dictionary.

返回类型

dict

Read the Docs v: latest
Versions
master
latest
stable
zyh-doc-notfound-extend
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.