pyiqa.archs.inception

File from: https://github.com/mseitzer/pytorch-fid

Module Contents

pyiqa.archs.inception.FID_WEIGHTS_URL[source]
class pyiqa.archs.inception.InceptionV3(output_blocks=(DEFAULT_BLOCK_INDEX,), resize_input=True, normalize_input=True, requires_grad=False, use_fid_inception=True)[source]

Bases: torch.nn.Module

Pretrained InceptionV3 network returning feature maps

forward(inp, resize_input=False, normalize_input=False)[source]

Get Inception feature maps :param inp: Input tensor of shape Bx3xHxW. Values are expected to be in

range (0, 1)

Returns:

  • List of torch.autograd.Variable, corresponding to the selected output

  • block, sorted ascending by index

pyiqa.archs.inception.fid_inception_v3()[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 pyiqa.archs.inception.FIDInceptionA(in_channels, pool_features)[source]

Bases: torchvision.models.inception.InceptionA

InceptionA block patched for FID computation

forward(x)[source]
class pyiqa.archs.inception.FIDInceptionC(in_channels, channels_7x7)[source]

Bases: torchvision.models.inception.InceptionC

InceptionC block patched for FID computation

forward(x)[source]
class pyiqa.archs.inception.FIDInceptionE_1(in_channels)[source]

Bases: torchvision.models.inception.InceptionE

First InceptionE block patched for FID computation

forward(x)[source]
class pyiqa.archs.inception.FIDInceptionE_2(in_channels)[source]

Bases: torchvision.models.inception.InceptionE

Second InceptionE block patched for FID computation

forward(x)[source]