{"id":13546214,"url":"https://github.com/mitmul/chainer-faster-rcnn","last_synced_at":"2025-06-21T01:33:46.060Z","repository":{"id":141384810,"uuid":"49789179","full_name":"mitmul/chainer-faster-rcnn","owner":"mitmul","description":"Object Detection with Faster R-CNN in Chainer","archived":false,"fork":false,"pushed_at":"2017-07-08T01:35:21.000Z","size":152,"stargazers_count":287,"open_issues_count":6,"forks_count":85,"subscribers_count":23,"default_branch":"v2","last_synced_at":"2025-05-20T06:06:38.365Z","etag":null,"topics":["chainer"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitmul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-01-16T20:12:12.000Z","updated_at":"2025-01-16T10:26:38.000Z","dependencies_parsed_at":"2024-01-21T06:08:02.821Z","dependency_job_id":"147b429d-7afa-4ffd-8009-2f9ec2cea02d","html_url":"https://github.com/mitmul/chainer-faster-rcnn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mitmul/chainer-faster-rcnn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmul%2Fchainer-faster-rcnn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmul%2Fchainer-faster-rcnn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmul%2Fchainer-faster-rcnn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmul%2Fchainer-faster-rcnn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitmul","download_url":"https://codeload.github.com/mitmul/chainer-faster-rcnn/tar.gz/refs/heads/v2","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmul%2Fchainer-faster-rcnn/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261046487,"owners_count":23102279,"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":["chainer"],"created_at":"2024-08-01T12:00:34.094Z","updated_at":"2025-06-21T01:33:41.048Z","avatar_url":"https://github.com/mitmul.png","language":"Python","funding_links":[],"categories":["Preferred Networks Research","Python","Machine Learning"],"sub_categories":["Computer Vision"],"readme":"# Faster R-CNN\n\n# **This repo has been deprecated. [Here](https://github.com/pfnet/chainercv) is the complete codes for training Faster-RCNN on your data and using the pre-trained Faster-RCNN model for new data: [ChainerCV](https://github.com/pfnet/chainercv)**\n\nThis is an experimental implementation of Faster R-CNN in Chainer based on Ross Girshick's work: [py-faster-rcnn codes](https://github.com/rbgirshick/py-faster-rcnn).\n\n## Requirement\n\nUsing anaconda is strongly recommended.\n\n- Python 2.7.6+, 3.4.3+, 3.5.1+\n\n  - [Chainer](https://github.com/pfnet/chainer) 1.22.0+\n  - NumPy 1.9, 1.10, 1.11\n  - Cython 0.25+\n  - OpenCV 2.9+, 3.1+\n\n### Installation of dependencies\n\n```\npip install numpy\npip install cython\npip install chainer\npip install chainercv\n# for python3\nconda install -c https://conda.binstar.org/menpo opencv3\n# for python2\nconda install opencv\n```\n\n### For Windows users\n\nThere's a known problem in cpu_nms.pyx. But a workaround has been posted [here](https://github.com/mitmul/chainer-faster-rcnn/issues/1) (and see also [the issue posted to the original py-faster-rcnn](https://github.com/rbgirshick/py-faster-rcnn/issues/36)).\n\n## Setup\n\n### 1\\. Build extensions\n\n```\npython setup.py build_ext -i\n```\n\n## Inference\n\n### 1\\. Download pre-trained model\n\n```\nif [ ! -d data ]; then mkdir data; fi\ncurl https://dl.dropboxusercontent.com/u/2498135/faster-rcnn/VGG16_faster_rcnn_final.model?dl=1 -o data/VGG16_faster_rcnn_final.model\n```\n\n**NOTE:** The model definition in `faster_rcnn.py` has been changed, so if you already have the older pre-trained model file, please download it again to replace the older one with the new one.\n\n### 2\\. Use forward.py\n\n```\ncurl -O http://vision.cs.utexas.edu/voc/VOC2007_test/JPEGImages/004545.jpg\npython forward.py --img_fn 004545.jpg --gpu 0\n```\n\n`--gpu 0` turns on GPU. When you turn off GPU, use `--gpu -1` or remove `--gpu` option.\n\n![](https://raw.githubusercontent.com/wiki/mitmul/chainer-faster-rcnn/images/result.png)\n\n#### Layers\n\nSummarization of Faster R-CNN layers used during inference\n\n##### RPN\n\nThe region proposal layer (RPN) is consisted of `AnchorTargetLayer` and `ProposalLayer`. RPN takes feature maps from trunk network like VGG-16, and performs 3x3 convolution to it. Then, it applies two independent 1x1 convolutions to the output of the first 3x3 convolution. Resulting outputs are `rpn_cls_score` and `rpn_bbox_pred`.\n\n- The shape of `rpn_cls_score` is `(N, 2 * n_anchors, 14, 14)` because each pixel on the feature map has `n_anchors` bboxes and each bbox should have 2 values that mean object/background.\n- The shape of `rpn_bbox_pred` is `(N, 4 * n_anchors, 14, 14)` because each pixel on the feature map has `n_anchors` bboxes, and each bbox is represented with 4 values that mean left top `x` and `y`, `width` and `height`.\n\n## Training\n\n### 1\\. Make sure `chainercv` has been installed\n\n[ChainerCV](https://github.com/pfnet/chainercv) is a utility library enables Chainer to treat various datasets easily. It also provides some transformation utility for data augmentation, and includes some standard algorithms for some comptuer vision tasks. Check the repo to know details. Here I use (`VOCDetectionDataset`)[http://chainercv.readthedocs.io/en/latest/reference/datasets.html#vocdetectiondataset] of ChainerCV. Anyway, before starting training of FasterRCNN, please install ChainerCV via pip.\n\n```\npip install chainercv\n```\n\n### 2\\. Start training\n\n```\npython train_rpn.py\n```\n\n## Faster R-CNN Architecture\n\n**Note that it is a visualization of the workflow DURING INFERENCE**\n\n![](https://raw.githubusercontent.com/wiki/mitmul/chainer-faster-rcnn/images/Faster%20R-CNN.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitmul%2Fchainer-faster-rcnn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitmul%2Fchainer-faster-rcnn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitmul%2Fchainer-faster-rcnn/lists"}