odysseus-dev/odysseus · error · HTTPException

Installed Transformers does not expose OWL-ViT object detect

Error message

Installed Transformers does not expose OWL-ViT object detection post-processing

What it means

Error "Installed Transformers does not expose OWL-ViT object detection post-processing" thrown in odysseus-dev/odysseus.

Source

Thrown at routes/gallery/gallery_routes.py:182

        model_inputs = _model_inputs_to_device(inputs, device, torch)
        with torch.no_grad():
            outputs = model(**model_inputs)
        target_sizes = torch.tensor([[image.height, image.width]])
        if hasattr(processor, "post_process_object_detection"):
            results = processor.post_process_object_detection(
                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"],
        }

View on GitHub (pinned to f9235ebbf1)

Solutions

  1. Upgrade or downgrade Transformers to a version that exposes OWL-ViT post-processing.
  2. Reinstall the mask tools dependencies to get a compatible Transformers version.

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/9718091cbff37375. Report an issue: GitHub.