Fix inference route to /infer and update frontend
Browse filesFiles changed (2)
- app.py+1-1
- frontend/pages/analyze.jsx+1-1
388 unmodified lines389390391392392393394395388 unmodified lines app.mount("/", StaticFiles(directory=FRONTEND_DIST, html=True), name="frontend")
@app.post("/api/infer")@app.post("/infer")async def infer(video: UploadFile = File(...), frame_rate: int = 5, max_frames: int = 50) -> dict: if video.content_type is None or not video.content_type.startswith("video/"): raise HTTPException(status_code=400, detail="Please upload a valid video file.")49 unmodified lines505152535354555649 unmodified lines const formData = new FormData(); formData.append("video", videoFile); const base = backendUrl || ""; // empty means same origin const url = `${base}/api/infer?frame_rate=5&max_frames=50`; const url = `${base}/infer?frame_rate=5&max_frames=50`; const res = await fetch(url, { method: "POST", body: formData }); if (!res.ok) { const text = await res.text();app.py+1-1
frontend/pages/analyze.jsx+1-1