You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So looking at the error you're encountering, this may be because the numpy.ndarray object does not have a convert method, which is used for PIL images. To fix this issue for the Phi-3.5 Vision model, you need to convert your NumPy arrays to PIL images before processing them.
Here's how you can do it:
Convert NumPy Arrays to PIL Images: Use the Image.fromarray method from the PIL library to convert your NumPy arrays to PIL images.
fromPILimportImageimportnumpyasnp# Example NumPy arraynumpy_array=np.random.randint(0, 255, (336, 336, 3), dtype=np.uint8)
# Convert NumPy array to PIL imagepil_image=Image.fromarray(numpy_array)
Process the Images: Once you have the PIL images, you can proceed with the rest of your data processing pipeline.
As shown in the previous image, the model hosted in huggingface cannot deal with numpy arrays.
I will contribute on huggingface and also on this repository for the correct documentation.
The text was updated successfully, but these errors were encountered: