Unverified Commit 7e2f7a35 authored by srihari-humbarwadi's avatar srihari-humbarwadi
Browse files

check `valid_indices` shape

parent 603d702d
......@@ -163,7 +163,13 @@ class PanopticSegmentationGenerator(tf.keras.layers.Layer):
# filter instances with low confidence
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(
tf.cast(loop_end_idx, dtype=tf.int32),
self._max_num_detections)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment