Commit f7729086 authored by Yuxin Wu's avatar Yuxin Wu

[FasterRCNN] update docs; fix tf.reverse

parent 7a5b861a
...@@ -5,7 +5,7 @@ This is a minimal implementation that simply contains these files: ...@@ -5,7 +5,7 @@ This is a minimal implementation that simply contains these files:
+ data.py: prepare data for training + data.py: prepare data for training
+ common.py: common data preparation utilities + common.py: common data preparation utilities
+ basemodel.py: implement resnet + basemodel.py: implement resnet
+ model.py: implement rpn/faster-rcnn + model.py: implement rpn/faster-rcnn/mask-rcnn
+ train.py: main training script + train.py: main training script
+ utils/: third-party helper functions + utils/: third-party helper functions
+ eval.py: evaluation utilities + eval.py: evaluation utilities
...@@ -45,5 +45,5 @@ Speed: ...@@ -45,5 +45,5 @@ Speed:
a slow convolution algorithm, or you spend more time on autotune. a slow convolution algorithm, or you spend more time on autotune.
This is a general problem of TensorFlow when running against variable-sized input. This is a general problem of TensorFlow when running against variable-sized input.
3. With a large roi batch size (e.g. >= 256), GPU utilitization should stay around 90%. 3. With a large roi batch size (e.g. >= 256), GPU utilitization should stay above 90%.
...@@ -24,8 +24,8 @@ DIR/ ...@@ -24,8 +24,8 @@ DIR/
## Usage ## Usage
Change config: Change config in `config.py`:
1. Set `BASEDIR` in `config.py` to `/path/to/DIR` as described above. 1. Set `BASEDIR` to `/path/to/DIR` as described above.
2. Set `MODE_MASK` to switch Faster-RCNN or Mask-RCNN. 2. Set `MODE_MASK` to switch Faster-RCNN or Mask-RCNN.
Train: Train:
......
...@@ -147,7 +147,7 @@ class Model(ModelDesc): ...@@ -147,7 +147,7 @@ class Model(ModelDesc):
image, fg_sampled_boxes, image, fg_sampled_boxes,
tf.zeros_like(fg_inds_wrt_sample, dtype=tf.int32), 300) tf.zeros_like(fg_inds_wrt_sample, dtype=tf.int32), 300)
fg_sampled_patches = tf.transpose(fg_sampled_patches, [0, 2, 3, 1]) fg_sampled_patches = tf.transpose(fg_sampled_patches, [0, 2, 3, 1])
fg_sampled_patches = tf.reverse(fg_sampled_patches, axis=-1) # BGR->RGB fg_sampled_patches = tf.reverse(fg_sampled_patches, axis=[-1]) # BGR->RGB
tf.summary.image('viz', fg_sampled_patches, max_outputs=30) tf.summary.image('viz', fg_sampled_patches, max_outputs=30)
matched_gt_boxes = tf.gather(gt_boxes, fg_inds_wrt_gt) matched_gt_boxes = tf.gather(gt_boxes, fg_inds_wrt_gt)
......
...@@ -169,7 +169,7 @@ def get_checkpoint_path(model_path): ...@@ -169,7 +169,7 @@ def get_checkpoint_path(model_path):
def load_chkpt_vars(model_path): def load_chkpt_vars(model_path):
""" Dump all variables from a checkpoint to a dict. """ Load all variables from a checkpoint to a dict.
Args: Args:
model_path(str): path to a checkpoint. model_path(str): path to a checkpoint.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment