From c0a5a65a9005fc0f13fbc4d3493d81a8f588717d Mon Sep 17 00:00:00 2001 From: Yongcheng Jing <398372213@qq.com> Date: Fri, 28 Apr 2017 21:14:51 +0800 Subject: [PATCH 01/15] add requirements, citation and license add requirements, citation and license --- README.md | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3d88779..787322d 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,17 @@ # Mask RCNN Mask RCNN in TensorFlow -This repo attempts to reproduce this amazing work by Kaiming He. + +This repo attempts to reproduce this amazing work by Kaiming He et al. + [Mask RCNN](https://arxiv.org/abs/1703.06870). +## Requirements + +- [Tensorflow (>= 1.0.0)](https://www.tensorflow.org/install/install_linux) +- [Numpy](https://github.com/numpy/numpy/blob/master/INSTALL.rst.txt) +- [COCO dataset](http://mscoco.org/dataset/#download) +- [Resnet50](http://download.tensorflow.org/models/resnet_v1_50_2016_08_28.tar.gz) + ## How-to 1. Download [COCO](http://mscoco.org/dataset/#download) dataset, place it into `./data`, then run `python download_and_convert_data.py` to build tf-records. It takes a while. 2. Download pretrained resnet50 model, `wget http://download.tensorflow.org/models/resnet_v1_50_2016_08_28.tar.gz`, unzip it, place it into `./data/pretrained_models/` @@ -28,5 +37,24 @@ This repo attempts to reproduce this amazing work by Kaiming He. ## Call for contributions - Anything helps this repo, including **discussion**, **testing**, **promotion** and of course **your awesome code**. +## Citation +If you use this implementation in your work, please cite the following: + +``` +@misc{shang2017fastmaskrcnn, + author = {Chong Shang}, + title = {FastMaskRCNN}, + year = {2017}, + howpublished = {\url{https://github.com/CharlesShang/FastMaskRCNN}}, + note = {commit xxxxxxx} +} +``` ## Acknowledgment -This repo borrows tons of code from [TFFRCNN](https://github.com/CharlesShang/TFFRCNN), [py-faster-rcnn](https://github.com/rbgirshick/py-faster-rcnn), [faster_rcnn](https://github.com/ShaoqingRen/faster_rcnn), [tf-models](https://github.com/tensorflow/models) +This repo borrows tons of code from +- [TFFRCNN](https://github.com/CharlesShang/TFFRCNN) +- [py-faster-rcnn](https://github.com/rbgirshick/py-faster-rcnn) +- [faster_rcnn](https://github.com/ShaoqingRen/faster_rcnn) +- [tf-models](https://github.com/tensorflow/models) + +## License +MIT From ef9f65f2f592e399d709dbccbd2a0e8b8e3c4ba4 Mon Sep 17 00:00:00 2001 From: Yongcheng Jing <398372213@qq.com> Date: Fri, 28 Apr 2017 21:16:00 +0800 Subject: [PATCH 02/15] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 787322d..70aecf6 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,7 @@ Mask RCNN in TensorFlow This repo attempts to reproduce this amazing work by Kaiming He et al. - -[Mask RCNN](https://arxiv.org/abs/1703.06870). +[Mask R-CNN](https://arxiv.org/abs/1703.06870). ## Requirements From edcd66bf5cc89379b3969fd6c937c5fc7ce17063 Mon Sep 17 00:00:00 2001 From: Yongcheng Jing <398372213@qq.com> Date: Fri, 28 Apr 2017 21:16:24 +0800 Subject: [PATCH 03/15] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 70aecf6..44bf4cf 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Mask RCNN Mask RCNN in TensorFlow -This repo attempts to reproduce this amazing work by Kaiming He et al. +This repo attempts to reproduce this amazing work by Kaiming He et al. : [Mask R-CNN](https://arxiv.org/abs/1703.06870). ## Requirements From 9c175596225fc65843750a60748fdf74eac2942f Mon Sep 17 00:00:00 2001 From: Yongcheng Jing <398372213@qq.com> Date: Fri, 28 Apr 2017 21:16:38 +0800 Subject: [PATCH 04/15] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 44bf4cf..cc082ff 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Mask RCNN in TensorFlow This repo attempts to reproduce this amazing work by Kaiming He et al. : -[Mask R-CNN](https://arxiv.org/abs/1703.06870). +[Mask R-CNN](https://arxiv.org/abs/1703.06870) ## Requirements From ee25ec737952edec75565c59eb6550b9c3adf978 Mon Sep 17 00:00:00 2001 From: Yongcheng Jing <398372213@qq.com> Date: Fri, 28 Apr 2017 21:23:55 +0800 Subject: [PATCH 05/15] Add requirements, citation and license Add requirements, citation and license --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index cc082ff..c677a23 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,13 @@ This repo attempts to reproduce this amazing work by Kaiming He et al. : ## Call for contributions - Anything helps this repo, including **discussion**, **testing**, **promotion** and of course **your awesome code**. +## Acknowledgment +This repo borrows tons of code from +- [TFFRCNN](https://github.com/CharlesShang/TFFRCNN) +- [py-faster-rcnn](https://github.com/rbgirshick/py-faster-rcnn) +- [faster_rcnn](https://github.com/ShaoqingRen/faster_rcnn) +- [tf-models](https://github.com/tensorflow/models) + ## Citation If you use this implementation in your work, please cite the following: @@ -48,12 +55,6 @@ If you use this implementation in your work, please cite the following: note = {commit xxxxxxx} } ``` -## Acknowledgment -This repo borrows tons of code from -- [TFFRCNN](https://github.com/CharlesShang/TFFRCNN) -- [py-faster-rcnn](https://github.com/rbgirshick/py-faster-rcnn) -- [faster_rcnn](https://github.com/ShaoqingRen/faster_rcnn) -- [tf-models](https://github.com/tensorflow/models) ## License MIT From 4904fdb7c489b29af005676b2033fcb61aada468 Mon Sep 17 00:00:00 2001 From: Yongcheng Jing <398372213@qq.com> Date: Fri, 28 Apr 2017 21:37:01 +0800 Subject: [PATCH 06/15] Add requirements, citation and licence Add requirements, citation and licence --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c677a23..5a2b5d8 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ This repo attempts to reproduce this amazing work by Kaiming He et al. : 1. Download [COCO](http://mscoco.org/dataset/#download) dataset, place it into `./data`, then run `python download_and_convert_data.py` to build tf-records. It takes a while. 2. Download pretrained resnet50 model, `wget http://download.tensorflow.org/models/resnet_v1_50_2016_08_28.tar.gz`, unzip it, place it into `./data/pretrained_models/` 3. Go to `./libs` and run `make` +4. Go to `./libs/datasets/pycocotools` and run `make` 4. run `python train/train.py` for training 5. There are certainly some bugs, please report them back, and let's solve them together. @@ -57,4 +58,5 @@ If you use this implementation in your work, please cite the following: ``` ## License -MIT +See [LICENSE][LICENSE] for details. + From 78152c73b7962ac4b85daa87fc1a6b8b0e884334 Mon Sep 17 00:00:00 2001 From: Yongcheng Jing <398372213@qq.com> Date: Fri, 28 Apr 2017 21:38:24 +0800 Subject: [PATCH 07/15] Add requirements, citation and licence Add requirements, citation and licence --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5a2b5d8..99a40f4 100644 --- a/README.md +++ b/README.md @@ -58,5 +58,5 @@ If you use this implementation in your work, please cite the following: ``` ## License -See [LICENSE][LICENSE] for details. +See [LICENSE][license] for details. From 9f0311146565fd97f173b086fd16afa3fdbdf067 Mon Sep 17 00:00:00 2001 From: Yongcheng Jing <398372213@qq.com> Date: Fri, 28 Apr 2017 21:39:10 +0800 Subject: [PATCH 08/15] Add requirements, citation and licence Add requirements, citation and licence --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 99a40f4..2e15246 100644 --- a/README.md +++ b/README.md @@ -58,5 +58,5 @@ If you use this implementation in your work, please cite the following: ``` ## License -See [LICENSE][license] for details. +See [LICENSE][https://github.com/CharlesShang/FastMaskRCNN/blob/master/LICENSE] for details. From 574edaab5b8064fe241475349647cd72550f7b4e Mon Sep 17 00:00:00 2001 From: Yongcheng Jing <398372213@qq.com> Date: Fri, 28 Apr 2017 21:39:51 +0800 Subject: [PATCH 09/15] Add requirements, citation and licence Add requirements, citation and licence --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e15246..d1357a4 100644 --- a/README.md +++ b/README.md @@ -58,5 +58,5 @@ If you use this implementation in your work, please cite the following: ``` ## License -See [LICENSE][https://github.com/CharlesShang/FastMaskRCNN/blob/master/LICENSE] for details. +See [LICENSE](https://github.com/CharlesShang/FastMaskRCNN/blob/master/LICENSE) for details. From e0d70ec5e67a52bc25aea693ecc222ef9e3a74f4 Mon Sep 17 00:00:00 2001 From: CharlesShang Date: Fri, 28 Apr 2017 23:34:48 +0800 Subject: [PATCH 10/15] xx --- README.md | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/README.md b/README.md index d1357a4..24da0f4 100644 --- a/README.md +++ b/README.md @@ -44,19 +44,6 @@ This repo borrows tons of code from - [faster_rcnn](https://github.com/ShaoqingRen/faster_rcnn) - [tf-models](https://github.com/tensorflow/models) -## Citation -If you use this implementation in your work, please cite the following: - -``` -@misc{shang2017fastmaskrcnn, - author = {Chong Shang}, - title = {FastMaskRCNN}, - year = {2017}, - howpublished = {\url{https://github.com/CharlesShang/FastMaskRCNN}}, - note = {commit xxxxxxx} -} -``` - ## License See [LICENSE](https://github.com/CharlesShang/FastMaskRCNN/blob/master/LICENSE) for details. From 22147d959644c0ceecc2e662350c27967462dd25 Mon Sep 17 00:00:00 2001 From: Yongcheng Jing <398372213@qq.com> Date: Sat, 29 Apr 2017 10:03:45 +0800 Subject: [PATCH 11/15] update How-to in README update How-to in README --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d1357a4..59bf7ab 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,12 @@ This repo attempts to reproduce this amazing work by Kaiming He et al. : - [Resnet50](http://download.tensorflow.org/models/resnet_v1_50_2016_08_28.tar.gz) ## How-to -1. Download [COCO](http://mscoco.org/dataset/#download) dataset, place it into `./data`, then run `python download_and_convert_data.py` to build tf-records. It takes a while. -2. Download pretrained resnet50 model, `wget http://download.tensorflow.org/models/resnet_v1_50_2016_08_28.tar.gz`, unzip it, place it into `./data/pretrained_models/` -3. Go to `./libs` and run `make` -4. Go to `./libs/datasets/pycocotools` and run `make` -4. run `python train/train.py` for training -5. There are certainly some bugs, please report them back, and let's solve them together. +1. Go to `./libs/datasets/pycocotools` and run `make` +2. Download [COCO](http://mscoco.org/dataset/#download) dataset, place it into `./data`, then run `python download_and_convert_data.py` to build tf-records. It takes a while. +3. Download pretrained resnet50 model, `wget http://download.tensorflow.org/models/resnet_v1_50_2016_08_28.tar.gz`, unzip it, place it into `./data/pretrained_models/` +4. Go to `./libs` and run `make` +5. run `python train/train.py` for training +6. There are certainly some bugs, please report them back, and let's solve them together. ## TODO: - [x] ROIAlign From 2e5597a813047b55750ccc6d6aa49b79eda33cd8 Mon Sep 17 00:00:00 2001 From: amirbar Date: Tue, 16 May 2017 10:39:09 +0300 Subject: [PATCH 12/15] Passed height and width params should be of the prepeocessed image. issue #48 --- train/train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train/train.py b/train/train.py index 839c178..aebc7e4 100644 --- a/train/train.py +++ b/train/train.py @@ -128,7 +128,7 @@ def train(): ## network logits, end_points, pyramid_map = network.get_network(FLAGS.network, image, weight_decay=FLAGS.weight_decay) - outputs = pyramid_network.build(end_points, ih, iw, pyramid_map, + outputs = pyramid_network.build(end_points, im_shape[1], im_shape[2], pyramid_map, num_classes=81, base_anchors=9, is_training=True, From c7972b3645fd5cbbebe5b7efbc9323da54392783 Mon Sep 17 00:00:00 2001 From: amirbar Date: Wed, 17 May 2017 16:33:07 +0300 Subject: [PATCH 13/15] Change computation for numerical stability --- libs/boxes/bbox_transform.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/boxes/bbox_transform.py b/libs/boxes/bbox_transform.py index fadd90c..e8c74e9 100644 --- a/libs/boxes/bbox_transform.py +++ b/libs/boxes/bbox_transform.py @@ -58,8 +58,12 @@ def bbox_transform_inv(boxes, deltas): pred_ctr_x = dx * widths[:, np.newaxis] + ctr_x[:, np.newaxis] pred_ctr_y = dy * heights[:, np.newaxis] + ctr_y[:, np.newaxis] - pred_w = np.exp(dw) * widths[:, np.newaxis] - pred_h = np.exp(dh) * heights[:, np.newaxis] + # pred_w = np.exp(dw) * widths[:, np.newaxis] + # pred_h = np.exp(dh) * heights[:, np.newaxis] + + pred_w = np.exp(dw + np.log(widths[:, np.newaxis])) + pred_h = np.exp(dh + np.log(heights[:, np.newaxis])) + pred_boxes = np.zeros(deltas.shape, dtype=deltas.dtype) # x1 From 725e7d2fe60fa816126c800ab188bce90b1e024b Mon Sep 17 00:00:00 2001 From: theFoxofSky <1252693592@qq.com> Date: Fri, 19 May 2017 14:37:41 +0800 Subject: [PATCH 14/15] Update README.md --- data/README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/data/README.md b/data/README.md index e0871de..6f09a56 100644 --- a/data/README.md +++ b/data/README.md @@ -1,12 +1,9 @@ -Place your coco in this dir, like +Place and unzip your coco in this dir, like ```buildoutcfg ./data ./coco - ./train2014.zip - ./val2014.zip - ./instances_train-val2014.zip - ./person_keypoints_trainval2014.zip - ./captions_train-val2014.zip - + ./annotations + ./train2014 + ./val2014 ``` From 9c1e56f7de2dee4b9963a550f7f7d70f83bc8b33 Mon Sep 17 00:00:00 2001 From: amirbar Date: Mon, 5 Jun 2017 17:40:34 +0300 Subject: [PATCH 15/15] set train = true --- train/train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train/train.py b/train/train.py index aebc7e4..cb04d8f 100644 --- a/train/train.py +++ b/train/train.py @@ -127,7 +127,7 @@ def train(): ## network logits, end_points, pyramid_map = network.get_network(FLAGS.network, image, - weight_decay=FLAGS.weight_decay) + weight_decay=FLAGS.weight_decay, is_training=True) outputs = pyramid_network.build(end_points, im_shape[1], im_shape[2], pyramid_map, num_classes=81, base_anchors=9,