OpenCV-Snapchat Filter RestAPI with FastAPI

OpenCV-Snapchat Filter RestAPI with FastAPI

ยท

1 min read

It's a Rest API for Face Filter using OpenCV, FastAPI. Currently, It's using a simple haar cascade for face detection and applying mask by resizing on the face. It can be integrated into the web app or Android/IOS mobile APP.

API-URL - opencv-api.herokuapp.com Documentation: opencv-api.herokuapp.com/docs status: alpha

withot filter

face-filter

Try It with your picture.

you will get the Image Url in Response. open it in the browser.

Create a POST request with file-field to get the filtered Image.

import requests

url = "http://opencv-api.herokuapp.com/api/v1/facefilter"

# enter your full file path
file_path = ""

files ={
    'file': open(file_path, 'rb')
}

#choose mask 1 to 3
data ={
    'mask': 2
}

r = requests.post(url, files=files, data=data)
print(r.json())

facefilter

face detection

Future roadmap

Facial keypoints and face emotion deep learning models for better accuracy and mask.

Share your Filtered Image in Comments and your Feedback.

ย