natexcvi
Add fecnet
0edd049 unverified
raw
history blame
435 Bytes
import os
import numpy as np
import pytest
from dotenv import load_dotenv
from fecnet import FECNetModel
load_dotenv()
@pytest.fixture()
def model():
return FECNetModel(hf_token=os.getenv("HF_TOKEN"))
def test_embed(model: FECNetModel):
image = open("testdata/face_pic.jpeg", "rb").read()
image_arr = np.asarray(bytearray(image), dtype=np.uint8)
rep = model.embed_image(image_arr)
assert rep.shape == (1, 16)