Fix inference route to /infer and update frontend
Browse filesFiles changed (2)
- app.py+1-1
- frontend/pages/analyze.jsx+1-1
388 unmodified lines389390391392393394395388 unmodified linesapp.mount("/", StaticFiles(directory=FRONTEND_DIST, html=True), name="frontend")@app.post("/api/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.")388 unmodified lines389390391392393394395388 unmodified linesapp.mount("/", StaticFiles(directory=FRONTEND_DIST, html=True), name="frontend")@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 lines5051525354555649 unmodified linesconst formData = new FormData();formData.append("video", videoFile);const base = backendUrl || ""; // empty means same originconst url = `${base}/api/infer?frame_rate=5&max_frames=50`;const res = await fetch(url, { method: "POST", body: formData });if (!res.ok) {const text = await res.text();49 unmodified lines5051525354555649 unmodified linesconst formData = new FormData();formData.append("video", videoFile);const base = backendUrl || ""; // empty means same originconst 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