kangda_robot_backend/ruoyi-fastapi-backend/test/006测试人脸分组1vN检索.py

17 lines
571 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import base64
from utils.haikang_util import HaikangUtil
import asyncio
with open("75c03e462769c81b6a8513d90ff2a27d.jpg", "rb") as image_file:
encoded_bytes = base64.b64encode(image_file.read())
# 解码为字符串默认为bytes方便打印或传输
encoded_str = encoded_bytes.decode('utf-8')
# print(encoded_str)
faceGroupIndexCodes = []
result = asyncio.run( HaikangUtil.face_group_1vN_search(encoded_str,
faceGroupIndexCodes=faceGroupIndexCodes))
print("测试人脸1vN检索", result)