validate.py

Validate optical flow estimation performance on standard datasets.

validate.generate_outputs(args: Namespace, inputs: Dict[str, Tensor], preds: Dict[str, Tensor], dataloader_name: str, batch_idx: int, metadata: Dict[str, Any] | None = None) None[source]

Display on screen and/or save outputs to disk, if required.

Parameters:
argsNamespace

The arguments with the required values to manage the outputs.

inputsDict[str, torch.Tensor]

The inputs loaded from the dataset (images, groundtruth).

predsDict[str, torch.Tensor]

The model predictions (optical flow and others).

dataloader_namestr

A string to identify from which dataloader these inputs came from.

batch_idxint

Indicates in which position of the loader this input is.

metadataDict[str, Any], optional

Metadata about this input, if available.

validate.validate(args: Namespace, model: BaseModel) DataFrame[source]

Perform the validation.

Parameters:
argsNamespace

Arguments to configure the model and the validation.

modelBaseModel

The model to be used for validation.

Returns:
pd.DataFrame

A DataFrame with the metric results.

See also

ptlflow.models.base_model.base_model.BaseModel

The parent class of the available models.

validate.validate_list_of_models(args: Namespace) None[source]

Perform the validation.

Parameters:
argsNamespace

Arguments to configure the list of models and the validation.

validate.validate_one_dataloader(args: Namespace, model: BaseModel, dataloader: DataLoader, dataloader_name: str) Dict[str, float][source]

Perform validation for all examples of one dataloader.

Parameters:
argsNamespace

Arguments to configure the model and the validation.

modelBaseModel

The model to be used for validation.

dataloaderDataLoader

The dataloader for the validation.

dataloader_namestr

A string to identify this dataloader.

Returns:
Dict[str, float]

The average metric values for this dataloader.