Skip to content
Snippets Groups Projects
Commit 1b12f840 authored by Ross Girshick's avatar Ross Girshick
Browse files

initialize with a larger height and width to prevent network initialization errors

parent d3c52550
No related branches found
No related tags found
No related merge requests found
...@@ -71,6 +71,7 @@ class RoIDataLayer(caffe.Layer): ...@@ -71,6 +71,7 @@ class RoIDataLayer(caffe.Layer):
self._prefetch_process = None self._prefetch_process = None
self._prefetch_queue = queues.SimpleQueue() self._prefetch_queue = queues.SimpleQueue()
# parse the layer parameter string, which must be valid YAML
layer_params = yaml.load(self.param_str_) layer_params = yaml.load(self.param_str_)
self._num_classes = layer_params['num_classes'] self._num_classes = layer_params['num_classes']
...@@ -82,15 +83,25 @@ class RoIDataLayer(caffe.Layer): ...@@ -82,15 +83,25 @@ class RoIDataLayer(caffe.Layer):
'bbox_targets': 3, 'bbox_targets': 3,
'bbox_loss_weights': 4} 'bbox_loss_weights': 4}
# data # data blob: holds a batch of N images, each with 3 channels
top[0].reshape(1, 3, 1, 1) # The height and width (100 x 100) are dummy values
# rois top[0].reshape(1, 3, 100, 100)
# rois blob: holds R regions of interest, each is a 5-tuple
# (n, x1, y1, x2, y2) specifying an image batch index n and a
# rectangle (x1, y1, x2, y2)
top[1].reshape(1, 5) top[1].reshape(1, 5)
# labels
# labels blob: R categorical labels in [0, ..., K] for K foreground
# classes plus background
top[2].reshape(1) top[2].reshape(1)
# bbox_targets
# bbox_targets blob: R bounding-box regression targets with 4 targets
# per class
top[3].reshape(1, self._num_classes * 4) top[3].reshape(1, self._num_classes * 4)
# bbox_loss_weights
# bbox_loss_weights blob: At most 4 targets per roi are active; this
# binary vector sepcifies the subset of active targets
top[4].reshape(1, self._num_classes * 4) top[4].reshape(1, self._num_classes * 4)
def forward(self, bottom, top): def forward(self, bottom, top):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment