Spaces:
Sleeping
Sleeping
Update
Browse files
app.py
CHANGED
|
@@ -48,10 +48,13 @@ def get_attributes(json):
|
|
| 48 |
|
| 49 |
def compare_face(frame1, frame2):
|
| 50 |
url = "https://recognito.p.rapidapi.com/api/face"
|
| 51 |
-
|
| 52 |
-
|
|
|
|
| 53 |
|
| 54 |
-
|
|
|
|
|
|
|
| 55 |
faces = None
|
| 56 |
|
| 57 |
try:
|
|
|
|
| 48 |
|
| 49 |
def compare_face(frame1, frame2):
|
| 50 |
url = "https://recognito.p.rapidapi.com/api/face"
|
| 51 |
+
try:
|
| 52 |
+
files = {'image1': open(frame1, 'rb'), 'image2': open(frame2, 'rb')}
|
| 53 |
+
headers = {"X-RapidAPI-Key": os.environ.get("API_KEY")}
|
| 54 |
|
| 55 |
+
r = requests.post(url=url, files=files, headers=headers)
|
| 56 |
+
except:
|
| 57 |
+
raise gr.Error("Please select images files!")
|
| 58 |
faces = None
|
| 59 |
|
| 60 |
try:
|