mmagic.evaluation.functional.fid_inception
¶
Inception networks used in calculating FID and Inception metrics.
This code is modified from: https://github.com/rosinality/stylegan2-pytorch/blob/master/inception.py
Module Contents¶
Classes¶
Pretrained InceptionV3 network returning feature maps. |
|
InceptionA block patched for FID computation. |
|
InceptionC block patched for FID computation. |
|
First InceptionE block patched for FID computation. |
|
Second InceptionE block patched for FID computation. |
Functions¶
|
Build pretrained Inception model for FID computation. |
Attributes¶
- mmagic.evaluation.functional.fid_inception.FID_WEIGHTS_URL = https://github.com/mseitzer/pytorch-fid/releases/download/fid_weights/pt_inception-2015-12-05-672...[source]¶
- class mmagic.evaluation.functional.fid_inception.InceptionV3(output_blocks=[DEFAULT_BLOCK_INDEX], resize_input=True, normalize_input=True, requires_grad=False, use_fid_inception=True, load_fid_inception=True)[source]¶
Bases:
torch.nn.Module
Pretrained InceptionV3 network returning feature maps.
- mmagic.evaluation.functional.fid_inception.fid_inception_v3(load_ckpt=True)[source]¶
Build pretrained Inception model for FID computation.
The Inception model for FID computation uses a different set of weights and has a slightly different structure than torchvision’s Inception.
This method first constructs torchvision’s Inception and then patches the necessary parts that are different in the FID Inception model.
- class mmagic.evaluation.functional.fid_inception.FIDInceptionA(in_channels, pool_features)[source]¶
Bases:
torchvision.models.inception.InceptionA
InceptionA block patched for FID computation.
- class mmagic.evaluation.functional.fid_inception.FIDInceptionC(in_channels, channels_7x7)[source]¶
Bases:
torchvision.models.inception.InceptionC
InceptionC block patched for FID computation.
- class mmagic.evaluation.functional.fid_inception.FIDInceptionE_1(in_channels)[source]¶
Bases:
torchvision.models.inception.InceptionE
First InceptionE block patched for FID computation.