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

Bug at generate marks #14

Open
1 of 2 tasks
jyC23333 opened this issue Dec 1, 2023 · 9 comments
Open
1 of 2 tasks

Bug at generate marks #14

jyC23333 opened this issue Dec 1, 2023 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@jyC23333
Copy link

jyC23333 commented Dec 1, 2023

Search before asking

  • I have searched the Multimodal Maestro issues and found no similar bug report.

Bug

Traceback (most recent call last):
File "/data/megvii/projects/Qwen-VL/scripts/test_maestro.py", line 7, in
marks = generator.generate(image=image)
File "/data/Anaconda/anaconda3/envs/autogpt/lib/python3.10/site-packages/maestro/markers/sam.py", line 44, in generate
return masks_to_marks(masks=masks)
File "/data/Anaconda/anaconda3/envs/autogpt/lib/python3.10/site-packages/maestro/postprocessing/mask.py", line 187, in masks_to_marks
return sv.Detections(
File "", line 8, in init
File "/data/Anaconda/anaconda3/envs/autogpt/lib/python3.10/site-packages/supervision/detection/core.py", line 89, in post_init
_validate_mask(mask=self.mask, n=n)
File "/data/Anaconda/anaconda3/envs/autogpt/lib/python3.10/site-packages/supervision/detection/core.py", line 29, in _validate_mask
raise ValueError("mask must be 3d np.ndarray with (n, H, W) shape")
ValueError: mask must be 3d np.ndarray with (n, H, W) shape

Environment

Ubuntu 20.04
python=3.10.10

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@jyC23333 jyC23333 added the bug Something isn't working label Dec 1, 2023
@SkalskiP
Copy link
Collaborator

SkalskiP commented Dec 1, 2023

Hi @jyC23333! 👋🏻 Could you share the code you run and image you used? Basically something more so I can understand better what happens?

@jyC23333
Copy link
Author

jyC23333 commented Dec 1, 2023

Hi,@SkalskiP ,my code shows below:

import cv2
import maestro

image = cv2.imread('./鲫鱼.png')

generator = maestro.SegmentAnythingMarkGenerator(device='cuda')
marks = generator.generate(image=image)
marks = maestro.refine_marks(marks=marks)

mark_visualizer = maestro.MarkVisualizer()
marked_image = mark_visualizer.visualize(image=image, marks=marks)

something wrong at this line:

marks = generator.generate(image=image)

original image:
鲫鱼

@SkalskiP
Copy link
Collaborator

SkalskiP commented Dec 1, 2023

Thanks @jyC23333. I'll get back to you!

@SkalskiP
Copy link
Collaborator

SkalskiP commented Dec 1, 2023

Hi @jyC23333 👋🏻 I just tested using the latest version of maestro, and everything works.

Take a look at this Colab.

Make sure to use the 0.1.1rc1 version. Please let me know if that helped.

@SkalskiP SkalskiP self-assigned this Dec 1, 2023
@jyC23333
Copy link
Author

jyC23333 commented Dec 3, 2023

@SkalskiP Hi,the bug still exists with the latest version.
image

This is my cuda info:
image

And I'm using torch 2.1.0:
image

@SkalskiP
Copy link
Collaborator

SkalskiP commented Dec 4, 2023

Hi @jyC23333, the bug doesn't exist in the Colab I sent you, so it must be environment-dependent. What version of transformers and supervision you have?

@jyC23333
Copy link
Author

jyC23333 commented Dec 5, 2023

@SkalskiP Hi,the dependent info is:
image
image

@hvaria
Copy link

hvaria commented Mar 19, 2024

To address the bug, add debug logs around self.pipeline in generate to check data shapes and integrity. Monitor GPU usage to ensure no memory overflow—silent issues may not trigger clear error messages

@SkalskiP
Copy link
Collaborator

I'm very sorry, but I'm extremely busy. I'll try to look at it as soon as possible.

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

No branches or pull requests

3 participants