File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -573,7 +573,9 @@ def predict(
573573
574574 self .boxes = input_boxes
575575
576- if boxes is None or (not isinstance (boxes [0 ], list )):
576+ if boxes is None or (len (boxes ) == 1 ) or (len (boxes ) == 4 and isinstance (boxes [0 ], float )):
577+ if isinstance (boxes , list ) and isinstance (boxes [0 ], list ):
578+ boxes = boxes [0 ]
577579 masks , scores , logits = predictor .predict (
578580 point_coords ,
579581 point_labels ,
Original file line number Diff line number Diff line change @@ -570,7 +570,9 @@ def predict(
570570
571571 self .boxes = input_boxes
572572
573- if boxes is None or (not isinstance (boxes [0 ], list )):
573+ if boxes is None or (len (boxes ) == 1 ) or (len (boxes ) == 4 and isinstance (boxes [0 ], float )):
574+ if isinstance (boxes , list ) and isinstance (boxes [0 ], list ):
575+ boxes = boxes [0 ]
574576 masks , scores , logits = predictor .predict (
575577 point_coords ,
576578 point_labels ,
You can’t perform that action at this time.
0 commit comments