{"id":19243205,"url":"https://github.com/acecoooool/roialign-roipool-pytorch","last_synced_at":"2025-04-21T09:32:48.243Z","repository":{"id":201399373,"uuid":"130175744","full_name":"AceCoooool/RoIAlign-RoIPool-pytorch","owner":"AceCoooool","description":"C++ extension implementation of RoIAlign \u0026 RolPool (both GPU and CPU) for PyTorch","archived":false,"fork":false,"pushed_at":"2018-11-24T12:25:08.000Z","size":88,"stargazers_count":71,"open_issues_count":7,"forks_count":15,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-01T12:04:10.443Z","etag":null,"topics":["cpu","gpu","object-detection","pytorch","roialign","roipooling"],"latest_commit_sha":null,"homepage":"","language":"C++","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/AceCoooool.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}},"created_at":"2018-04-19T07:27:56.000Z","updated_at":"2024-05-17T09:28:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"2438374a-a0f6-4e92-b8a5-79a7d69ede1a","html_url":"https://github.com/AceCoooool/RoIAlign-RoIPool-pytorch","commit_stats":null,"previous_names":["acecoooool/roialign-roipool-pytorch"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AceCoooool%2FRoIAlign-RoIPool-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AceCoooool%2FRoIAlign-RoIPool-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AceCoooool%2FRoIAlign-RoIPool-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AceCoooool%2FRoIAlign-RoIPool-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AceCoooool","download_url":"https://codeload.github.com/AceCoooool/RoIAlign-RoIPool-pytorch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250032236,"owners_count":21363800,"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":["cpu","gpu","object-detection","pytorch","roialign","roipooling"],"created_at":"2024-11-09T17:17:00.082Z","updated_at":"2025-04-21T09:32:47.693Z","avatar_url":"https://github.com/AceCoooool.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RoI-op-pytorch\nC++ extension of RoIPool \u0026 RoIAlign (both CPU and GPU) in PyTorch，this code is converted from [caffe2](https://github.com/pytorch/pytorch/tree/master/caffe2/operators) operation. （need pytorch 0.4.0）\n\n**Warning：**You may change `AT_CHECK` to `AT_ASSERT`（0.4 version using `AT_ASSERT`， and latest version using `AT_CHECK`）\n\n**Note: **\n\n1. `roi_xxx_cpu.cpp`\u0026`roi_xxx_binding.cpp`：contains the cpu version of forward and backward operation.(Note: `roi_xxx_binding.cpp` is for pybind, you can put this code into `roi_xxx_cpu.cpp` as well) \n2. `roi_xxx_kernel.cu`\u0026`roi_xxx_cuda.cpp`：contains the cuda version of forward and backward operation.\n3. `main.py`\u0026`temp.h`\u0026`CMakeLists.txt`：help you to debug in c++ code, rather than to run `python setup.py install` to debug. (Note: only support cpu version ~ I don't know how to debug `.cu` code :persevere:)\n4. `setup.py`：you can run `python setup.py install` to install this operation as a package (You can find this package in you python site-package)\n5. `roi_xxx.py`：wrap `.cpp` code to pytorch's `Function \u0026 Module` ，there is also a small demo testing.\n\n**Install**\n\n```shell\ncd roixxx   # roipool or roialign\npython setup.py install\n```\n\n## RoI Pooling\n\nThe \"strategy\" of roi-pooling in this implementaion likes the follow picture:（:joy: so bad picture）\n\n![oi_poo](png/roi_pool.png)\n\nNote:  (please stand on point view rather than block view)\n\n1. scale=0.5  \n2. dotted line is the range of \"seleted area\" (int form in `[left, right)` and `[top, bottom)`)\n\n## RoI Align\n\n![oialig](png/roialign.png)\n\nNote: left `sample=1`, `right sample=2`\n\n\n\nThere are several good resource to explain these two operations:\n\n- [Region of interest pooling explained](https://blog.deepsense.ai/region-of-interest-pooling-explained/)\n- [ROI Align --- chinese](http://blog.leanote.com/post/afanti.deng@gmail.com/b5f4f526490b)\n- [ROI Align --- youtube](https://www.youtube.com/watch?v=XGi-Mz3do2s)\n\n### Reference\n\n1. [caffe2 operator](https://github.com/pytorch/pytorch/tree/a2a28c0ef1d9a433972fe72fa5b0b9b850ccfcaf/caffe2/operators)：most of the code is coming from here.\n2. [extension-cpp: tutorial](https://github.com/pytorch/extension-cpp)\n3. [detectorch](https://github.com/ignacio-rocco/detectorch)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facecoooool%2Froialign-roipool-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facecoooool%2Froialign-roipool-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facecoooool%2Froialign-roipool-pytorch/lists"}