Spaces:
Sleeping
Sleeping
Sync from GitHub via hub-sync
Browse filesFiles changed (3)
- Dockerfile+8-1
- README.md+28-11
- docker-compose.yml+6-2
5 unmodified lines6789101116 unmodified lines282930315 unmodified linesPYTHONPATH=/app/src \FACEVERIFICATION_DEVICE=cpuWORKDIR /appRUN apt-get update && apt-get install -y --no-install-recommends \16 unmodified linesEXPOSE 8000 7860CMD ["uvicorn", "faceverification.interfaces.fastapi_app:app", "--host", "0.0.0.0", "--port", "8000"]5 unmodified lines6789101112131416 unmodified lines31323334353637385 unmodified linesPYTHONPATH=/app/src \FACEVERIFICATION_DEVICE=cpuARG APP_VARIANT=gradioENV APP_VARIANT=${APP_VARIANT}WORKDIR /appRUN apt-get update && apt-get install -y --no-install-recommends \16 unmodified linesEXPOSE 8000 7860CMD if [ "$APP_VARIANT" = "fastapi" ]; then \exec uvicorn faceverification.interfaces.fastapi_app:app --host 0.0.0.0 --port 8000; \else \exec python -m faceverification.interfaces.gradio_app; \fi
2 unmodified lines345678910111217 unmodified lines303132333435361 unmodified line383940414243444513 unmodified lines5960616263646532 unmodified lines989910010110210310410537 unmodified lines14314414514614714814949 unmodified lines1992002012022032042052062072082092 unmodified linesemoji: 🧠colorFrom: bluecolorTo: greensdk: gradiosdk_version: 6.14.0python_version: '3.11'app_file: app.pyshort_description: "Face verification demo with FaceNet and VectorDB"tags: ["face-verification", "computer-vision", "facenet", "vector-database"]pinned: false17 unmodified lines- FaceNet embedding extraction with PyTorch- Similarity search with ChromaDB- Interactive Gradio UI with add-person and verify-identity flows- Hugging Face Spaces deployment-ready structure## Tech Stack1 unmodified line- PyTorch- FaceNet / facenet-pytorch- ChromaDB- Gradio- Hugging Face Spaces## Run Locally13 unmodified lines## FastAPI InterfaceThe project also includes an HTTP API for the same enroll-and-verify workflow.Run it locally with:```bash32 unmodified lines## Deployment NotesFor a containerized deployment, the recommended baseline is the FastAPIcontainer running Uvicorn:```bashuvicorn faceverification.interfaces.fastapi_app:app --host 0.0.0.0 --port 800037 unmodified linesThe Gradio UI will be available at http://localhost:7860.Both services use the same image. By default, ChromaDB runs in memory, soenrolled faces are ephemeral and disappear when the container restarts. This isintentional for the demo baseline.49 unmodified lines```textsrc/faceverification/app.pyconfig.pycore/image_processor.pyvectordb.pyservices/face_verification.py```2 unmodified lines34567891017 unmodified lines28293031323334351 unmodified line3738394041424344454613 unmodified lines6061626364656632 unmodified lines9910010110210310410510637 unmodified lines14414514614714814915015115215315415515615715815916016116216316449 unmodified lines2142152162172182192202212222232242252262 unmodified linesemoji: 🧠colorFrom: bluecolorTo: greensdk: dockerapp_port: 7860short_description: "Face verification demo with FaceNet and VectorDB"tags: ["face-verification", "computer-vision", "facenet", "vector-database"]pinned: false17 unmodified lines- FaceNet embedding extraction with PyTorch- Similarity search with ChromaDB- Interactive Gradio UI with add-person and verify-identity flows- FastAPI interface for containerized API deployments- Docker-based Hugging Face Space deployment## Tech Stack1 unmodified line- PyTorch- FaceNet / facenet-pytorch- ChromaDB- FastAPI- Gradio- Docker / GHCR- Hugging Face Spaces Docker SDK## Run Locally13 unmodified lines## FastAPI InterfaceThe project includes an HTTP API for the same enroll-and-verify workflow.Run it locally with:```bash32 unmodified lines## Deployment NotesFor API deployments, the recommended baseline is the FastAPI container runningUvicorn:```bashuvicorn faceverification.interfaces.fastapi_app:app --host 0.0.0.0 --port 800037 unmodified linesThe Gradio UI will be available at http://localhost:7860.Both services are built from the same `Dockerfile` with different variants:- `fastapi`: published to GHCR by the container workflow.- `gradio`: used by the Hugging Face Docker Space.The published FastAPI image is tagged as:```textghcr.io/leandrodevai/faceverification:fastapi```Each successful container workflow also publishes an immutable SHA tag with the`fastapi-sha-*` prefix.By default, ChromaDB runs in memory, soenrolled faces are ephemeral and disappear when the container restarts. This isintentional for the demo baseline.49 unmodified lines```textsrc/faceverification/config.pycore/image_processor.pyvectordb.pyinterfaces/fastapi_app.pygradio_app.pyservices/face_verification.py```
1 unmodified line234567812 unmodified lines212223242526271 unmodified lineapi:build:context: .image: faceverificationcommand: uvicorn faceverification.interfaces.fastapi_app:app --host 0.0.0.0 --port 8000ports:- "8000:8000"12 unmodified linesgradio:build:context: .image: faceverificationcommand: python -m faceverification.interfaces.gradio_appprofiles:- gradio1 unmodified line234567891012 unmodified lines2324252627282930311 unmodified lineapi:build:context: .args:APP_VARIANT: fastapiimage: faceverification:fastapicommand: uvicorn faceverification.interfaces.fastapi_app:app --host 0.0.0.0 --port 8000ports:- "8000:8000"12 unmodified linesgradio:build:context: .args:APP_VARIANT: gradioimage: faceverification:gradiocommand: python -m faceverification.interfaces.gradio_appprofiles:- gradio
Dockerfile+8-1
README.md+28-11
docker-compose.yml+6-2