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
c842bf51
Commit
c842bf51
authored
Nov 17, 2018
by
Chao Fang
Committed by
Yuxin Wu
Nov 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update crowd label handeling (#984)
* update crowd label handeling * Disable crowd filtering by default.
parent
831d0dda
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
examples/FasterRCNN/config.py
examples/FasterRCNN/config.py
+4
-1
examples/FasterRCNN/data.py
examples/FasterRCNN/data.py
+8
-8
No files found.
examples/FasterRCNN/config.py
View file @
c842bf51
...
@@ -139,7 +139,10 @@ _C.RPN.FG_RATIO = 0.5 # fg ratio among selected RPN anchors
...
@@ -139,7 +139,10 @@ _C.RPN.FG_RATIO = 0.5 # fg ratio among selected RPN anchors
_C
.
RPN
.
BATCH_PER_IM
=
256
# total (across FPN levels) number of anchors that are marked valid
_C
.
RPN
.
BATCH_PER_IM
=
256
# total (across FPN levels) number of anchors that are marked valid
_C
.
RPN
.
MIN_SIZE
=
0
_C
.
RPN
.
MIN_SIZE
=
0
_C
.
RPN
.
PROPOSAL_NMS_THRESH
=
0.7
_C
.
RPN
.
PROPOSAL_NMS_THRESH
=
0.7
_C
.
RPN
.
CROWD_OVERLAP_THRESH
=
0.7
# boxes overlapping crowd will be ignored.
# Anchors which overlap with a crowd box (IOA larger than threshold) will be ignored.
# Setting this to a value larger than 1.0 will disable the feature.
# It is disabled by default because Detectron does not do this.
_C
.
RPN
.
CROWD_OVERLAP_THRESH
=
9.99
_C
.
RPN
.
HEAD_DIM
=
1024
# used in C4 only
_C
.
RPN
.
HEAD_DIM
=
1024
# used in C4 only
# RPN proposal selection -------------------------------
# RPN proposal selection -------------------------------
...
...
examples/FasterRCNN/data.py
View file @
c842bf51
...
@@ -16,6 +16,7 @@ from tensorpack.utils import logger
...
@@ -16,6 +16,7 @@ from tensorpack.utils import logger
from
coco
import
COCODetection
from
coco
import
COCODetection
from
utils.generate_anchors
import
generate_anchors
from
utils.generate_anchors
import
generate_anchors
from
utils.np_box_ops
import
area
as
np_area
from
utils.np_box_ops
import
area
as
np_area
from
utils.np_box_ops
import
ioa
as
np_ioa
from
common
import
(
from
common
import
(
DataFromListOfDict
,
CustomResize
,
filter_boxes_inside_shape
,
DataFromListOfDict
,
CustomResize
,
filter_boxes_inside_shape
,
box_to_point8
,
point8_to_box
,
segmentation_to_mask
)
box_to_point8
,
point8_to_box
,
segmentation_to_mask
)
...
@@ -154,14 +155,13 @@ def get_anchor_labels(anchors, gt_boxes, crowd_boxes):
...
@@ -154,14 +155,13 @@ def get_anchor_labels(anchors, gt_boxes, crowd_boxes):
anchor_labels
[
ious_max_per_anchor
>=
cfg
.
RPN
.
POSITIVE_ANCHOR_THRESH
]
=
1
anchor_labels
[
ious_max_per_anchor
>=
cfg
.
RPN
.
POSITIVE_ANCHOR_THRESH
]
=
1
anchor_labels
[
ious_max_per_anchor
<
cfg
.
RPN
.
NEGATIVE_ANCHOR_THRESH
]
=
0
anchor_labels
[
ious_max_per_anchor
<
cfg
.
RPN
.
NEGATIVE_ANCHOR_THRESH
]
=
0
# We can label all non-ignore candidate boxes which overlap crowd as ignore
# label all non-ignore candidate boxes which overlap crowd as ignore
# But detectron did not do this.
if
crowd_boxes
.
size
>
0
:
# if crowd_boxes.size > 0:
cand_inds
=
np
.
where
(
anchor_labels
>=
0
)[
0
]
# cand_inds = np.where(anchor_labels >= 0)[0]
cand_anchors
=
anchors
[
cand_inds
]
# cand_anchors = anchors[cand_inds]
ioas
=
np_ioa
(
crowd_boxes
,
cand_anchors
)
# ious = np_iou(cand_anchors, crowd_boxes)
overlap_with_crowd
=
cand_inds
[
ioas
.
max
(
axis
=
0
)
>
cfg
.
RPN
.
CROWD_OVERLAP_THRES
]
# overlap_with_crowd = cand_inds[ious.max(axis=1) > cfg.RPN.CROWD_OVERLAP_THRES]
anchor_labels
[
overlap_with_crowd
]
=
-
1
# anchor_labels[overlap_with_crowd] = -1
# Subsample fg labels: ignore some fg if fg is too many
# Subsample fg labels: ignore some fg if fg is too many
target_num_fg
=
int
(
cfg
.
RPN
.
BATCH_PER_IM
*
cfg
.
RPN
.
FG_RATIO
)
target_num_fg
=
int
(
cfg
.
RPN
.
BATCH_PER_IM
*
cfg
.
RPN
.
FG_RATIO
)
...
...
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