odysseus-dev/odysseus · error · HTTPException

No visible object matched

Error message

No visible object matched '{query}'

What it means

404 from _ground_text_to_box: the OWL-ViT detector ran on the image but produced no detection box above the confidence threshold for the query text. Means the requested object simply was not found in the image (or threshold too strict), not a system failure.

Solutions

  1. Rephrase the object description to match something visible in the image.
  2. Try a simpler or more general query term.
Defensive patterns

Strategy: validation

When it happens

Trigger: Triggered when the corresponding server-side validation or runtime check at the recorded location rejects the request or operation and returns this error message to the caller.

Common situations: See trigger scenarios.


AI-assisted analysis of odysseus-dev/odysseus@f9235ebbf1 (2026-08-14). Data as JSON: /api/errors/5c78ce2a499a67ed. Report an issue: GitHub.

Appendix: source

Thrown at routes/gallery/gallery_routes.py:188

                outputs=outputs,
                target_sizes=target_sizes,
                threshold=float(threshold),
            )
        elif hasattr(processor, "post_process_grounded_object_detection"):
            results = processor.post_process_grounded_object_detection(
                outputs=outputs,
                target_sizes=target_sizes,
                threshold=float(threshold),
                text_labels=[labels],
            )
        else:
            raise HTTPException(500, "Installed Transformers does not expose OWL-ViT object detection post-processing")
        boxes = results[0].get("boxes")
        scores = results[0].get("scores")
        labels_idx = results[0].get("labels")
        text_labels = results[0].get("text_labels") or results[0].get("labels_text")
        if boxes is None or scores is None or len(boxes) == 0:
            raise HTTPException(404, f"No visible object matched '{query}'")
        idx = int(torch.argmax(scores).item())
        box = [float(v) for v in boxes[idx].detach().cpu().tolist()]
        label_idx = int(labels_idx[idx].detach().cpu().item()) if labels_idx is not None and len(labels_idx) else 0
        label = labels[min(label_idx, len(labels) - 1)]
        if text_labels and len(text_labels) > idx:
            label = str(text_labels[idx])
        return {
            "box": box,
            "score": float(scores[idx].detach().cpu().item()),
            "label": label,
            "model": backend["model_id"],
        }
    except HTTPException:
        raise
    except Exception as exc:
        logger.exception("ground_text_to_box failed")
        raise HTTPException(500, f"Object mask failed: {exc}") from exc

View on GitHub (pinned to f9235ebbf1)