File size: 626 Bytes
6f21a14
 
 
 
 
 
 
 
cdcee06
 
 
 
6f21a14
cdcee06
 
6f21a14
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from fastapi import FastAPI
from pydantic import BaseModel
from gradio_client import Client

app = FastAPI()

client = Client("https://kby-ai-facerecognition.hf.space/--replicas/ij0t7/")

@app.get("/face-recognition")
async def face_recognition_get():
    image1 = "https://qvnhhditkzzeudppuezf.supabase.co/storage/v1/object/public/post-images/post-images/1752289670997-kevan.jpg"
    image2 = "https://qvnhhditkzzeudppuezf.supabase.co/storage/v1/object/public/post-images/post-images/1752289670997-kevan.jpg"
    result = client.predict(
        image1,
        image2,
        fn_index=2
    )
    return {"result": result}