pyVHR.resources.faceparsing package

Subpackages

Submodules

pyVHR.resources.faceparsing.evaluate module

pyVHR.resources.faceparsing.face_dataset module

pyVHR.resources.faceparsing.logger module

pyVHR.resources.faceparsing.logger.setup_logger(logpth)[source]

pyVHR.resources.faceparsing.loss module

class pyVHR.resources.faceparsing.loss.OhemCELoss(thresh, n_min, ignore_lb=255, *args, **kwargs)[source]

Bases: torch.nn.modules.module.Module

forward(logits, labels)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool
class pyVHR.resources.faceparsing.loss.SoftmaxFocalLoss(gamma, ignore_lb=255, *args, **kwargs)[source]

Bases: torch.nn.modules.module.Module

forward(logits, labels)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool

pyVHR.resources.faceparsing.makeup module

pyVHR.resources.faceparsing.model module

class pyVHR.resources.faceparsing.model.AttentionRefinementModule(in_chan, out_chan, *args, **kwargs)[source]

Bases: torch.nn.modules.module.Module

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

init_weight()[source]
training: bool
class pyVHR.resources.faceparsing.model.BiSeNet(n_classes, *args, **kwargs)[source]

Bases: torch.nn.modules.module.Module

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

get_params()[source]
init_weight()[source]
training: bool
class pyVHR.resources.faceparsing.model.BiSeNetOutput(in_chan, mid_chan, n_classes, *args, **kwargs)[source]

Bases: torch.nn.modules.module.Module

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

get_params()[source]
init_weight()[source]
training: bool
class pyVHR.resources.faceparsing.model.ContextPath(*args, **kwargs)[source]

Bases: torch.nn.modules.module.Module

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

get_params()[source]
init_weight()[source]
training: bool
class pyVHR.resources.faceparsing.model.ConvBNReLU(in_chan, out_chan, ks=3, stride=1, padding=1, *args, **kwargs)[source]

Bases: torch.nn.modules.module.Module

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

init_weight()[source]
training: bool
class pyVHR.resources.faceparsing.model.FeatureFusionModule(in_chan, out_chan, *args, **kwargs)[source]

Bases: torch.nn.modules.module.Module

forward(fsp, fcp)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

get_params()[source]
init_weight()[source]
training: bool
class pyVHR.resources.faceparsing.model.SpatialPath(*args, **kwargs)[source]

Bases: torch.nn.modules.module.Module

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

get_params()[source]
init_weight()[source]
training: bool

pyVHR.resources.faceparsing.optimizer module

class pyVHR.resources.faceparsing.optimizer.Optimizer(model, lr0, momentum, wd, warmup_steps, warmup_start_lr, max_iter, power, *args, **kwargs)[source]

Bases: object

get_lr()[source]
step()[source]
zero_grad()[source]

pyVHR.resources.faceparsing.prepropess_data module

pyVHR.resources.faceparsing.resnet module

class pyVHR.resources.faceparsing.resnet.BasicBlock(in_chan, out_chan, stride=1)[source]

Bases: torch.nn.modules.module.Module

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool
class pyVHR.resources.faceparsing.resnet.Resnet18[source]

Bases: torch.nn.modules.module.Module

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

get_params()[source]
init_weight()[source]
training: bool
pyVHR.resources.faceparsing.resnet.conv3x3(in_planes, out_planes, stride=1)[source]

3x3 convolution with padding

pyVHR.resources.faceparsing.resnet.create_layer_basic(in_chan, out_chan, bnum, stride=1)[source]

pyVHR.resources.faceparsing.test module

pyVHR.resources.faceparsing.train module

pyVHR.resources.faceparsing.transform module

class pyVHR.resources.faceparsing.transform.ColorJitter(brightness=None, contrast=None, saturation=None, *args, **kwargs)[source]

Bases: object

class pyVHR.resources.faceparsing.transform.Compose(do_list)[source]

Bases: object

class pyVHR.resources.faceparsing.transform.HorizontalFlip(p=0.5, *args, **kwargs)[source]

Bases: object

class pyVHR.resources.faceparsing.transform.MultiScale(scales)[source]

Bases: object

class pyVHR.resources.faceparsing.transform.RandomCrop(size, *args, **kwargs)[source]

Bases: object

class pyVHR.resources.faceparsing.transform.RandomScale(scales=(1,), *args, **kwargs)[source]

Bases: object

Module contents