mirror of
https://github.com/serengil/deepface.git
synced 2025-06-06 11:35:21 +00:00
Choose lightweight model GhostFaceNet
This commit is contained in:
parent
9684a15b45
commit
2fd9f37021
56
scripts/mh_download_models.py
Normal file
56
scripts/mh_download_models.py
Normal file
@ -0,0 +1,56 @@
|
||||
from pathlib import Path
|
||||
import requests
|
||||
import json
|
||||
|
||||
URL_VERIFY = "http://127.0.0.1:5005/verify"
|
||||
HEADERS = {"Content-Type": "application/json"}
|
||||
|
||||
models = [
|
||||
# "VGG-Face",
|
||||
# "Facenet",
|
||||
# "Facenet512",
|
||||
# "OpenFace",
|
||||
# "DeepFace",
|
||||
# "DeepID",
|
||||
# "ArcFace",
|
||||
"Dlib",
|
||||
# "SFace",
|
||||
# "GhostFaceNet",
|
||||
]
|
||||
|
||||
if __name__ == "__main__":
|
||||
result = {
|
||||
"results": [
|
||||
{
|
||||
"embedding": [
|
||||
-1.2134509086608887,
|
||||
-1.1512534618377686,
|
||||
],
|
||||
"face_confidence": 0.92,
|
||||
"facial_area": {
|
||||
"h": 998,
|
||||
"left_eye": [1292, 1300],
|
||||
"right_eye": [912, 1283],
|
||||
"w": 998,
|
||||
"x": 621,
|
||||
"y": 906,
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
vec1 = result["results"][0]["embedding"]
|
||||
vec2 = vec1
|
||||
|
||||
for model in models:
|
||||
payload = {
|
||||
"model_name": model,
|
||||
"img1_path": vec1,
|
||||
"img2_path": vec2,
|
||||
}
|
||||
|
||||
response = requests.request(
|
||||
"POST", URL_VERIFY, data=json.dumps(payload), headers=HEADERS
|
||||
)
|
||||
|
||||
print(response.text)
|
@ -22,7 +22,7 @@ if __name__ == "__main__":
|
||||
)
|
||||
b64encoded_string = get_base64_from_file(image_path)
|
||||
|
||||
payload = {"model_name": "Facenet", "img": b64encoded_string}
|
||||
payload = {"model_name": "GhostFaceNet", "img": b64encoded_string}
|
||||
|
||||
# img_path = "https://raw.githubusercontent.com/serengil/deepface/refs/heads/master/tests/dataset/couple.jpg"
|
||||
# payload = {"model_name": "Facenet", "img": img_path}
|
||||
|
@ -156,7 +156,7 @@ if __name__ == "__main__":
|
||||
vec2 = vec1
|
||||
|
||||
payload = {
|
||||
"model_name": "Facenet",
|
||||
"model_name": "GhostFaceNet",
|
||||
"img1_path": vec1,
|
||||
"img2_path": vec2,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user