natexcvi
Compare with two images
c7f7ce9 unverified
raw
history blame contribute delete
656 Bytes
import requests
class FacialSyncService:
def __init__(self, access_token: str) -> None:
self.access_token = access_token
def similarity(self, img1, img2) -> float:
res = requests.post(
"https://natexcvi-facialexpressionsyncservice.hf.space/similarity",
files={
# "image1": img_file_buffer.getvalue(),
"image1": img1,
# "image2": static_image.getvalue(),
"image2": img2,
},
params={
"token": self.access_token,
},
)
res.raise_for_status()
return res.json()["score"]