From c75a09be832847630f7de6b68a4f3ed32c717140 Mon Sep 17 00:00:00 2001 From: CalamitousFelicitousness Date: Thu, 4 Dec 2025 21:48:06 +0000 Subject: [PATCH] fix(vqa): handle Moondream point and detect tasks Add handlers for "Point at..." and "Detect..." tasks in moondream() that were falling through to answer_question() and failing. --- modules/interrogate/vqa.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/interrogate/vqa.py b/modules/interrogate/vqa.py index d1e876ef4..a27a53fa1 100644 --- a/modules/interrogate/vqa.py +++ b/modules/interrogate/vqa.py @@ -1111,11 +1111,16 @@ def moondream(question: str, image: Image.Image, repo: str = None, model_name: s response = model.caption(image, length="normal")['caption'] elif question == 'MORE DETAILED CAPTION': response = model.caption(image, length="long")['caption'] + elif question.lower().startswith('point at '): + target = question[9:] + result = model.point(image, target) + response = str(result) + elif question.lower().startswith('detect '): + target = question[7:] + result = model.detect(image, target) + response = str(result) else: response = model.answer_question(encoded, question, processor)['answer'] - # model.detect(image, "face") - # model.point(image, "person") - # model.detect_gaze(image) return response