{"record":{"id":"332716a7f606dc36","repo":"odysseus-dev/odysseus","slug":"missing-object-text","errorCode":null,"errorMessage":"Missing object text","messagePattern":"Missing object text","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"routes/gallery/gallery_routes.py","lineNumber":152,"sourceCode":"        device == \"mps\"\n        and hasattr(torch, \"float64\")\n        and getattr(value, \"dtype\", None) == torch.float64\n    ):\n        return value.to(device=device, dtype=torch.float32)\n    return value.to(device)\n\n\ndef _model_inputs_to_device(inputs, device: str, torch) -> Dict[str, Any]:\n    return {\n        key: _model_input_to_device(value, device, torch)\n        for key, value in inputs.items()\n    }\n\n\ndef _ground_text_to_box(image, text: str, *, threshold: float = 0.05):\n    query = (text or \"\").strip()\n    if not query:\n        raise HTTPException(400, \"Missing object text\")\n    backend = _load_grounding_backend()\n    torch = backend[\"torch\"]\n    processor = backend[\"processor\"]\n    model = backend[\"model\"]\n    device = backend[\"device\"]\n\n    labels = [query]\n    if not query.lower().startswith((\"a \", \"an \", \"the \")):\n        labels.append(f\"a photo of {query}\")\n    try:\n        inputs = processor(text=[labels], images=image, return_tensors=\"pt\")\n        model_inputs = _model_inputs_to_device(inputs, device, torch)\n        with torch.no_grad():\n            outputs = model(**model_inputs)\n        target_sizes = torch.tensor([[image.height, image.width]])\n        if hasattr(processor, \"post_process_object_detection\"):\n            results = processor.post_process_object_detection(\n                outputs=outputs,","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/gallery/gallery_routes.py#L134-L170","documentation":"Error \"Missing object text\" thrown in odysseus-dev/odysseus.","triggerScenarios":"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.","commonSituations":"See trigger scenarios.","solutions":["Enter a text description of the object to mask.","Provide non-empty object text in the request payload."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}