INNER CODE UNIT · Python
full_path
virajmavani/semi-auto-image-annotation-tool · web/backend/main.py:127
full_path = (current_dataset_dir / filename).resolve()
# Ensure resolved path is still within dataset directory
if not str(full_path).startswith(str(current_dataset_dir.resolve())):
raise HTTPException(status_code=400, detail="Invalid path")
if not full_path.exists():
raise HTTPException(status_code=404, detail="Image not found")
return full_path
class BoundingBox(BaseModel):
x1: int
y1: int
x2: int
y2: int
label: str