Update app.py
Browse files
app.py
CHANGED
@@ -14,35 +14,35 @@ def classify_image(img):
|
|
14 |
return dict(zip(categories, map(float, probs)))
|
15 |
|
16 |
|
17 |
-
image = gr.
|
18 |
-
label = gr.
|
19 |
examples = [
|
20 |
"Luffy.jpg",
|
21 |
"Naruto-Kurama-Mode.png",
|
22 |
"Goku.jpg",
|
23 |
"Ichigo.jpeg",
|
24 |
-
"Robin.jpeg"
|
25 |
]
|
26 |
|
27 |
title = "Top 10 Shounen Anime Protagonists Classifier"
|
28 |
-
description = "Fine tuned a resnet152 image classifier such that it is able to recognize protagonists of top 10 Shounen Animes
|
29 |
-
|
30 |
-
Animes and its protagonists this image classifier will recognize
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
""
|
45 |
-
|
46 |
|
47 |
intf = gr.Interface(
|
48 |
fn=classify_image,
|
@@ -51,7 +51,6 @@ intf = gr.Interface(
|
|
51 |
examples=examples,
|
52 |
title=title,
|
53 |
description=description,
|
54 |
-
article=
|
55 |
-
theme="huggingface",
|
56 |
)
|
57 |
-
intf.launch(inline=False)
|
|
|
14 |
return dict(zip(categories, map(float, probs)))
|
15 |
|
16 |
|
17 |
+
image = gr.Image()
|
18 |
+
label = gr.Label()
|
19 |
examples = [
|
20 |
"Luffy.jpg",
|
21 |
"Naruto-Kurama-Mode.png",
|
22 |
"Goku.jpg",
|
23 |
"Ichigo.jpeg",
|
24 |
+
"Robin.jpeg",
|
25 |
]
|
26 |
|
27 |
title = "Top 10 Shounen Anime Protagonists Classifier"
|
28 |
+
description = "Fine tuned a resnet152 image classifier such that it is able to recognize protagonists of top 10 Shounen Animes."
|
29 |
+
start_article = (
|
30 |
+
"<p> Animes and its protagonists this image classifier will recognize:</p>"
|
31 |
+
)
|
32 |
+
anime_characters = [
|
33 |
+
"1. One Piece - Monkey D. Luffy<br>",
|
34 |
+
"2. Naruto: Shippuden - Naruto Uzumaki<br>",
|
35 |
+
"3. My Hero Academia - Izuku Midoriya<br>",
|
36 |
+
"4. Dragon Ball Z - Son Goku aka Kakarot<br>",
|
37 |
+
"5. Fairy Tail - Natsu Dragneel<br>",
|
38 |
+
"6. Yu Yu Hakusho - Yusuke Urameshi<br>",
|
39 |
+
"7. Bleach - Ichigo Kurosaki<br>",
|
40 |
+
"8. Hunter X Hunter - Gon Freecss<br>",
|
41 |
+
"9. Fullmetal Alchemist - Edward Elric<br>",
|
42 |
+
"10. Attack on Titan - Eren Yeager<br>",
|
43 |
+
]
|
44 |
+
end_article = "<p>Rest all other anime characters will be classified as others.</p>"
|
45 |
+
final_article = start_article + "".join(anime_characters) + end_article
|
46 |
|
47 |
intf = gr.Interface(
|
48 |
fn=classify_image,
|
|
|
51 |
examples=examples,
|
52 |
title=title,
|
53 |
description=description,
|
54 |
+
article=final_article,
|
|
|
55 |
)
|
56 |
+
intf.launch(inline=False)
|