Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segment Anything: Interaction Error Occurred: Request Failed with Status Code 500 #6598

Closed
2 tasks done
vignesh-Ag opened this issue Aug 1, 2023 · 3 comments · Fixed by #6789
Closed
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@vignesh-Ag
Copy link

vignesh-Ag commented Aug 1, 2023

My actions before raising this issue

Steps to Reproduce (for bugs)

  1. Install 2.5.2 cvat version in Ubuntu 22.04
  2. Then, install the SAM using the serverless command mentioned in CVAT document
  3. Create a project, task and then upload few .tiff images in a task.

Expected Behaviour

Using SAM to generate the mask/polygon.

Current Behaviour

I have a job that consists of tiff images. For some of the images, the SAM interaction is working without any issue. However, on some, it's throwing the below error:

image

Then I checked the Grafana tool to trace the problem. Here is log:

Traceback (most recent call last):
File "/opt/venv/lib/python3.10/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "/home/django/cvat/apps/lambda_manager/views.py", line 808, in func_wrapper
data = func(*args, **kwargs)
File "/home/django/cvat/apps/lambda_manager/views.py", line 899, in call
return lambda_func.invoke(db_task, request.data, db_job=job, is_interactive=True, request=request)
File "/home/django/cvat/apps/lambda_manager/views.py", line 302, in invoke
"image": self._get_image(db_task, mandatory_arg("frame"), quality),
File "/home/django/cvat/apps/lambda_manager/views.py", line 410, in _get_image
image = frame_provider.get_frame(frame, quality=quality)
File "/home/django/cvat/apps/engine/frame_provider.py", line 196, in get_frame
chunk_reader = loader.load(chunk_number)
File "/home/django/cvat/apps/engine/frame_provider.py", line 86, in load
self.reader_class([self.get_chunk_path(chunk_id, self.quality, self.db_data)[0]]))
File "/home/django/cvat/apps/engine/cache.py", line 57, in get_task_chunk_data_with_mime
item = self._get_or_set_cache_item(
File "/home/django/cvat/apps/engine/cache.py", line 49, in _get_or_set_cache_item
item = create_function()
File "/home/django/cvat/apps/engine/cache.py", line 59, in
create_function=lambda: self._prepare_task_chunk(db_data, quality, chunk_number),
File "/home/django/cvat/apps/engine/cache.py", line 181, in _prepare_task_chunk
writer.save_as_chunk(images, buff)
File "/home/django/cvat/apps/engine/media_extractors.py", line 665, in save_as_chunk
pil_image.save(output, format=pil_image.format if pil_image.format else self.IMAGE_EXT, quality=100, subsampling=0)
File "/opt/venv/lib/python3.10/site-packages/PIL/Image.py", line 2353, in save
save_handler(self, fp, filename)
File "/opt/venv/lib/python3.10/site-packages/PIL/TiffImagePlugin.py", line 1770, in _save
raise ValueError(
ValueError: quality setting only supported for 'jpeg' compression

Possible Solution

Context

Your Environment

  • Git hash commit (git log -1):
  • Docker version docker version (e.g. Docker 17.0.05):
  • Are you using Docker Swarm or Kubernetes?
  • Operating System and version (e.g. Linux, Windows, MacOS):
  • Code example or link to GitHub repo or gist to reproduce problem:
  • Other diagnostic information / logs:
    Logs from `cvat` container
@bsekachev
Copy link
Member

Hi @vignesh-Ag

Are you working with .tiff images?

@vignesh-Ag
Copy link
Author

Hi @vignesh-Ag

Are you working with .tiff images?

Yes. After updating CVAT to version 2.5.2, SAM is functioning correctly for some of the existing images, but not for others. Unfortunately, when attempting to upload new TIFF images, SAM fails to work entirely.

@bsekachev
Copy link
Member

Looks like Tiff images can be compressed using different ways, and the quality parameter is supported only for JPEG compression, finally the library raises the error. Need to investigate better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants