{"id":21258091,"url":"https://github.com/charlesshang/tffrcnn","last_synced_at":"2025-04-04T06:09:50.934Z","repository":{"id":63353262,"uuid":"71331311","full_name":"CharlesShang/TFFRCNN","owner":"CharlesShang","description":"FastER RCNN built on tensorflow","archived":false,"fork":false,"pushed_at":"2018-06-07T07:45:18.000Z","size":3950,"stargazers_count":875,"open_issues_count":102,"forks_count":416,"subscribers_count":51,"default_branch":"master","last_synced_at":"2025-03-28T05:13:49.783Z","etag":null,"topics":["detection","faster-rcnn","pedestrian","pvanet","rcnn","tensorflow"],"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/CharlesShang.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}},"created_at":"2016-10-19T07:38:26.000Z","updated_at":"2025-01-05T10:23:14.000Z","dependencies_parsed_at":"2022-11-17T13:00:15.959Z","dependency_job_id":null,"html_url":"https://github.com/CharlesShang/TFFRCNN","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CharlesShang%2FTFFRCNN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CharlesShang%2FTFFRCNN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CharlesShang%2FTFFRCNN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CharlesShang%2FTFFRCNN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CharlesShang","download_url":"https://codeload.github.com/CharlesShang/TFFRCNN/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247128753,"owners_count":20888235,"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":["detection","faster-rcnn","pedestrian","pvanet","rcnn","tensorflow"],"created_at":"2024-11-21T04:07:11.044Z","updated_at":"2025-04-04T06:09:50.911Z","avatar_url":"https://github.com/CharlesShang.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TFFRCNN\n\nThis is an experimental **T**ensor **F**low implementation of **F**aster **RCNN** (**TFFRCNN**), mainly based on the work of [smallcorgi](https://github.com/smallcorgi/Faster-RCNN_TF) and [rbgirshick](https://github.com/rbgirshick/py-faster-rcnn). I have re-organized the libraries under `lib` path, making each of python modules independent to each other, so you can understand, re-write the code easily.\n\nFor details about R-CNN please refer to the paper [Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks](http://arxiv.org/pdf/1506.01497v3.pdf) by Shaoqing Ren, Kaiming He, Ross Girshick, Jian Sun.\n\n### What's New\n\n- [x] Resnet networks support\n- [x] KITTI object detection dataset support\n- [x] **P**osition **S**ensitive **ROI Pooling** (psroi_pooling), not testing yet\n- [x] Hard Example Mining\n- [x] Data Augment\n- [x] PVANet\n- [x] Tensorflow 1.0\n- [ ] R-FCN\n- [ ] Multi-layer Architecture (HyperNet)\n- [ ] more hacks...\n\n### Acknowledgments: \n\n1. [py-faster-rcnn](https://github.com/rbgirshick/py-faster-rcnn)\n\n2. [Faster-RCNN_TF](https://github.com/smallcorgi/Faster-RCNN_TF)\n\n3. [ROI pooling](https://github.com/zplizzi/tensorflow-fast-rcnn)\n\n### Requirements: software\n\n1. Requirements for Tensorflow (see: [Tensorflow](https://www.tensorflow.org/))\n\n2. Python packages you might not have: `cython`, `python-opencv`, `easydict` (recommend to install: [Anaconda](https://www.continuum.io/downloads))\n\n### Requirements: hardware\n\n1. For training the end-to-end version of Faster R-CNN with VGG16, 3G of GPU memory is sufficient (using CUDNN)\n\n### Installation (sufficient for the demo)\n\n1. Clone the Faster R-CNN repository\n  ```Shell\n  git clone https://github.com/CharlesShang/TFFRCNN.git\n  ```\n\n2. Build the Cython modules\n    ```Shell\n    cd TFFRCNN/lib\n    make # compile cython and roi_pooling_op, you may need to modify make.sh for your platform\n    ```\n\n### Demo\n\n*After successfully completing [basic installation](#installation-sufficient-for-the-demo)*, you'll be ready to run the demo.\n\nTo run the demo\n```Shell\ncd $TFFRCNN\npython ./faster_rcnn/demo.py --model model_path\n```\nThe demo performs detection using a VGG16 network trained for detection on PASCAL VOC 2007.\n\n### Download list\n\n1. [VGG16 trained on ImageNet](https://drive.google.com/open?id=0ByuDEGFYmWsbNVF5eExySUtMZmM)\n\n2. [VGG16 - TFFRCNN (0.689 mAP on VOC07)](https://drive.google.com/file/d/0B_xFdh9onPagX0JWRlR0cTZ5OGc/view?usp=sharing).\n\n3. [VGG16 - TFFRCNN (0.748 mAP on VOC07)](https://drive.google.com/file/d/0B_xFdh9onPagVmt5VHlCU25vUEE/view?usp=sharing)\n\n4. [Resnet50 trained on ImageNet](https://drive.google.com/file/d/0B_xFdh9onPagSWU1ZTAxUTZkZTQ/view?usp=sharing)\n\n5. [Resnet50 - TFFRCNN (0.712 mAP on VOC07)](https://drive.google.com/file/d/0B_xFdh9onPagbXk1b0FIeDRJaU0/view?usp=sharing)\n\n6. [PVANet trained on ImageNet, converted from caffemodel](https://drive.google.com/open?id=0B_xFdh9onPagQnJBdWl3VGQxam8)\n\n### Training on Pascal VOC 2007\n\n1. Download the training, validation, test data and VOCdevkit\n\n    ```Shell\n    wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar\n    wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtest_06-Nov-2007.tar\n    wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCdevkit_08-Jun-2007.tar\n    ```\n\n2. Extract all of these tars into one directory named `VOCdevkit`\n\n    ```Shell\n    tar xvf VOCtrainval_06-Nov-2007.tar\n    tar xvf VOCtest_06-Nov-2007.tar\n    tar xvf VOCdevkit_08-Jun-2007.tar\n    ```\n\n3. It should have this basic structure\n\n    ```Shell\n    $VOCdevkit/                           # development kit\n    $VOCdevkit/VOCcode/                   # VOC utility code\n    $VOCdevkit/VOC2007                    # image sets, annotations, etc.\n    # ... and several other directories ...\n    ```\n\n4. Create symlinks for the PASCAL VOC dataset\n\n    ```Shell\n    cd $TFFRCNN/data\n    ln -s $VOCdevkit VOCdevkit2007\n    ```\n\n5. Download pre-trained model [VGG16](https://drive.google.com/open?id=0ByuDEGFYmWsbNVF5eExySUtMZmM) and put it in the path `./data/pretrain_model/VGG_imagenet.npy`\n\n6. Run training scripts \n\n    ```Shell\n    cd $TFFRCNN\n    python ./faster_rcnn/train_net.py --gpu 0 --weights ./data/pretrain_model/VGG_imagenet.npy --imdb voc_2007_trainval --iters 70000 --cfg  ./experiments/cfgs/faster_rcnn_end2end.yml --network VGGnet_train --set EXP_DIR exp_dir\n    ```\n\n7. Run a profiling\n\n    ```Shell\n    cd $TFFRCNN\n    # install a visualization tool\n    sudo apt-get install graphviz  \n    ./experiments/profiling/run_profiling.sh \n    # generate an image ./experiments/profiling/profile.png\n    ```\n\n### Training on KITTI detection dataset\n\n1. Download the KITTI detection dataset\n\n    ```\n    http://www.cvlibs.net/datasets/kitti/eval_object.php\n    ```\n\n2. Extract all of these tar into `./TFFRCNN/data/` and the directory structure looks like this:\n    \n    ```\n    KITTI\n        |-- training\n                |-- image_2\n                    |-- [000000-007480].png\n                |-- label_2\n                    |-- [000000-007480].txt\n        |-- testing\n                |-- image_2\n                    |-- [000000-007517].png\n                |-- label_2\n                    |-- [000000-007517].txt\n    ```\n\n3. Convert KITTI into Pascal VOC format\n    \n    ```Shell\n    cd $TFFRCNN\n    ./experiments/scripts/kitti2pascalvoc.py \\\n    --kitti $TFFRCNN/data/KITTI --out $TFFRCNN/data/KITTIVOC\n    ```\n\n4. The output directory looks like this:\n\n    ```\n    KITTIVOC\n        |-- Annotations\n                |-- [000000-007480].xml\n        |-- ImageSets\n                |-- Main\n                    |-- [train|val|trainval].txt\n        |-- JPEGImages\n                |-- [000000-007480].jpg\n    ```\n\n5. Training on `KITTIVOC` is just like on Pascal VOC 2007\n\n    ```Shell\n    python ./faster_rcnn/train_net.py \\\n    --gpu 0 \\\n    --weights ./data/pretrain_model/VGG_imagenet.npy \\\n    --imdb kittivoc_train \\\n    --iters 160000 \\\n    --cfg ./experiments/cfgs/faster_rcnn_kitti.yml \\\n    --network VGGnet_train\n    ```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlesshang%2Ftffrcnn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharlesshang%2Ftffrcnn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlesshang%2Ftffrcnn/lists"}