Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
fc585957
Commit
fc585957
authored
Aug 07, 2020
by
Vivek Rathod
Committed by
TF Object Detection Team
Aug 07, 2020
Browse files
Support Partial labels with Faster R-CNN.
PiperOrigin-RevId: 325536056
parent
284eacdf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
research/object_detection/meta_architectures/faster_rcnn_meta_arch.py
...ect_detection/meta_architectures/faster_rcnn_meta_arch.py
+9
-1
No files found.
research/object_detection/meta_architectures/faster_rcnn_meta_arch.py
View file @
fc585957
...
@@ -2412,7 +2412,15 @@ class FasterRCNNMetaArch(model.DetectionModel):
...
@@ -2412,7 +2412,15 @@ class FasterRCNNMetaArch(model.DetectionModel):
unmatched_class_label
=
tf
.
constant
(
unmatched_class_label
=
tf
.
constant
(
[
1
]
+
self
.
_num_classes
*
[
0
],
dtype
=
tf
.
float32
),
[
1
]
+
self
.
_num_classes
*
[
0
],
dtype
=
tf
.
float32
),
gt_weights_batch
=
groundtruth_weights_list
)
gt_weights_batch
=
groundtruth_weights_list
)
if
self
.
groundtruth_has_field
(
fields
.
InputDataFields
.
groundtruth_labeled_classes
):
gt_labeled_classes
=
self
.
groundtruth_lists
(
fields
.
InputDataFields
.
groundtruth_labeled_classes
)
gt_labeled_classes
=
tf
.
pad
(
gt_labeled_classes
,
[[
0
,
0
],
[
1
,
0
]],
mode
=
'CONSTANT'
,
constant_values
=
1
)
batch_cls_weights
*=
tf
.
expand_dims
(
gt_labeled_classes
,
1
)
class_predictions_with_background
=
tf
.
reshape
(
class_predictions_with_background
=
tf
.
reshape
(
class_predictions_with_background
,
class_predictions_with_background
,
[
batch_size
,
self
.
max_num_proposals
,
-
1
])
[
batch_size
,
self
.
max_num_proposals
,
-
1
])
...
...
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