Shortcuts

mmedit.apis.inferencers.inpainting_inferencer

Module Contents

Classes

InpaintingInferencer

inferencer that predicts with inpainting models.

class mmedit.apis.inferencers.inpainting_inferencer.InpaintingInferencer(config: Union[mmedit.utils.ConfigType, str], ckpt: Optional[str], device: Optional[str] = None, extra_parameters: Optional[Dict] = None, seed: int = 2022, **kwargs)[source]

Bases: mmedit.apis.inferencers.base_mmedit_inferencer.BaseMMEditInferencer

inferencer that predicts with inpainting models.

func_kwargs[source]
_init_pipeline(cfg) mmengine.dataset.Compose[source]

Initialize the test pipeline.

preprocess(img: mmedit.apis.inferencers.base_mmedit_inferencer.InputsType, mask: mmedit.apis.inferencers.base_mmedit_inferencer.InputsType) Dict[source]

Process the inputs into a model-feedable format.

Parameters
  • img (InputsType) – Image to be inpainted by models.

  • mask (InputsType) – Image mask for inpainting models.

Returns

Results of preprocess.

Return type

results(Dict)

forward(inputs: mmedit.apis.inferencers.base_mmedit_inferencer.InputsType) mmedit.apis.inferencers.base_mmedit_inferencer.PredType[source]

Forward the inputs to the model.

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

Visualize predictions.

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

  • data (List[Dict]) – Mask of input image.

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

Returns

Result of visualize

Return type

List[np.ndarray]

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

Free document hosting provided by Read the Docs.