File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
official/vision/modeling/layers Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -661,9 +661,11 @@ def __call__(self,
661
661
decoded_boxes = box_ops .decode_boxes (
662
662
raw_boxes , anchor_boxes , weights = regression_weights )
663
663
664
- # Box clipping
665
- decoded_boxes = box_ops .clip_boxes (
666
- decoded_boxes , tf .expand_dims (image_shape , axis = 1 ))
664
+ # Box clipping.
665
+ if image_shape is not None :
666
+ decoded_boxes = box_ops .clip_boxes (
667
+ decoded_boxes , tf .expand_dims (image_shape , axis = 1 )
668
+ )
667
669
668
670
if bbox_per_class :
669
671
decoded_boxes = tf .reshape (
@@ -835,8 +837,10 @@ def _decode_multilevel_outputs(
835
837
boxes_i = box_ops .decode_boxes (raw_boxes_i , anchor_boxes_i )
836
838
837
839
# Box clipping.
838
- boxes_i = box_ops .clip_boxes (
839
- boxes_i , tf .expand_dims (image_shape , axis = 1 ))
840
+ if image_shape is not None :
841
+ boxes_i = box_ops .clip_boxes (
842
+ boxes_i , tf .expand_dims (image_shape , axis = 1 )
843
+ )
840
844
841
845
boxes .append (boxes_i )
842
846
scores .append (scores_i )
You can’t perform that action at this time.
0 commit comments