{"id":19747074,"url":"https://github.com/escorciav/roi_pooling","last_synced_at":"2025-06-13T06:08:10.034Z","repository":{"id":67374671,"uuid":"122442525","full_name":"escorciav/roi_pooling","owner":"escorciav","description":"ROIPooling for pytorch","archived":false,"fork":false,"pushed_at":"2019-04-08T12:36:31.000Z","size":13,"stargazers_count":51,"open_issues_count":2,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-13T06:07:29.015Z","etag":null,"topics":["conda-environment","cupy","python37","pytorch","roipooling"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/escorciav.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-02-22T07:02:00.000Z","updated_at":"2024-10-08T03:26:03.000Z","dependencies_parsed_at":"2023-02-21T03:00:55.303Z","dependency_job_id":null,"html_url":"https://github.com/escorciav/roi_pooling","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/escorciav/roi_pooling","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escorciav%2Froi_pooling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escorciav%2Froi_pooling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escorciav%2Froi_pooling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escorciav%2Froi_pooling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/escorciav","download_url":"https://codeload.github.com/escorciav/roi_pooling/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escorciav%2Froi_pooling/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259592261,"owners_count":22881267,"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":["conda-environment","cupy","python37","pytorch","roipooling"],"created_at":"2024-11-12T02:16:49.292Z","updated_at":"2025-06-13T06:08:10.012Z","avatar_url":"https://github.com/escorciav.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pytorch ROIPooling\n\nWelcome!\n\nThis is a generic implementation of ROIpooling operation used in the context of object detection.\n\n## Feats\n\n- Modularized\n\n- JIT compilation with cupy\n\n- Works well with batches of images :wink:\n\n## Getting started\n\nWe need the following requirements `cuda`, `pytorch==1.0.1`, `cupy=5.1.0` which we can get most of them from [anaconda.org](http://anaconda.org/) with trusted channels.\n\n1. Install anaconda or miniconda.\n\n    \u003e Skip this if you already have miniconda or anaconda installed in your system.\n\n1. Create a new environment\n\n    `conda create -n pytorch-extensions python=3.7 pytorch cupy -c pytorch`\n\n    \u003e This step creates a conda environment called `pytorch-extensions`. In case, you change the name keep it mind to update the next lines accordingly.\n\n1. `conda activate pytorch-extensions`\n\n1. `python example.py`\n\n    Hopefully everything runs like the breeze.\n\n### Can I use it in Colab?\n\nSure, take a look at this [notebook](https://colab.research.google.com/drive/1zoZKhWynAwnXJAWGTfOiU2-kbc4FH2EM). It provides a guide for the setup and usage of the `roi_pooling` `Function`.\n\n## LICENSE\n\n[MIT](https://choosealicense.com/licenses/mit/)\n\nWe highly appreciate that you leave attribution notes when you copy portions of this codebase in yours.\n\n### Did you like it?\n\nSupport me, gimme a :star: in the github banner or invite me a :coffee:/:beer:. If you are in academia, I would appreciate that you cite my research:\n\n```\n@article{EscorciaDJGS18,\n  author    = {Victor Escorcia and\n               Cuong Duc Dao and\n               Mihir Jain and\n               Bernard Ghanem and\n               Cees Snoek},\n  title     = {Guess Where? Actor-Supervision for Spatiotemporal Action Localization},\n  journal   = {CoRR},\n  volume    = {abs/1804.01824},\n  year      = {2018},\n  url       = {http://arxiv.org/abs/1804.01824},\n  archivePrefix = {arXiv},\n  eprint    = {1804.01824}\n}\n```\n\nThis implementation was built on top of the legendary Faster-RCNN which you _must_ cite:\n\n```\n@article{RenHG017,\n  author    = {Shaoqing Ren and\n               Kaiming He and\n               Ross B. Girshick and\n               Jian Sun},\n  title     = {Faster {R-CNN:} Towards Real-Time Object Detection with Region Proposal\n               Networks},\n  journal   = {{IEEE} Trans. Pattern Anal. Mach. Intell.},\n  volume    = {39},\n  number    = {6},\n  pages     = {1137--1149},\n  year      = {2017},\n  url       = {https://doi.org/10.1109/TPAMI.2016.2577031},\n  doi       = {10.1109/TPAMI.2016.2577031}\n}\n```\n\nThis was also possible due to [Chainer](https://chainer.org/), and the easy to follow [pyinn](https://github.com/szagoruyko/pyinn).\n\n## FAQs\n\n### Do I need to buy an anaconda license?\n\nOf course not! You do everything with virtual environments. Indeed, I would be pleased to accept a PR with a recipe for virtual environments.\n\n_Why anaconda?_\n\nIn short, due to the last five letters.\n\n### Why another ROIpooling operation?\n\nWell, I tried many C extensions mainly taken from this [repo](https://github.com/longcw/faster_rcnn_pytorch) but those did not fit my purpose of ROIPooling over batches of images.\n\n_Why?_\n\nYou can clearly see [here](https://github.com/longcw/faster_rcnn_pytorch/blob/master/faster_rcnn/roi_pooling/src/roi_pooling_cuda.c#L27-L30) that when the batch size is greater than 1, the output is zero.\n\n_Does that mean that they are useless?_\n\nOf course not! I noticed that FastRCNN uses a batch size of 1. Probably, they did not mind to make it more general implementation.\n\n_Why didn't you remove the conditional?_\n\nI tried in one of the repos but it fails. I even removed all the binaries and compiled again but it still returned zeros. Thus, I just moved on and pursue my personal reason:\n\nI was really curious of launching cupy kernels using data from pytorch tensors. It is simply amazing. Moreover, it was a great experience to explore CUDA and pytorch.autograd.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fescorciav%2Froi_pooling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fescorciav%2Froi_pooling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fescorciav%2Froi_pooling/lists"}