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
90e471e7
Unverified
Commit
90e471e7
authored
Oct 23, 2021
by
srihari-humbarwadi
Browse files
paste masks only for valid instances
parent
39678c06
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
official/vision/beta/projects/panoptic_maskrcnn/modeling/layers/panoptic_segmentation_generator.py
...skrcnn/modeling/layers/panoptic_segmentation_generator.py
+4
-2
No files found.
official/vision/beta/projects/panoptic_maskrcnn/modeling/layers/panoptic_segmentation_generator.py
View file @
90e471e7
...
@@ -116,7 +116,6 @@ class PanopticSegmentationGenerator(tf.keras.layers.Layer):
...
@@ -116,7 +116,6 @@ class PanopticSegmentationGenerator(tf.keras.layers.Layer):
- instance_mask: A `tf.Tensor for instance masks.
- instance_mask: A `tf.Tensor for instance masks.
"""
"""
# Paste instance masks
# Paste instance masks
pasted_masks
=
self
.
_paste_masks_fn
((
detections_masks
,
boxes
))
# Offset stuff class predictions
# Offset stuff class predictions
segmentation_mask
=
tf
.
where
(
segmentation_mask
=
tf
.
where
(
...
@@ -135,7 +134,6 @@ class PanopticSegmentationGenerator(tf.keras.layers.Layer):
...
@@ -135,7 +134,6 @@ class PanopticSegmentationGenerator(tf.keras.layers.Layer):
instance_mask
=
tf
.
ones
(
instance_mask
=
tf
.
ones
(
mask_shape
,
dtype
=
tf
.
float32
)
*
self
.
_void_instance_id
mask_shape
,
dtype
=
tf
.
float32
)
*
self
.
_void_instance_id
# filter instances with low confidence
# filter instances with low confidence
sorted_scores
=
tf
.
sort
(
scores
,
direction
=
'DESCENDING'
)
sorted_scores
=
tf
.
sort
(
scores
,
direction
=
'DESCENDING'
)
...
@@ -149,6 +147,10 @@ class PanopticSegmentationGenerator(tf.keras.layers.Layer):
...
@@ -149,6 +147,10 @@ class PanopticSegmentationGenerator(tf.keras.layers.Layer):
tf
.
cast
(
loop_end_idx
,
dtype
=
tf
.
int32
),
tf
.
cast
(
loop_end_idx
,
dtype
=
tf
.
int32
),
self
.
_max_num_detections
)
self
.
_max_num_detections
)
pasted_masks
=
self
.
_paste_masks_fn
((
detections_masks
[:
loop_end_idx
],
boxes
[:
loop_end_idx
]))
# add things segmentation to panoptic masks
# add things segmentation to panoptic masks
for
i
in
range
(
loop_end_idx
):
for
i
in
range
(
loop_end_idx
):
# we process instances in decending order, which will make sure
# we process instances in decending order, which will make sure
...
...
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