Shortcuts

mmedit.models.editors.arcface.id_loss

Module Contents

Classes

IDLossModel

Face id loss model.

class mmedit.models.editors.arcface.id_loss.IDLossModel(ir_se50_weights=None)[source]

Bases: torch.nn.Module

Face id loss model.

Parameters

ir_se50_weights (str, optional) – Url of ir-se50 weights. Defaults to None.

_ir_se50_url = https://gg0ltg.by.files.1drv.com/y4m3fNNszG03z9n8JQ7EhdtQKW8tQVQMFBisPVRgoXi_UfP8pKSSqv8RJNmHy2Ja...[source]
extract_feats(x)[source]

Extracting face features.

Parameters

x (torch.Tensor) – Image tensor of faces.

Returns

Face features.

Return type

torch.Tensor

forward(pred=None, gt=None)[source]

Calculate face loss.

Parameters
  • pred (torch.Tensor, optional) – Predictions of face images. Defaults to None.

  • gt (torch.Tensor, optional) – Ground truth of face images. Defaults to None.

Returns

A tuple contain face similarity loss and

improvement.

Return type

Tuple(float, float)

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.