biigle / magic-sam

:m: BIIGLE module for the Magic SAM image annotation instrument
GNU General Public License v3.0
0 stars 0 forks source link

Error with image shape #18

Closed mzur closed 8 months ago

mzur commented 8 months ago

So there was this error:

    Error while executing python command '/var/www/vendor/biigle/magic-sam/src/config/../resources/scripts/compute_embedding.py '/var/www/storage/magic_sam/sam_chec ▶
    /var/www/vendor/biigle/magic-sam/src/config/../resources/scripts/compute_embedding.py:35: DeprecationWarning: An exception was ignored while fetching the attrib ▶
      input_image = transform.apply_image(np.array(image))
    Traceback (most recent call last):
      File "/var/www/vendor/biigle/magic-sam/src/config/../resources/scripts/compute_embedding.py", line 35, in <module>
        input_image = transform.apply_image(np.array(image))
      File "/opt/conda/lib/python3.10/site-packages/segment_anything/utils/transforms.py", line 30, in apply_image
        target_size = self.get_preprocess_shape(image.shape[0], image.shape[1], self.target_length)
    IndexError: tuple index out of range

I remember errors like this one in other scenarios with grayscale images (that have one dimension less) but I though we were already taking care of that in the script. Is there an image mode that we didn't consider, yet? @dlangenk do you have any idea what's going on?

dlangenk commented 8 months ago

I ran the script on my machine and it works without any problems. It's also a regular RGB image. I found another error in the script though but this is only happening for int32 images. I'll fix it later. We're talking about image 2140218 don't we?

mzur commented 8 months ago

We're talking about image 2140218 don't we?

Yes. If it works for you then maybe there was an issue with the image cache and the image file was corrupt. I resubmitted the failed job and it seems to have worked now. Thanks for checking.