SemiSupModel

class packnet_sfm.models.SemiSupModel.SemiSupModel(supervised_loss_weight=0.9, **kwargs)[source]

Bases: packnet_sfm.models.SelfSupModel.SelfSupModel

Model that inherits a depth and pose networks, plus the self-supervised loss from SelfSupModel and includes a supervised loss for semi-supervision.

Parameters
  • supervised_loss_weight (float) – Weight for the supervised loss

  • kwargs (dict) – Extra parameters

forward(batch, return_logs=False, progress=0.0)[source]

Processes a batch.

Parameters
  • batch (dict) – Input batch

  • return_logs (bool) – True if logs are stored

  • progress – Training progress percentage

Returns

output – Dictionary containing a “loss” scalar and different metrics and predictions for logging and downstream usage.

Return type

dict

property logs

Return logs.

supervised_loss(inv_depths, gt_inv_depths, return_logs=False, progress=0.0)[source]

Calculates the supervised loss.

Parameters
  • inv_depths (torch.Tensor [B,1,H,W]) – Predicted inverse depth maps from the original image

  • gt_inv_depths (torch.Tensor [B,1,H,W]) – Ground-truth inverse depth maps from the original image

  • return_logs (bool) – True if logs are stored

  • progress – Training progress percentage

Returns

output – Dictionary containing a “loss” scalar a “metrics” dictionary

Return type

dict