Skip to content

8. Explore Model

In addition to all the information available in the experiment tracking server, you might want to further explore the behaviour of the model (i.e. run inference on some examples not included in the validation set).

Create and assign a model/explore issue. The assigment of this issue will automatically create an associated branch. Remember to link it to the corresponding milestone.


It is possible to check how the model performs once it has been trained. For this you should check if your experiment finished succesfully and you have available checkpoint in the experiment tracking server.

You will need three different files for exploring your model:

  • checkpoint.pth: Pytorch uses .pth extension for checkpoints and latest.pth file is the latest checkpoint saved during before finishing the training, this is your model weights after the last epoch.
  • config.py: contais all information about your training setup (model and dataset configs)
  • image_file: path to your input image

So, having this into account you can get your COCO annotations file by:

Explore model performance with image

python src/stages/model/explore/process_image.py
    --config_file [your-model-config-file.py]
    --model_checkpoint [your-model-checkpoint-file.pth]
    --image_path  [your-test-image]
    --output_folder [output-folder]
{
"categories": [
    {
    "supercategory": "object",
    "id": 0,
    "name": "background"
    },
    {
    "supercategory": "object",
    "id": 1,
    "name": "debris"
    }
],
"annotations": [
    {
    "id": 0,
    "segmentation": {
        "size": [
        600,
        600
        ],
        "counts": "0Pbo:"
    },
    "area": 360000,
    "image_id": 1,
    "category_id": 0
    },
    {
    "id": 1,
    "segmentation": {
        "size": [
        600,
        600
        ],
        "counts": "Pbo:"
    },
    "area": 0,
    "image_id": 1,
    "category_id": 1
    }
],
"images": [
    {
    "id": 1,
    "width": 600,
    "height": 600,
    "file_name": "0002SET_IMG_0010_rgb_1412_500_2012_1100.png"
    }
]
}

You can then use explore_ground_truth for paint COCO ground truth over the input image.