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
7e2f7a35
"vscode:/vscode.git/clone" did not exist on "95e93430de5fc6f78964239d2b96c5b9acbf0159"
Unverified
Commit
7e2f7a35
authored
Sep 12, 2021
by
srihari-humbarwadi
Browse files
check `valid_indices` shape
parent
603d702d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
40 deletions
+46
-40
official/vision/beta/projects/panoptic_maskrcnn/modeling/layers/panoptic_segmentation_generator.py
...skrcnn/modeling/layers/panoptic_segmentation_generator.py
+46
-40
No files found.
official/vision/beta/projects/panoptic_maskrcnn/modeling/layers/panoptic_segmentation_generator.py
View file @
7e2f7a35
...
@@ -163,7 +163,13 @@ class PanopticSegmentationGenerator(tf.keras.layers.Layer):
...
@@ -163,7 +163,13 @@ class PanopticSegmentationGenerator(tf.keras.layers.Layer):
# filter instances with low confidence
# filter instances with low confidence
sorted_scores
=
tf
.
sort
(
scores
,
direction
=
'DESCENDING'
)
sorted_scores
=
tf
.
sort
(
scores
,
direction
=
'DESCENDING'
)
loop_end_idx
=
tf
.
where
(
sorted_scores
>
self
.
_score_threshold
)[
-
1
,
0
]
+
1
valid_indices
=
tf
.
where
(
sorted_scores
>
self
.
_score_threshold
)
# if no instance has sufficient confidence score, skip merging
# instance segmentation masks
if
tf
.
shape
(
valid_indices
)[
0
]
>
0
:
loop_end_idx
=
valid_indices
[
-
1
,
0
]
+
1
loop_end_idx
=
tf
.
minimum
(
loop_end_idx
=
tf
.
minimum
(
tf
.
cast
(
loop_end_idx
,
dtype
=
tf
.
int32
),
tf
.
cast
(
loop_end_idx
,
dtype
=
tf
.
int32
),
self
.
_max_num_detections
)
self
.
_max_num_detections
)
...
...
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