Spaces:
Runtime error
Runtime error
Commit
·
c17f7e6
1
Parent(s):
1e51246
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,12 +47,13 @@ def greet(name):
|
|
| 47 |
if matches[best_match_index]:name = known_face_names[best_match_index]
|
| 48 |
face_names.append(name)
|
| 49 |
#print("All faces found in an image for test_image are:-")
|
| 50 |
-
if face_names==[]:return("unknown")
|
| 51 |
ans="Recognized Avengers either from robert_downey_jr,chris_hemsworth,chris_evans,mark_ruffalo or scarlett_johansson is or are:-"
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
|
|
|
|
|
|
| 56 |
|
| 57 |
|
| 58 |
|
|
@@ -60,5 +61,5 @@ def greet(name):
|
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
-
iface = gr.Interface(fn=greet, inputs=gr.inputs.Image(), outputs="text")
|
| 64 |
iface.launch()
|
|
|
|
| 47 |
if matches[best_match_index]:name = known_face_names[best_match_index]
|
| 48 |
face_names.append(name)
|
| 49 |
#print("All faces found in an image for test_image are:-")
|
|
|
|
| 50 |
ans="Recognized Avengers either from robert_downey_jr,chris_hemsworth,chris_evans,mark_ruffalo or scarlett_johansson is or are:-"
|
| 51 |
+
if face_names==[]:return(ans+"No one is present in the image")
|
| 52 |
+
|
| 53 |
+
#for l in face_names:
|
| 54 |
+
#for x in l:
|
| 55 |
+
#ans=ans+","+x.upper()
|
| 56 |
+
return(ans+str(face_names))
|
| 57 |
|
| 58 |
|
| 59 |
|
|
|
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
+
iface = gr.Interface(fn=greet, inputs=gr.inputs.Image(), outputs="text", theme="peach")
|
| 65 |
iface.launch()
|