Skip to content

sense-opensource/sense-liveness-checks

Liveness Detection: Sense

Welcome to Sense’s open source repository

This project serves an anti-spoofing detection API built using FastAPI. It analyzes facial images and predicts whether they are Real or Spoof using a set of trained models.

Quick Start

1. Prerequisites

[Docker](https://www.docker.com/products/docker-desktop) installed             

Clone the Repository

# Clone the repository
git clone https://github.com/sense-opensource/sense-liveness-checks.git

# Navigate into the project directory
cd sense-liveness-checks

🧠 Model

The anti spoof model file is not included in the repository. You must download the model file manually or programmatically and place it in the appropriate folder.

✅ Download Instructions

Download the model file from the below link:

https://github.com/sense-opensource/sense-liveness-checks/releases/download/v1.0.0/efficientnet-b7.onnx this file needs to be placed inside the resources/deepfake/ folder

Ensure the model is saved in: resources/deepfake/efficientnet-b7.onnx

2. API Configuration

Method 1: Install Python Dependencies

pip install -r requirements.txt

Start the FastAPI Server

uvicorn app:app --reload

This will start the API server on: http://localhost:3016

Method 2: Running with Docker

Build Docker Image

docker build -t sense_liveness_opensource_image .

Run Docker Container

docker run -d --name sense_liveness_opensource_container -p 3016:3016 sense_liveness_opensource_image

This will start the API server on: http://localhost:3016

3. Run the Frontend

cd front-end
npm install
npm run dev

By default, the frontend runs on : http://localhost:3010

Useful Docker Commands

Stop container

docker stop sense_liveness_opensource_container

Remove container

docker rm -f sense_liveness_opensource_container

Remove image

docker rmi -f  sense_liveness_opensource_image

View logs

docker logs anti_spoof_container

License

MIT License — free to use, share, and modify

About

Identify bad actors during onboarding by differentiating between spoofed and real images

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •