{"version":2,"relationshipURLBase":"https://codingai-lec03.pages.dev/course/notebook-blocks/6694e8372194400db0397906978305bf.html","relationshipResolution":"Resolve relative relationship URLs against relationshipURLBase; complete records and absolute URLs are in blocks.","title":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/6694e8372194400db0397906978305bf.html","markdown":"https://codingai-lec03.pages.dev/course/notebook-blocks/6694e8372194400db0397906978305bf.md","pages":[{"id":"reading-opening","title":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码","unit":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码","unitId":"notebook-blocks/6694e8372194400db0397906978305bf","chapter":"course","number":1}],"aliases":[{"oldId":"b-805b4e51e671af5bea9bef02","targetId":"b-805b4e51e671af5bea9bef02","page":"reading-opening","operation":"move","beforeSHA256":"9027342eb8430f11699811edb871aeb2e37b28e9f874a2aa48778e6bac2818b7","afterSHA256":"9027342eb8430f11699811edb871aeb2e37b28e9f874a2aa48778e6bac2818b7","reason":"Same source body in authored semantic page"},{"oldId":"b-d3ebd038f0a1adf03bea7614","targetId":"b-d3ebd038f0a1adf03bea7614","page":"reading-opening","operation":"move","beforeSHA256":"b1da5be88afbe4a8cfd83ece0daa600af4dcd2dcafcf3a7a4ca04cdee54ef205","afterSHA256":"b1da5be88afbe4a8cfd83ece0daa600af4dcd2dcafcf3a7a4ca04cdee54ef205","reason":"Same source body in authored semantic page"},{"oldId":"b-0218ce7eb431703bd7692e33","targetId":"b-0218ce7eb431703bd7692e33","page":"reading-opening","operation":"move","beforeSHA256":"dc06c1e728a4b5740ba634b145bc9a1da6323031626734cb4555db5a744df806","afterSHA256":"dc06c1e728a4b5740ba634b145bc9a1da6323031626734cb4555db5a744df806","reason":"Same source body in authored semantic page"},{"oldId":"b-92985879fc17b875ce8fd9bb","targetId":"b-92985879fc17b875ce8fd9bb","page":"reading-opening","operation":"move","beforeSHA256":"4e0de6d032a3765c60907de32f28cd988b659299663e842d319bdb0426243d78","afterSHA256":"4e0de6d032a3765c60907de32f28cd988b659299663e842d319bdb0426243d78","reason":"Same source body in authored semantic page"},{"oldId":"b-a0eb0898c05f1ee233bcdded","targetId":"b-a0eb0898c05f1ee233bcdded","page":"reading-opening","operation":"move","beforeSHA256":"343c55023905db6d14465285570aee76e293e598d8f7c7336ce93561c05ae916","afterSHA256":"343c55023905db6d14465285570aee76e293e598d8f7c7336ce93561c05ae916","reason":"Same source body in authored semantic page"}],"blocks":[{"id":"b-805b4e51e671af5bea9bef02","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/6694e8372194400db0397906978305bf.html#b-805b4e51e671af5bea9bef02","content":"[LAB 09 · 检测几何：框、匹配、NMS 与 AP](/course/notebooks/90d213b4e1e04c7e889ee6fc042b2358.html)","sha256":"9027342eb8430f11699811edb871aeb2e37b28e9f874a2aa48778e6bac2818b7","chapter":{"id":"course","title":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码"},"unit":{"id":"notebook-blocks/6694e8372194400db0397906978305bf","title":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码"},"page":{"id":"reading-opening","title":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码","number":1},"sectionTitle":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码","currentQuestion":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":null,"nextBlock":"b-d3ebd038f0a1adf03bea7614","prerequisites":[],"relatedBlocks":[]},{"id":"b-d3ebd038f0a1adf03bea7614","type":"h1","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/6694e8372194400db0397906978305bf.html#b-d3ebd038f0a1adf03bea7614","content":"# 1 · 坐标先说清：连续 xyxy，不加一 · 实现代码","sha256":"b1da5be88afbe4a8cfd83ece0daa600af4dcd2dcafcf3a7a4ca04cdee54ef205","chapter":{"id":"course","title":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码"},"unit":{"id":"notebook-blocks/6694e8372194400db0397906978305bf","title":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码"},"page":{"id":"reading-opening","title":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码","number":1},"sectionTitle":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码","currentQuestion":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-805b4e51e671af5bea9bef02","nextBlock":"b-0218ce7eb431703bd7692e33","prerequisites":[{"id":"b-805b4e51e671af5bea9bef02","url":"#b-805b4e51e671af5bea9bef02","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-0218ce7eb431703bd7692e33","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/6694e8372194400db0397906978305bf.html#b-0218ce7eb431703bd7692e33","content":"并入相关学习路径","sha256":"dc06c1e728a4b5740ba634b145bc9a1da6323031626734cb4555db5a744df806","chapter":{"id":"course","title":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码"},"unit":{"id":"notebook-blocks/6694e8372194400db0397906978305bf","title":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码"},"page":{"id":"reading-opening","title":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码","number":1},"sectionTitle":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码","currentQuestion":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-d3ebd038f0a1adf03bea7614","nextBlock":"b-92985879fc17b875ce8fd9bb","prerequisites":[{"id":"b-d3ebd038f0a1adf03bea7614","url":"#b-d3ebd038f0a1adf03bea7614","role":"section-title"},{"id":"b-805b4e51e671af5bea9bef02","url":"#b-805b4e51e671af5bea9bef02","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-92985879fc17b875ce8fd9bb","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/6694e8372194400db0397906978305bf.html#b-92985879fc17b875ce8fd9bb","content":"固定框匹配、PR/AP、NMS误删相邻对象反例","sha256":"4e0de6d032a3765c60907de32f28cd988b659299663e842d319bdb0426243d78","chapter":{"id":"course","title":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码"},"unit":{"id":"notebook-blocks/6694e8372194400db0397906978305bf","title":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码"},"page":{"id":"reading-opening","title":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码","number":1},"sectionTitle":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码","currentQuestion":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-0218ce7eb431703bd7692e33","nextBlock":"b-a0eb0898c05f1ee233bcdded","prerequisites":[{"id":"b-d3ebd038f0a1adf03bea7614","url":"#b-d3ebd038f0a1adf03bea7614","role":"section-title"},{"id":"b-805b4e51e671af5bea9bef02","url":"#b-805b4e51e671af5bea9bef02","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-a0eb0898c05f1ee233bcdded","type":"pre","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/6694e8372194400db0397906978305bf.html#b-a0eb0898c05f1ee233bcdded","content":"```\ndef boxes_xyxy(values):\n    \"\"\"Validate an (N,4) array of continuous-coordinate boxes.\"\"\"\n    boxes = np.asarray(values, dtype=float).reshape(-1, 4)\n    if not np.isfinite(boxes).all():\n        raise ValueError(\"Box coordinates must be finite\")\n    if np.any(boxes[:, 2:] < boxes[:, :2]):\n        raise ValueError(\"Require x2 >= x1 and y2 >= y1\")\n    return boxes\n\n\ndef box_iou(boxes_a, boxes_b):\n    \"\"\"Return (N,M) IoUs. A zero-area union is defined to have IoU 0.\"\"\"\n    a, b = boxes_xyxy(boxes_a), boxes_xyxy(boxes_b)\n    intersection_size = np.maximum(\n        0.0, np.minimum(a[:, None, 2:], b[None, :, 2:])\n        - np.maximum(a[:, None, :2], b[None, :, :2])\n    )\n    intersection = intersection_size.prod(axis=2)\n    area_a = (a[:, 2:] - a[:, :2]).prod(axis=1)\n    area_b = (b[:, 2:] - b[:, :2]).prod(axis=1)\n    union = area_a[:, None] + area_b[None, :] - intersection\n    return np.divide(intersection, union, out=np.zeros_like(union), where=union > 0)\n\nprint(\"IoU shape:\", box_iou(PRED, GT).shape)\nprint(box_iou(PRED, GT))\n```","sha256":"343c55023905db6d14465285570aee76e293e598d8f7c7336ce93561c05ae916","chapter":{"id":"course","title":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码"},"unit":{"id":"notebook-blocks/6694e8372194400db0397906978305bf","title":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码"},"page":{"id":"reading-opening","title":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码","number":1},"sectionTitle":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码","currentQuestion":"1 · 坐标先说清：连续 xyxy，不加一 · 实现代码","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-92985879fc17b875ce8fd9bb","nextBlock":null,"prerequisites":[{"id":"b-d3ebd038f0a1adf03bea7614","url":"#b-d3ebd038f0a1adf03bea7614","role":"section-title"},{"id":"b-805b4e51e671af5bea9bef02","url":"#b-805b4e51e671af5bea9bef02","role":"problem-context"}],"relatedBlocks":[]}]}
