Skip to content

InsightFace PKL API v1.0

Latest

Choose a tag to compare

@AnwarQasem AnwarQasem released this 26 Dec 23:22
· 1 commit to main since this release

This project provides a FastAPI-based service for processing images, generating facial embeddings using InsightFace, and storing them in a single .pkl file. The API includes functionality for uploading images, cleaning temporary files, and downloading generated .pkl files.

Key Features:

  • Accepts multiple image uploads.
  • Combines facial embeddings from multiple images into a single .pkl file.
  • Automatically cleans temporary files and results older than one hour.
  • Provides download access to the generated .pkl files.

Quick Start:

  1. Install dependencies with:
    pip install -r requirements.txt
  2. Start the API server:
    uvicorn app:app --host 0.0.0.0 --port 8001
  3. Use the /create_pkl/{filename} endpoint to upload images and generate a .pkl file.
  4. Download the result from /results/{filename}.pkl.

Example Usage:

  • Create a PKL file:
    curl -X POST "http://localhost:8001/create_pkl/person1" \
         -F "images=@image1.jpg" \
         -F "images=@image2.jpg"
  • Download the PKL file:
    curl -O "http://localhost:8001/results/person1.pkl"

File Management:
The application manages:

  • temp/: Temporary storage for uploaded files, automatically cleaned every hour.
  • results/: Stores generated .pkl files, also cleaned every hour.

Enjoy using the InsightFace PKL API! 🚀