|
|
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} |
|
|
|