Shortcuts

mmedit.evaluation.functional.prepare_inception_feat

mmedit.evaluation.functional.prepare_inception_feat(dataloader: torch.utils.data.dataloader.DataLoader, metric: mmengine.evaluator.metric.BaseMetric, data_preprocessor: Optional[torch.nn.modules.module.Module] = None, capture_mean_cov: bool = False, capture_all: bool = False) dict[source]

Prepare inception feature for the input metric.

  • If metric.inception_pkl is an online path, try to download and load it. If cannot download or load, corresponding error will be raised.

  • If metric.inception_pkl is local path and file exists, try to load the file. If cannot load, corresponding error will be raised.

  • If metric.inception_pkl is local path and file not exists, we will extract the inception feature manually and save to ‘inception_pkl’.

  • If metric.inception_pkl is not defined, we will extrace the inception feature and save it to default cache dir with default name.

Parameters
  • datalaoder (Dataloader) – The dataloader of real images.

  • metric (BaseMetric) – The metric which needs inception features.

  • data_preprocessor (Optional[nn.Module]) – Data preprocessor of the module. Used to preprocess the real images. If not passed, real images will automatically normalized to [-1, 1]. Defaults to None.

  • capture_mean_cov (bool) – Whether save the mean and covariance of inception feature. Defaults to False.

  • capture_all (bool) – Whether save the raw inception feature. If true, it will take a lot of time to save the inception feature. Defaults to False.

Returns

Dict contains inception feature.

Return type

dict

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

Free document hosting provided by Read the Docs.