Spaces:
Sleeping
Sleeping
Manav Sarkar
commited on
Commit
·
ae5fc80
1
Parent(s):
4f86615
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,17 +64,12 @@ async def create_upload_file(contents: Base64Data):
|
|
| 64 |
df = DeepFace.find(img_path = contents, db_path = "dataset/",model_name ='GhostFaceNet', threshold=0.9)
|
| 65 |
|
| 66 |
filename = df[0].head()['identity'][0]
|
| 67 |
-
filename = filename.replace('\\\\', '/')
|
| 68 |
-
filename = filename.replace(' ', r'\ ')
|
| 69 |
|
| 70 |
|
| 71 |
print(f"filename: {filename}")
|
| 72 |
|
| 73 |
-
# return base64 image of the file
|
| 74 |
-
image = Image.open(f"dataset/{filename}")
|
| 75 |
-
|
| 76 |
# Convert the image to base64
|
| 77 |
-
base64_output = image_to_base64(
|
| 78 |
|
| 79 |
|
| 80 |
return JSONResponse(content={
|
|
|
|
| 64 |
df = DeepFace.find(img_path = contents, db_path = "dataset/",model_name ='GhostFaceNet', threshold=0.9)
|
| 65 |
|
| 66 |
filename = df[0].head()['identity'][0]
|
|
|
|
|
|
|
| 67 |
|
| 68 |
|
| 69 |
print(f"filename: {filename}")
|
| 70 |
|
|
|
|
|
|
|
|
|
|
| 71 |
# Convert the image to base64
|
| 72 |
+
base64_output = image_to_base64("dataset/" + filename)
|
| 73 |
|
| 74 |
|
| 75 |
return JSONResponse(content={
|