Open andysingal opened 1 year ago
How to run on multiple images at the same time?
import supervision as sv TEXT_PROMPT = "fox" BOX_TRESHOLD = 0.35 TEXT_TRESHOLD = 0.25 TEXT_THRESHOLD = 0.25 TEXT_PROMPT = "fox . background" MODEL_TYPE = "vit_h" # default IMAGE_PATH = f"/workspace/data/fox.jpg" IMAGE_NAME = IMAGE_PATH.split("/")[-1] image_source, image = load_image(IMAGE_PATH) boxes, logits, phrases = predict( model=model, image=image, caption=TEXT_PROMPT, box_threshold=BOX_TRESHOLD, text_threshold=TEXT_TRESHOLD ) annotated_frame = annotate(image_source=image_source, boxes=boxes, logits=logits, phrases=phrases) %matplotlib inline sv.plot_image(annotated_frame, (16, 16))
ERROR:
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[24], line 16 12 IMAGE_PATH = f"/workspace/data/fox.jpg" 14 IMAGE_NAME = IMAGE_PATH.split("/")[-1] ---> 16 image_source, image = load_image(IMAGE_PATH) 18 boxes, logits, phrases = predict( 19 model=model, 20 image=image, (...) 23 text_threshold=TEXT_TRESHOLD 24 ) 26 annotated_frame = annotate(image_source=image_source, boxes=boxes, logits=logits, phrases=phrases) TypeError: cannot unpack non-iterable Image object
Maybe you can only try for loop
to reach this now, because we did not support batch-inference yet I think
Thanks Ren for your instant reply, would be nice to have support . Looking forward to it.
On Sat, Sep 9, 2023 at 9:58 PM Ren Tianhe @.***> wrote:
How to run on multiple images at the same time?
import supervision as sv
TEXT_PROMPT = "fox" BOX_TRESHOLD = 0.35 TEXT_TRESHOLD = 0.25 TEXT_THRESHOLD = 0.25 TEXT_PROMPT = "fox . background"
MODEL_TYPE = "vit_h" # default
IMAGE_PATH = f"/workspace/data/fox.jpg"
IMAGE_NAME = IMAGE_PATH.split("/")[-1]
image_source, image = load_image(IMAGE_PATH)
boxes, logits, phrases = predict( model=model, image=image, caption=TEXT_PROMPT, box_threshold=BOX_TRESHOLD, text_threshold=TEXT_TRESHOLD )
annotated_frame = annotate(image_source=image_source, boxes=boxes, logits=logits, phrases=phrases)
%matplotlib inline sv.plot_image(annotated_frame, (16, 16))
ERROR:
TypeError Traceback (most recent call last) Cell In[24], line 16 12 IMAGE_PATH = f"/workspace/data/fox.jpg" 14 IMAGE_NAME = IMAGE_PATH.split("/")[-1] ---> 16 image_source, image = load_image(IMAGE_PATH) 18 boxes, logits, phrases = predict( 19 model=model, 20 image=image, (...) 23 text_threshold=TEXT_TRESHOLD 24 ) 26 annotated_frame = annotate(image_source=image_source, boxes=boxes, logits=logits, phrases=phrases)
TypeError: cannot unpack non-iterable Image object
Maybe you can only try for loop to reach this now, because we did not support batch-inference yet I think
— Reply to this email directly, view it on GitHub https://github.com/IDEA-Research/Grounded-Segment-Anything/issues/373#issuecomment-1712549234, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4LJNOBQUMIIIKBA6ATDIDXZSKLBANCNFSM6AAAAAA4RIPVSY . You are receiving this because you authored the thread.Message ID: @.***>
How to run on multiple images at the same time?
ERROR: