mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-02 03:01:07 +06:00
[SAM
] fix sam slow test (#23376)
* fix sam slow test * oops * fix error message
This commit is contained in:
parent
22a0769933
commit
3d3c7d4213
@ -208,7 +208,7 @@ class SamProcessor(ProcessorMixin):
|
|||||||
input_points = input_points.numpy().tolist()
|
input_points = input_points.numpy().tolist()
|
||||||
|
|
||||||
if not isinstance(input_points, list) or not isinstance(input_points[0], list):
|
if not isinstance(input_points, list) or not isinstance(input_points[0], list):
|
||||||
raise ValueError("Input points must be a list of list of floating integers.")
|
raise ValueError("Input points must be a list of list of floating points.")
|
||||||
input_points = [np.array(input_point) for input_point in input_points]
|
input_points = [np.array(input_point) for input_point in input_points]
|
||||||
else:
|
else:
|
||||||
input_points = None
|
input_points = None
|
||||||
@ -232,7 +232,7 @@ class SamProcessor(ProcessorMixin):
|
|||||||
or not isinstance(input_boxes[0], list)
|
or not isinstance(input_boxes[0], list)
|
||||||
or not isinstance(input_boxes[0][0], list)
|
or not isinstance(input_boxes[0][0], list)
|
||||||
):
|
):
|
||||||
raise ValueError("Input boxes must be a list of list of list of floating integers.")
|
raise ValueError("Input boxes must be a list of list of list of floating points.")
|
||||||
input_boxes = [np.array(box).astype(np.float32) for box in input_boxes]
|
input_boxes = [np.array(box).astype(np.float32) for box in input_boxes]
|
||||||
else:
|
else:
|
||||||
input_boxes = None
|
input_boxes = None
|
||||||
|
@ -481,7 +481,7 @@ class SamModelIntegrationTest(unittest.TestCase):
|
|||||||
model.eval()
|
model.eval()
|
||||||
|
|
||||||
raw_image = prepare_image()
|
raw_image = prepare_image()
|
||||||
input_boxes = [[650, 900, 1000, 1250]]
|
input_boxes = [[[650, 900, 1000, 1250]]]
|
||||||
input_points = [[[820, 1080]]]
|
input_points = [[[820, 1080]]]
|
||||||
|
|
||||||
inputs = processor(
|
inputs = processor(
|
||||||
@ -541,7 +541,7 @@ class SamModelIntegrationTest(unittest.TestCase):
|
|||||||
model.eval()
|
model.eval()
|
||||||
|
|
||||||
raw_image = prepare_image()
|
raw_image = prepare_image()
|
||||||
input_boxes = [[620, 900, 1000, 1255]]
|
input_boxes = [[[620, 900, 1000, 1255]]]
|
||||||
input_points = [[[820, 1080]]]
|
input_points = [[[820, 1080]]]
|
||||||
labels = [[0]]
|
labels = [[0]]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user