{"record":{"id":"e82872be26fae62a","repo":"odysseus-dev/odysseus","slug":"object-mask-tools-are-not-installed-install-cookb","errorCode":null,"errorMessage":"Object mask tools are not installed. Install Cookbook Dependencies -> SAM mask tools.","messagePattern":"Object mask tools are not installed\\. Install Cookbook Dependencies -> SAM mask tools\\.","errorType":"http","errorClass":"HTTPException","httpStatus":501,"severity":"error","filePath":"routes/gallery/gallery_routes.py","lineNumber":103,"sourceCode":"        model.eval()\n    except Exception as exc:\n        raise HTTPException(500, f\"Failed to load SAM model {model_id}: {exc}\") from exc\n\n    cached = {\"torch\": torch, \"processor\": processor, \"model\": model, \"device\": device, \"model_id\": model_id}\n    _SAM_STATE[model_id] = cached\n    return cached\n\n\ndef _load_grounding_backend():\n    model_id = os.getenv(\"ODYSSEUS_GROUNDING_MODEL\", \"google/owlvit-base-patch32\")\n    cached = _GROUNDING_STATE.get(model_id)\n    if cached:\n        return cached\n    try:\n        import torch\n        from transformers import OwlViTForObjectDetection, OwlViTProcessor\n    except Exception as exc:\n        raise HTTPException(\n            501,\n            \"Object mask tools are not installed. Install Cookbook Dependencies -> SAM mask tools.\",\n        ) from exc\n\n    device = \"cpu\"\n    try:\n        if torch.cuda.is_available():\n            device = \"cuda\"\n        elif getattr(torch.backends, \"mps\", None) and torch.backends.mps.is_available():\n            device = \"mps\"\n    except Exception:\n        device = \"cpu\"\n\n    try:\n        processor = OwlViTProcessor.from_pretrained(model_id)\n        model = OwlViTForObjectDetection.from_pretrained(model_id)\n        model.to(device)\n        model.eval()","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/gallery/gallery_routes.py#L85-L121","documentation":"Error \"Object mask tools are not installed. Install Cookbook Dependencies -> SAM mask tools.\" 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":["Install the object mask tools via Cookbook Dependencies → SAM mask tools.","Restart the server after installing the dependencies."],"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-15T22:17:37.221Z"}