Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright © 2022 Bernat Puig Camps | |
import pandas as pd | |
import pytest | |
from classify_errors import ( | |
PREDS_DF_COLUMNS, | |
TARGETS_DF_COLUMNS, | |
ErrorType, | |
classify_predictions_errors, | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright © 2022 Bernat Puig Camps | |
from typing import Callable, Dict, Tuple | |
import pandas as pd | |
from classify_errors import PREDS_DF_COLUMNS, TARGETS_DF_COLUMNS, ErrorType | |
def calculate_error_impact( | |
metric_name: str, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright © 2022 Bernat Puig Camps | |
import torch | |
from torchmetrics.detection.mean_ap import MeanAveragePrecision | |
class MyMeanAveragePrecision: | |
"""Wrapper for the torchmetrics MeanAveragePrecision exposing API we need""" | |
def __init__(self, foreground_threshold): | |
self.device = ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright © 2022 Bernat Puig Camps | |
from typing import Dict, Set, Tuple | |
import numpy as np | |
import pandas as pd | |
import torch | |
import torchvision | |
TARGETS_DF_COLUMNS = [ | |
"target_id", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright © 2022 Bernat Puig Camps | |
from pathlib import Path | |
import pandas as pd | |
from PIL import Image | |
import torch | |
import torchvision | |
def get_predictions( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright © 2022 Bernat Puig Camps | |
import json | |
from pathlib import Path | |
from typing import Tuple | |
import pandas as pd | |
DATA_PATH = Path("./coco_val2017") |