Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c0a5a65
add requirements, citation and license
ycjing Apr 28, 2017
ef9f65f
Update README.md
ycjing Apr 28, 2017
edcd66b
Update README.md
ycjing Apr 28, 2017
9c17559
Update README.md
ycjing Apr 28, 2017
ee25ec7
Add requirements, citation and license
ycjing Apr 28, 2017
4904fdb
Add requirements, citation and licence
ycjing Apr 28, 2017
78152c7
Add requirements, citation and licence
ycjing Apr 28, 2017
9f03111
Add requirements, citation and licence
ycjing Apr 28, 2017
574edaa
Add requirements, citation and licence
ycjing Apr 28, 2017
8dde118
Merge pull request #39 from ycjing/master
CharlesShang Apr 28, 2017
e0d70ec
xx
CharlesShang Apr 28, 2017
22147d9
update How-to in README
ycjing Apr 29, 2017
3b46e8f
Merge pull request #40 from ycjing/master
CharlesShang Apr 29, 2017
d7e3b04
add input visualization
May 10, 2017
8b7cf14
add summaries for predictions:
May 10, 2017
12f7be1
Passed height and width params should be of the prepeocessed image. i…
May 16, 2017
2e5597a
Passed height and width params should be of the prepeocessed image. i…
May 16, 2017
400df6a
Change computation for numerical stability
May 17, 2017
c7972b3
Change computation for numerical stability
May 17, 2017
725e7d2
Update README.md
theFoxofSky May 19, 2017
3a5da11
Merge pull request #58 from amirbar/fix-overflow
CharlesShang May 21, 2017
9c1e56f
set train = true
Jun 5, 2017
06cd8e5
Merge pull request #56 from theFoxofSky/patch-1
amirbar Jun 20, 2017
e91fb20
Merge pull request #50 from amirbar/fix_ihiw_params
amirbar Jun 20, 2017
72e1418
matched rois with cropped_rois
souryuu Jun 26, 2017
3dc6d9c
- fixed rois order
souryuu Jun 27, 2017
ae99504
clean up some comment
souryuu Jun 27, 2017
2e2231b
clean some comments
souryuu Jun 27, 2017
80123f6
clean up some comments
souryuu Jun 27, 2017
7abac80
add missing files
souryuu Jun 27, 2017
b5bd35d
add some missing files
souryuu Jun 27, 2017
a70dcdb
Merge pull request #96 from souryuu/master
amirbar Jul 9, 2017
bfc186a
add './output/mask_rcnn' dir if missing
Anner-deJong Jul 20, 2017
bdae077
Merge pull request #114 from Anner-deJong/patch-1
amirbar Jul 20, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
# Mask RCNN
Mask RCNN in TensorFlow
This repo attempts to reproduce this amazing work by Kaiming He.
[Mask RCNN](https://arxiv.org/abs/1703.06870).

This repo attempts to reproduce this amazing work by Kaiming He et al. :
[Mask R-CNN](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/`
3. Go to `./libs` 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
Expand All @@ -29,4 +38,12 @@ This repo attempts to reproduce this amazing work by Kaiming He.
- 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)
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
See [LICENSE](https://github.com/CharlesShang/FastMaskRCNN/blob/master/LICENSE) for details.

11 changes: 4 additions & 7 deletions data/README.md
Original file line number Diff line number Diff line change
@@ -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
```
3 changes: 3 additions & 0 deletions download_and_convert_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from __future__ import division
from __future__ import print_function

import os
import tensorflow as tf

from libs.datasets import download_and_convert_coco
Expand All @@ -21,6 +22,8 @@


def main(_):
if not os.path.isdir('./output/mask_rcnn'):
os.makedirs('./output/mask_rcnn')
if not FLAGS.dataset_name:
raise ValueError('You must supply the dataset name with --dataset_name')
if not FLAGS.dataset_dir:
Expand Down
12 changes: 10 additions & 2 deletions libs/boxes/bbox_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,16 @@ 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_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
Expand Down
2 changes: 1 addition & 1 deletion libs/configs/config_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
'Only regions which intersection is larger than fg_threshold are considered to be fg')

tf.app.flags.DEFINE_float(
'fg_threshold', 0.5,
'fg_threshold', 0.7,
'Only regions which intersection is larger than fg_threshold are considered to be fg')

tf.app.flags.DEFINE_float(
Expand Down
4 changes: 4 additions & 0 deletions libs/datasets/dataset_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
from __future__ import division
from __future__ import print_function

import tensorflow as tf
from libs.visualization.summary_utils import visualize_input
import glob
from libs.datasets import coco

import libs.preprocessings.coco_v1 as coco_preprocess

def get_dataset(dataset_name, split_name, dataset_dir,
Expand All @@ -16,6 +19,7 @@ def get_dataset(dataset_name, split_name, dataset_dir,
image, ih, iw, gt_boxes, gt_masks, num_instances, img_id = coco.read(tfrecords)

image, gt_boxes, gt_masks = coco_preprocess.preprocess_image(image, gt_boxes, gt_masks, is_training)
#visualize_input(gt_boxes, image, tf.expand_dims(gt_masks, axis=3))

return image, ih, iw, gt_boxes, gt_masks, num_instances, img_id

1 change: 1 addition & 0 deletions libs/datasets/download_and_convert_coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
tf.app.flags.DEFINE_boolean('vis', False,
'Show some visual masks')


def download_and_uncompress_zip(zip_url, dataset_dir):
"""Downloads the `zip_url` and uncompresses it locally.
From: https://github.com/tensorflow/models/blob/master/slim/datasets/dataset_utils.py
Expand Down
Loading