Skip to content

Commit 3cea4d2

Browse files
committed
Merge commit 'ed6b0410d252e408793bec0ac630a40137dfee36'
* commit 'ed6b0410d252e408793bec0ac630a40137dfee36': Update README.md update readme update models. Fix typo. Fix default options. Update new models. Update new models. Update readme. change threshold for testing Update README.md BUG FIX: Include regularization in the loss. Update config.py # Conflicts: # README.md # lib/model/test.py # lib/nets/network.py # lib/nets/resnet_v1.py # lib/nets/vgg16.py
2 parents fe91a0d + ed6b041 commit 3cea4d2

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

experiments/cfgs/res101-lg.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ TRAIN:
99
BG_THRESH_LO: 0.0
1010
DISPLAY: 20
1111
BATCH_SIZE: 256
12-
WEIGHT_DECAY: 0.0001
1312
DOUBLE_BIAS: False
1413
SNAPSHOT_PREFIX: res101_faster_rcnn
1514
SCALES: [800]

experiments/cfgs/res101.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ TRAIN:
99
BG_THRESH_LO: 0.0
1010
DISPLAY: 20
1111
BATCH_SIZE: 256
12-
WEIGHT_DECAY: 0.0001
1312
DOUBLE_BIAS: False
1413
SNAPSHOT_PREFIX: res101_faster_rcnn
1514
TEST:

experiments/cfgs/res50.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ TRAIN:
99
BG_THRESH_LO: 0.0
1010
DISPLAY: 20
1111
BATCH_SIZE: 256
12-
WEIGHT_DECAY: 0.0001
1312
DOUBLE_BIAS: False
1413
SNAPSHOT_PREFIX: res50_faster_rcnn
1514
TEST:

lib/model/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
__C.TRAIN.MOMENTUM = 0.9
2626

2727
# Weight decay, for regularization
28-
__C.TRAIN.WEIGHT_DECAY = 0.0005
28+
__C.TRAIN.WEIGHT_DECAY = 0.0001
2929

3030
# Factor for reducing the learning rate
3131
__C.TRAIN.GAMMA = 0.1
@@ -232,7 +232,7 @@
232232
# Whether to regularize the depth-wise filters during training
233233
__C.MOBILENET.REGU_DEPTH = False
234234

235-
# Number of fixed layers during training, by default the first of all 14 layers is fixed
235+
# Number of fixed layers during training, by default the bottom 5 of 14 layers is fixed
236236
# Range: 0 (none) to 12 (all)
237237
__C.MOBILENET.FIXED_LAYERS = 5
238238

lib/model/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def apply_nms(all_boxes, thresh):
137137
nms_boxes[cls_ind][im_ind] = dets[keep, :].copy()
138138
return nms_boxes
139139

140-
def test_net(net, imdb, weights_filename, max_per_image=100, thresh=0.05):
140+
def test_net(net, imdb, weights_filename, max_per_image=100, thresh=0.):
141141
np.random.seed(cfg.RNG_SEED)
142142
"""Test a Fast R-CNN network on an image database."""
143143
num_images = len(imdb.image_index)

lib/nets/mobilenet_v1.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def mobilenet_v1_base(inputs,
8585
min_depth=8,
8686
depth_multiplier=1.0,
8787
output_stride=None,
88-
reuse=False,
88+
reuse=None,
8989
scope=None):
9090
"""Mobilenet v1.
9191
Constructs a Mobilenet v1 network from inputs to the given final endpoint.
@@ -211,7 +211,7 @@ def __init__(self):
211211
self._depth_multiplier = cfg.MOBILENET.DEPTH_MULTIPLIER
212212
self._scope = 'MobilenetV1'
213213

214-
def _image_to_head(self, is_training, reuse=False):
214+
def _image_to_head(self, is_training, reuse=None):
215215
# Base bottleneck
216216
assert (0 <= cfg.MOBILENET.FIXED_LAYERS <= 12)
217217
net_conv = self._image
@@ -237,7 +237,7 @@ def _image_to_head(self, is_training, reuse=False):
237237

238238
return net_conv
239239

240-
def _head_to_tail(self, pool5, is_training, reuse=False):
240+
def _head_to_tail(self, pool5, is_training, reuse=None):
241241
with slim.arg_scope(mobilenet_v1_arg_scope(is_training=is_training)):
242242
fc7 = mobilenet_v1_base(pool5,
243243
_CONV_DEFS[12:],

lib/utils/visualization.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from __future__ import print_function
99

1010
import numpy as np
11+
from six.moves import range
1112
import PIL.Image as Image
1213
import PIL.ImageColor as ImageColor
1314
import PIL.ImageDraw as ImageDraw
@@ -39,7 +40,14 @@
3940
'WhiteSmoke', 'Yellow', 'YellowGreen'
4041
]
4142

42-
def draw_single_box(image, xmin, ymin, xmax, ymax, display_str, font, color='black', thickness=4):
43+
NUM_COLORS = len(STANDARD_COLORS)
44+
45+
try:
46+
FONT = ImageFont.truetype('arial.ttf', 24)
47+
except IOError:
48+
FONT = ImageFont.load_default()
49+
50+
def _draw_single_box(image, xmin, ymin, xmax, ymax, display_str, font, color='black', thickness=4):
4351
draw = ImageDraw.Draw(image)
4452
(left, right, top, bottom) = (xmin, xmax, ymin, ymax)
4553
draw.line([(left, top), (left, bottom), (right, bottom),
@@ -62,15 +70,10 @@ def draw_single_box(image, xmin, ymin, xmax, ymax, display_str, font, color='bla
6270

6371
def draw_bounding_boxes(image, gt_boxes, im_info):
6472
num_boxes = gt_boxes.shape[0]
65-
num_colors = len(STANDARD_COLORS)
66-
im_info = im_info[0]
73+
gt_boxes_new = gt_boxes.copy()
74+
gt_boxes_new[:,:4] = np.round(gt_boxes_new[:,:4].copy() / im_info[2])
6775
disp_image = Image.fromarray(np.uint8(image[0]))
6876

69-
try:
70-
font = ImageFont.truetype('arial.ttf', 24)
71-
except IOError:
72-
font = ImageFont.load_default()
73-
7477
for i in range(num_boxes):
7578
this_class = int(gt_boxes[i, 4])
7679
disp_image = draw_single_box(disp_image,

0 commit comments

Comments
 (0)