Spaces:
Runtime error
Runtime error
nitishkumargundapu793
commited on
Commit
•
86f7323
1
Parent(s):
40a66c7
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
import cv2
|
2 |
import tensorflow as tf
|
3 |
import gradio as gr
|
4 |
|
@@ -22,9 +21,7 @@ loaded_model2.load_weights("wrinkl.h5")
|
|
22 |
|
23 |
def classifier(Imgarr):
|
24 |
l = []
|
25 |
-
|
26 |
-
img = cv2.resize(Imgarr,(50,50))
|
27 |
-
img = img.reshape(-1, 50, 50, 3)
|
28 |
result = loaded_model.predict(img)
|
29 |
result = result[0]
|
30 |
if result[0] >= result[1]:
|
@@ -45,10 +42,11 @@ def classifier(Imgarr):
|
|
45 |
l.append("no wrinkles on face")
|
46 |
else:
|
47 |
l.append("wrinkles on face")
|
48 |
-
|
|
|
49 |
|
50 |
interface = gr.Interface(classifier,gr.inputs.Image(shape=(50,50)),outputs = "text",
|
51 |
-
description="Classifier of
|
52 |
-
title="
|
53 |
-
examples=[['42.jpg'],['56.jpg']])
|
54 |
interface.launch()
|
|
|
|
|
1 |
import tensorflow as tf
|
2 |
import gradio as gr
|
3 |
|
|
|
21 |
|
22 |
def classifier(Imgarr):
|
23 |
l = []
|
24 |
+
img = Imgarr.reshape(-1, 50, 50, 3)
|
|
|
|
|
25 |
result = loaded_model.predict(img)
|
26 |
result = result[0]
|
27 |
if result[0] >= result[1]:
|
|
|
42 |
l.append("no wrinkles on face")
|
43 |
else:
|
44 |
l.append("wrinkles on face")
|
45 |
+
|
46 |
+
return "The Predictions are " + str(l)
|
47 |
|
48 |
interface = gr.Interface(classifier,gr.inputs.Image(shape=(50,50)),outputs = "text",
|
49 |
+
description="Classifier of Aging Signs of Images",
|
50 |
+
title="Aging Signs Classifier",
|
51 |
+
examples=[['42.jpg'],['56.jpg'],['64.jpg']])
|
52 |
interface.launch()
|