Deployment & configuration
Environment variables
Section titled “Environment variables”Web app and proxy
Section titled “Web app and proxy”| Variable | Required | Where | Purpose |
|---|---|---|---|
HF_TOKEN |
✓ | server only | Hugging Face token with read access to the private Space. Never prefix it with VITE_, or Vite embeds it in the browser bundle |
VITE_SPACE_ID |
— | build | Space id (owner/name); default akashch1512/SingleViewHeigthEstimation |
HF_SPACE_URL |
— | server | Override the Space URL derived from VITE_SPACE_ID |
PORT |
— | server | Port for npm run serve (default 8080) |
OVERPASS_USER_AGENT |
— | server | User-Agent for the Overpass relay |
FastAPI service
Section titled “FastAPI service”| Variable | Purpose |
|---|---|
DW_CKPT |
PyTorch checkpoint to load at import |
DW_ONNX |
ONNX graph to load at import (takes precedence over the checkpoint) |
DW_JOBS_DIR |
Job output directory (default outputs/jobs) |
Deploy the web app
Section titled “Deploy the web app”Frontend/vercel.json maps the proxy routes onto serverless functions:
{ "rewrites": [ { "source": "/hf-space/:path*", "destination": "/api/hf-space?__path=:path*" }, { "source": "/overpass/:mirror", "destination": "/api/overpass?__mirror=:mirror" } ], "functions": { "api/hf-space.js": { "maxDuration": 300 }, "api/overpass.js": { "maxDuration": 60 } }}- Import the repository in Vercel and set Root Directory to
Frontend. - Add
HF_TOKEN(and optionallyVITE_SPACE_ID) as environment variables. - Deploy. The build runs
npm run buildand servesdist/.
FROM node:22-alpine AS build # npm ci && vite buildFROM node:22-alpine # copies dist/ + server/, runs as user "node"ENV NODE_ENV=production PORT=8080CMD ["node", "server/serve.mjs"]docker build -t depthwizard-frontend Frontend/docker run -e HF_TOKEN=hf_xxx -p 8080:8080 depthwizard-frontendcd Frontendnpm ci && npm run buildHF_TOKEN=hf_xxx PORT=8080 npm run serveThe model Space
Section titled “The model Space”The hosted model is a private Gradio Space on ZeroGPU. Each call reserves a GPU slot (@spaces.GPU) for 45 s, or 120 s with TTA. GPU time is billed against the daily ZeroGPU quota of the account that owns HF_TOKEN. When it runs out, the app shows GPU quota used up.
Deploy the FastAPI service
Section titled “Deploy the FastAPI service”cd Model_Traning/v5pip install -r requirements.txtpython -m geo.dem --prime scene.tif # optional: cache DEMs for offline useDW_ONNX=/models/depthwizard.onnx uvicorn serve.app:app --host 0.0.0.0 --port 8000Deploy these docs
Section titled “Deploy these docs”The docs site is a static Astro Starlight build in Docs-Site/:
cd Docs-Sitenpm installnpm run dev # http://localhost:4321npm run build # → dist/ (fails on broken internal links)On Vercel, set Root Directory to Docs-Site. The included vercel.json selects the Astro framework preset. Node 22.12 or later is required.
The repository has one GitHub Actions workflow, pr-agent.yml, an automated PR reviewer. It has no build, test or deploy workflows yet.