Skip to content
This repository was archived by the owner on Nov 21, 2023. It is now read-only.

Commit fdcf219

Browse files
committed
Extract anchor_sizes to imporve readability
1 parent 27f5aee commit fdcf219

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tools/convert_pkl_to_pb.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,8 @@ def convert_gen_proposals(
178178
inputs = [x for x in op.input]
179179
anchor_name = 'anchor{}'.format(lvl) if lvl else 'anchor'
180180
inputs.append(anchor_name)
181-
blobs[anchor_name] = \
182-
get_anchors(
183-
spatial_scale,
184-
(cfg.FPN.RPN_ANCHOR_START_SIZE * 2.**(lvl - cfg.FPN.RPN_MIN_LEVEL),)
185-
) \
186-
if lvl else get_anchors(spatial_scale, cfg.RPN.SIZES)
181+
anchor_sizes = (cfg.FPN.RPN_ANCHOR_START_SIZE * 2.**(lvl - cfg.FPN.RPN_MIN_LEVEL),) if lvl else cfg.RPN.SIZES
182+
blobs[anchor_name] = get_anchors(spatial_scale, anchor_sizes)
187183
print('anchors {}'.format(blobs[anchor_name]))
188184

189185
ret = core.CreateOperator(

0 commit comments

Comments
 (0)