Spaces:
Runtime error
Runtime error
foivospar
commited on
Commit
•
1d65d71
1
Parent(s):
cbf9751
initial demo
Browse files
app.py
CHANGED
@@ -104,7 +104,7 @@ def generate_image(image_path, num_steps, guidance_scale, seed, num_images, prog
|
|
104 |
faces = app.get(img)
|
105 |
|
106 |
if len(faces) == 0:
|
107 |
-
raise gr.Error(f"Face detection failed! Please try with another image")
|
108 |
|
109 |
faces = sorted(faces, key=lambda x:(x['bbox'][2]-x['bbox'][0])*(x['bbox'][3]-x['bbox'][1]))[-1] # select largest face (if more than one detected)
|
110 |
id_emb = torch.tensor(faces['embedding'], dtype=dtype)[None].to(device)
|
|
|
104 |
faces = app.get(img)
|
105 |
|
106 |
if len(faces) == 0:
|
107 |
+
raise gr.Error(f"Face detection failed! Please try with another image.")
|
108 |
|
109 |
faces = sorted(faces, key=lambda x:(x['bbox'][2]-x['bbox'][0])*(x['bbox'][3]-x['bbox'][1]))[-1] # select largest face (if more than one detected)
|
110 |
id_emb = torch.tensor(faces['embedding'], dtype=dtype)[None].to(device)
|