update template code

This commit is contained in:
phatakmr
2025-10-13 14:48:00 +02:00
parent c9d159fcc6
commit 8f637a4a0d
46 changed files with 2955 additions and 1 deletions

26
mmp/a8/bbr.py Normal file
View File

@@ -0,0 +1,26 @@
import torch
import numpy as np
from ..a3.annotation import AnnotationRect
def get_bbr_loss(
anchor_boxes: torch.Tensor,
adjustments: torch.Tensor,
groundtruths: torch.Tensor,
):
"""
@param anchor_boxes: Batch of box coordinates from the anchor grid
@param adjustments: Batch of adjustments of the prediction (#data, 4)
@param groundtruths: Batch of ground truth data given as (x1, y1, x2, y2) (#data, 4)
"""
raise NotImplementedError()
def apply_bbr(anchor_box: np.ndarray, adjustment: torch.Tensor) -> AnnotationRect:
"""Calculates an AnnotationRect based on a given anchor box and adjustments
@param anchor_box: Single box coordinates from the anchor grid
@param adjustment: Adjustments, generated by the model
"""
raise NotImplementedError()