Lecture 03 学习讲义
正文
工具
按问题查找
Lecture 03LAB 09 · 检测几何:框、匹配、NMS 与 AP · 实现代码

LAB 09 · 检测几何:框、匹配、NMS 与 AP · 实现代码

独立阅读

并入相关学习路径

固定框匹配、PR/AP、NMS误删相邻对象反例

展开完整实现代码
from pathlib import Path
from datetime import datetime, timezone
import hashlib
import json
import platform
import time
from html import escape
import numpy as np

STARTED_AT = datetime.now(timezone.utc).isoformat()
STARTED_CLOCK = time.perf_counter()
OUT = Path(__file__).resolve().parent if "__file__" in globals() else Path.cwd()
OUT.mkdir(parents=True, exist_ok=True)
NMS_THRESHOLD = 0.50
EVAL_THRESHOLDS = (0.50, 0.75)

GT = np.array([[0, 0, 2, 2], [3, 0, 5, 2]], dtype=float)
PRED = np.array([[0, 0, 2, 2], [.2, 0, 2.2, 2], [3.4, 0, 5.4, 2], [7, 7, 8, 8]], float)
SCORES = np.array([.9, .8, .7, .4])
CLASSES = np.zeros(4, dtype=int)