Spaces:
Build error
Build error
jagilley
commited on
Commit
•
b041e49
1
Parent(s):
b190da0
more data!
Browse files
app.py
CHANGED
@@ -27,15 +27,15 @@ def hotornot(image, gender):
|
|
27 |
positive_probs = [prob[0] for prob in probs]
|
28 |
negative_probs = [prob[1] for prob in probs]
|
29 |
|
30 |
-
|
31 |
-
|
|
|
32 |
|
33 |
hot_score = sum(positive_probs)/len(positive_probs)
|
34 |
ugly_score = sum(negative_probs)/len(negative_probs)
|
35 |
-
print(hot_score, ugly_score)
|
36 |
composite = ((hot_score - ugly_score)+1) * 50
|
37 |
composite = round(composite, 2)
|
38 |
-
return composite
|
39 |
|
40 |
iface = gr.Interface(
|
41 |
fn=hotornot,
|
@@ -48,7 +48,12 @@ iface = gr.Interface(
|
|
48 |
default='person',
|
49 |
)
|
50 |
],
|
51 |
-
outputs=
|
|
|
|
|
|
|
|
|
|
|
52 |
title="Hot or Not",
|
53 |
description="A simple hot or not app using OpenAI's CLIP model.",
|
54 |
)
|
|
|
27 |
positive_probs = [prob[0] for prob in probs]
|
28 |
negative_probs = [prob[1] for prob in probs]
|
29 |
|
30 |
+
hotness_score = (probs[0][0] - probs[0][1] + 1) * 50
|
31 |
+
beauty_score = (probs[1][0] - probs[1][1] + 1) * 50
|
32 |
+
attractiveness_score = (probs[2][0] - probs[2][1] + 1) * 50
|
33 |
|
34 |
hot_score = sum(positive_probs)/len(positive_probs)
|
35 |
ugly_score = sum(negative_probs)/len(negative_probs)
|
|
|
36 |
composite = ((hot_score - ugly_score)+1) * 50
|
37 |
composite = round(composite, 2)
|
38 |
+
return composite, hotness_score, beauty_score, attractiveness_score
|
39 |
|
40 |
iface = gr.Interface(
|
41 |
fn=hotornot,
|
|
|
48 |
default='person',
|
49 |
)
|
50 |
],
|
51 |
+
outputs=[
|
52 |
+
gr.Textbox(label="Total Hot or Not™ Score"),
|
53 |
+
gr.Textbox(label="Hotness Score"),
|
54 |
+
gr.Textbox(label="Beauty Score"),
|
55 |
+
gr.Textbox(label="Attractiveness Score"),
|
56 |
+
],
|
57 |
title="Hot or Not",
|
58 |
description="A simple hot or not app using OpenAI's CLIP model.",
|
59 |
)
|