disham993 commited on
Commit
d5367e9
1 Parent(s): 4c45b4b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -24
app.py CHANGED
@@ -14,35 +14,35 @@ def classify_image(img):
14
  return dict(zip(categories, map(float, probs)))
15
 
16
 
17
- image = gr.inputs.Image(shape=(360, 360))
18
- label = gr.outputs.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.<br>"
29
- article = """
30
- Animes and its protagonists this image classifier will recognize:
31
-
32
- 1. One Piece - Monkey D. Luffy
33
- 2. Naruto: Shippuden - Naruto Uzumaki
34
- 3. My Hero Academia - Izuku Midoriya
35
- 4. Dragon Ball Z - Son Goku aka Kakarot
36
- 5. Fairy Tail - Natsu Dragneel
37
- 6. Yu Yu Hakusho - Yusuke Urameshi
38
- 7. Bleach - Ichigo Kurosaki
39
- 8. Hunter X Hunter - Gon Freecss
40
- 9. Fullmetal Alchemist - Edward Elric
41
- 10. Attack on Titan - Eren Yeager
42
-
43
- Rest all other anime characters will be classified as others.
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=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)