A fast, easy-to-use, production-ready inference server for computer vision supporting deployment of many popular model architectures and fine-tuned models.
from typing import List
from inference import get_model
from inference.core.entities.responses.inference import InstanceSegmentationInferenceResponse
model = get_model(model_id="chess-pieces-and-chess-board-instance-segmentation/1")
results: List[InstanceSegmentationInferenceResponse] = model.infer(["20240423_121344.jpg", "20240423_121349.jpg"])
Exception:
Traceback (most recent call last):
File "/path/to/inference/inference/core/models/instance_segmentation_base.py", line 97, in infer
return super().infer(
File "/path/to/inference/inference/core/models/roboflow.py", line 627, in infer
return super().infer(image, **kwargs)
File "/path/to/inference/inference/core/models/base.py", line 28, in infer
postprocessed = self.postprocess(predicted_arrays, returned_metadata, **kwargs)
File "/path/to/inference/inference/core/models/instance_segmentation_base.py", line 134, in postprocess
predictions = np.array(predictions)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.
Type of change
Please delete options that are not relevant.
[x] Bug fix (non-breaking change which fixes an issue)
How has this change been tested, please provide a testcase or example of how you tested the change?
Executed above script with two images where each image is resulting in different number of segmentations and exception is not thrown anymore
Description
Below example results in error:
Exception:
Type of change
Please delete options that are not relevant.
How has this change been tested, please provide a testcase or example of how you tested the change?
Executed above script with two images where each image is resulting in different number of segmentations and exception is not thrown anymore
Any specific deployment considerations
N/A
![20240423_121349](https://github.com/roboflow/inference/assets/166530809/f0da3eb5-cb2f-45cd-8b61-0cece473fc19)
Docs
N/A