Repository navigation
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
.pklfile. - Automatically cleans temporary files and results older than one hour.
- Provides download access to the generated
.pklfiles.
Quick Start:
- Install dependencies with:
pip install -r requirements.txt
- Start the API server:
uvicorn app:app --host 0.0.0.0 --port 8001
- Use the
/create_pkl/{filename}endpoint to upload images and generate a.pklfile. - 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.pklfiles, also cleaned every hour.
Enjoy using the InsightFace PKL API! 🚀