{"id":15645929,"url":"https://github.com/skalskip/sketchy-vision","last_synced_at":"2025-04-14T03:14:21.928Z","repository":{"id":138777261,"uuid":"611713675","full_name":"SkalskiP/sketchy-vision","owner":"SkalskiP","description":"Each week I create sketches covering key Computer Vision concepts. If you want to learn more about CV stick around!","archived":false,"fork":false,"pushed_at":"2023-03-13T10:17:57.000Z","size":5,"stargazers_count":148,"open_issues_count":0,"forks_count":4,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-14T03:14:06.618Z","etag":null,"topics":["computer-vision","convolutional-neural-networks","deep-learning","neural-network","non-maximum-suppression","numpy","object-detection"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SkalskiP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-09T11:51:34.000Z","updated_at":"2025-04-03T14:44:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"d3781c7f-7df5-47a8-a830-6f6cf48bb224","html_url":"https://github.com/SkalskiP/sketchy-vision","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"907a0b97d7f61cd6a956a5b918a5f268b172129b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SkalskiP%2Fsketchy-vision","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SkalskiP%2Fsketchy-vision/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SkalskiP%2Fsketchy-vision/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SkalskiP%2Fsketchy-vision/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SkalskiP","download_url":"https://codeload.github.com/SkalskiP/sketchy-vision/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248813802,"owners_count":21165634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","convolutional-neural-networks","deep-learning","neural-network","non-maximum-suppression","numpy","object-detection"],"created_at":"2024-10-03T12:10:37.101Z","updated_at":"2025-04-14T03:14:21.894Z","avatar_url":"https://github.com/SkalskiP.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003esketchy vision\u003c/h1\u003e\n\n\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://github.com/SkalskiP\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/SkalskiP/SkalskiP/master/icons/github.png\" width=\"4%\"/\u003e\n    \u003c/a\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/SkalskiP/SkalskiP/master/icons/transparent.png\" width=\"3%\"/\u003e\n    \u003ca href=\"https://twitter.com/skalskip92\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/SkalskiP/SkalskiP/master/icons/twitter.png\" width=\"4%\"/\u003e\n    \u003c/a\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/SkalskiP/SkalskiP/master/icons/transparent.png\" width=\"3%\"/\u003e\n    \u003ca href=\"https://linkedin.com/in/piotr-skalski-36b5b4122\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/SkalskiP/SkalskiP/master/icons/linkedin.png\" width=\"4%\"/\u003e\n    \u003c/a\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/SkalskiP/SkalskiP/master/icons/transparent.png\" width=\"3%\"/\u003e\n    \u003ca href=\"https://kaggle.com/skalskip\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/SkalskiP/SkalskiP/master/icons/kaggle.png\" width=\"4%\"/\u003e\n    \u003c/a\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/SkalskiP/SkalskiP/master/icons/transparent.png\" width=\"3%\"/\u003e\n    \u003ca href=\"https://skalskip.medium.com/\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/SkalskiP/SkalskiP/master/icons/medium.png\" width=\"4%\" /\u003e\n    \u003c/a\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/SkalskiP/SkalskiP/master/icons/transparent.png\" width=\"3%\"/\u003e\n    \u003ca href=\"https://youtu.be/AWjKfjDGiYE\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/SkalskiP/SkalskiP/master/icons/youtube.png\" width=\"4%\" /\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n## 👋 hello\n\nEach week I create sketches covering key Computer Vision concepts. If you want to learn more about CV stick around!\n\n\u003cbr\u003e\n\n![title](https://i.imgur.com/gbhmVy9.png)\n\n\u003cdetails close\u003e\n\u003csummary\u003e👆 click to read code snippet\u003c/summary\u003e\n\n```python\ndef box_iou_batch(boxes_a: np.ndarray, boxes_b: np.ndarray) -\u003e np.ndarray:\n\n    def box_area(box):\n        return (box[2] - box[0]) * (box[3] - box[1])\n\n    area_a = box_area(boxes_a.T)\n    area_b = box_area(boxes_b.T)\n\n    top_left = np.maximum(boxes_a[:, None, :2], boxes_b[:, :2])\n    bottom_right = np.minimum(boxes_a[:, None, 2:], boxes_b[:, 2:])\n\n    area_inter = np.prod(np.clip(bottom_right - top_left, a_min=0, a_max=None), 2)\n    return area_inter / (area_a[:, None] + area_b - area_inter)\n```\n\n\u003c/details\u003e\n\n![title](https://i.imgur.com/o4CELyL.jpg)\n\n\u003cdetails close\u003e\n\u003csummary\u003e👆 click to read code snippet\u003c/summary\u003e\n\n```python\ndef non_max_suppression(predictions: np.ndarray, iou_threshold: float = 0.5) -\u003e np.ndarray:\n    rows, columns = predictions.shape\n\n    sort_index = np.flip(predictions[:, 4].argsort())\n    predictions = predictions[sort_index]\n\n    boxes = predictions[:, :4]\n    categories = predictions[:, 5]\n    ious = box_iou_batch(boxes, boxes)\n    ious = ious - np.eye(rows)\n\n    keep = np.ones(rows, dtype=bool)\n\n    for index, (iou, category) in enumerate(zip(ious, categories)):\n        if not keep[index]:\n            continue\n\n        condition = (iou \u003e iou_threshold) \u0026 (categories == category)\n        keep = keep \u0026 ~condition\n\n    return keep[sort_index.argsort()]\n```\n\n\u003c/details\u003e\n\n![title](https://i.imgur.com/Ixiv5do.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskalskip%2Fsketchy-vision","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskalskip%2Fsketchy-vision","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskalskip%2Fsketchy-vision/lists"}