Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
994a150b
Commit
994a150b
authored
Oct 15, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FasterRCNN] no need to lower bound fg_ratio
parent
fa8af3d8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
7 deletions
+5
-7
examples/FasterRCNN/config.py
examples/FasterRCNN/config.py
+1
-1
examples/FasterRCNN/model.py
examples/FasterRCNN/model.py
+2
-5
examples/FasterRCNN/train.py
examples/FasterRCNN/train.py
+2
-1
No files found.
examples/FasterRCNN/config.py
View file @
994a150b
...
...
@@ -40,7 +40,7 @@ FASTRCNN_BATCH_PER_IM = 64
FASTRCNN_BBOX_REG_WEIGHTS
=
np
.
array
([
10
,
10
,
5
,
5
],
dtype
=
'float32'
)
FASTRCNN_FG_THRESH
=
0.5
# keep fg ratio in a batch in this range
FASTRCNN_FG_RATIO
=
(
0.1
,
0.25
)
FASTRCNN_FG_RATIO
=
0.25
# testing -----------------------
TEST_PRE_NMS_TOPK
=
6000
...
...
examples/FasterRCNN/model.py
View file @
994a150b
...
...
@@ -261,16 +261,13 @@ def sample_fast_rcnn_targets(boxes, gt_boxes, gt_labels):
tf
.
int64
)],
0
)
num_fg
=
tf
.
size
(
fg_inds
)
num_fg
=
tf
.
minimum
(
int
(
config
.
FASTRCNN_BATCH_PER_IM
*
config
.
FASTRCNN_FG_RATIO
[
1
]
),
config
.
FASTRCNN_BATCH_PER_IM
*
config
.
FASTRCNN_FG_RATIO
),
num_fg
,
name
=
'num_fg'
)
fg_inds
=
tf
.
slice
(
tf
.
random_shuffle
(
fg_inds
),
[
0
],
[
num_fg
])
bg_inds
=
tf
.
where
(
tf
.
logical_not
(
fg_mask
))[:,
0
]
num_bg
=
tf
.
size
(
bg_inds
)
num_bg
=
tf
.
minimum
(
config
.
FASTRCNN_BATCH_PER_IM
-
num_fg
,
num_bg
)
num_bg
=
tf
.
minimum
(
num_bg
,
num_fg
*
int
(
1.0
/
config
.
FASTRCNN_FG_RATIO
[
0
]),
name
=
'num_bg'
)
# don't include too many bg
num_bg
=
tf
.
minimum
(
config
.
FASTRCNN_BATCH_PER_IM
-
num_fg
,
num_bg
,
name
=
'num_bg'
)
bg_inds
=
tf
.
slice
(
tf
.
random_shuffle
(
bg_inds
),
[
0
],
[
num_bg
])
add_moving_summary
(
num_fg
,
num_bg
)
...
...
examples/FasterRCNN/train.py
View file @
994a150b
...
...
@@ -252,6 +252,7 @@ if __name__ == '__main__':
if
args
.
evaluate
is
not
None
:
assert
args
.
evaluate
.
endswith
(
'.json'
)
assert
args
.
load
# autotune is too slow for inference
os
.
environ
[
'TF_CUDNN_USE_AUTOTUNE'
]
=
'0'
offline_evaluate
(
args
.
load
,
args
.
evaluate
)
sys
.
exit
()
...
...
@@ -283,7 +284,7 @@ if __name__ == '__main__':
],
steps_per_epoch
=
stepnum
,
max_epoch
=
205000
//
stepnum
,
session_init
=
get_model_loader
(
args
.
load
),
session_init
=
get_model_loader
(
args
.
load
)
if
args
.
load
else
None
,
nr_tower
=
nr_gpu
)
SyncMultiGPUTrainerReplicated
(
cfg
,
gpu_prefetch
=
False
)
.
train
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment