test_model.py π§ΒΆ
Source: LION/utils/test_model.py
Warning
This file has not yet received a complete narrative and docstring audit. Its public source-level API is listed automatically below.
- test_with_img_output(experiment: ct_experiments.Experiment, model_type: Type[LIONmodel], model_fpath: str, img_fpath: str, n=1, device: str = 'cpu')
Test model trained and saved at model_fpath on n pieces of test data. Outputs predictions and ground truths as images at img_fpath{n}
Args: experiment (ct_experiments.Experiment): Expriment model was trained on. Must be same, otherwise results cannot be guaranteed. model_type (LIONmodel): Type of LIONmodel to be tested model_fpath (str): Filepath of trained model img_fpath (str): Base filepath to store resultant images at n (int): Number of test data to test device: Device to run forward pass of model on. Default=cpu
Raises: ValueError: If model_type is not a valid subclass of LIONmodel
- test_with_experiment(experiment: ct_experiments.Experiment, model_type: Type[LIONmodel], model_fpath: str, n: int = 1, device: str = 'cpu')
Test model trained and saved at model_fpath. Returns prediction and ground truth data
Args: experiment (ct_experiments.Experiment): Expriment model was trained on. Must be same, otherwise results cannot be guaranteed. model_type (LIONmodel): Type of LIONmodel to be tested model_fpath (str): Filepath of trained model n (int): Number of test data to test device: Device to run forward pass of model on. Default=cpu
Raises: ValueError: If model_type is not a valid subclass of LIONmodel