adds nms and eval

This commit is contained in:
franksim
2025-12-02 11:04:47 +01:00
parent 3b6a588719
commit a6f70005f2
9 changed files with 428 additions and 985 deletions

View File

@@ -5,7 +5,7 @@ import numpy as np
import torch
from torch.utils.data import DataLoader
from ..a3.annotation import read_groundtruth_file, AnnotationRect
from .label_grid import get_label_grid, iou
from .label_grid import get_label_grid
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from .anchor_grid import get_anchor_grid
@@ -178,7 +178,6 @@ def compute_ious_vectorized(boxes1, boxes2):
boxes1: (M, 4), boxes2: (N, 4) -- format [x1, y1, x2, y2]
Returns: (M, N) IoU
"""
M, N = boxes1.shape[0], boxes2.shape[0]
# Expand to (M, N, 4)
boxes1 = boxes1[:, None, :] # (M, 1, 4)