Skip to content
Merged
Changes from all commits
Commits
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
15 changes: 8 additions & 7 deletions fluid/face_detction/pyramidbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def conv_block(input, groups, filters, ksizes, strides=None, with_pool=True):
if with_pool:
pool = fluid.layers.pool2d(
input=conv, pool_size=2, pool_type='max', pool_stride=2)
return pool
return conv, pool
else:
return conv

Expand Down Expand Up @@ -71,18 +71,19 @@ def _input(self):
name='gt_difficult', shape=[1], dtype='int32', lod_level=1)

def _vgg(self):
self.conv1 = conv_block(self.image, 2, [64] * 2, [3] * 2)
self.conv2 = conv_block(self.conv1, 2, [128] * 2, [3] * 2)
self.conv1, self.pool1 = conv_block(self.image, 2, [64] * 2, [3] * 2)
self.conv2, self.pool2 = conv_block(self.pool1, 2, [128] * 2, [3] * 2)

#priorbox min_size is 16
self.conv3 = conv_block(self.conv2, 3, [256] * 3, [3] * 3)
self.conv3, self.pool3 = conv_block(self.pool2, 3, [256] * 3, [3] * 3)
#priorbox min_size is 32
self.conv4 = conv_block(self.conv3, 3, [512] * 3, [3] * 3)
self.conv4, self.pool4 = conv_block(self.pool3, 3, [512] * 3, [3] * 3)
#priorbox min_size is 64
self.conv5 = conv_block(self.conv4, 3, [512] * 3, [3] * 3)
self.conv5, self.pool5 = conv_block(self.pool4, 3, [512] * 3, [3] * 3)

# fc6 and fc7 in paper, priorbox min_size is 128
self.conv6 = conv_block(self.conv5, 2, [1024, 1024], [3, 1])
self.conv6 = conv_block(
self.pool5, 2, [1024, 1024], [3, 1], with_pool=False)
# conv6_1 and conv6_2 in paper, priorbox min_size is 256
self.conv7 = conv_block(
self.conv6, 2, [256, 512], [1, 3], [1, 2], with_pool=False)
Expand Down