gmjn commited on
Commit
08c31ff
·
1 Parent(s): 4aff3ad

update interface and examples

Browse files
Files changed (3) hide show
  1. app.py +13 -5
  2. colorful.jpg +0 -0
  3. functional.jpg +0 -0
app.py CHANGED
@@ -1,7 +1,7 @@
1
  # AUTOGENERATED! DO NOT EDIT! File to edit: gradio.ipynb.
2
 
3
  # %% auto 0
4
- __all__ = ['learn', 'categories', 'image', 'label', 'examples', 'intf', 'classify_image']
5
 
6
  # %% gradio.ipynb 2
7
  from fastai.vision.all import *
@@ -18,9 +18,17 @@ def classify_image(img):
18
  return dict(zip(categories, map(float,probs)))
19
 
20
  # %% gradio.ipynb 5
21
- image = gr.inputs.Image(shape=(224,224))
22
- label = gr.outputs.Label()
23
- examples = ['color.jpg', 'functional.jpg', 'modest.jpg']
 
 
 
24
 
25
- intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
 
 
 
 
 
26
  intf.launch(inline=False)
 
1
  # AUTOGENERATED! DO NOT EDIT! File to edit: gradio.ipynb.
2
 
3
  # %% auto 0
4
+ __all__ = ['learn', 'categories', 'title', 'description', 'article', 'image', 'label', 'examples', 'intf', 'classify_image']
5
 
6
  # %% gradio.ipynb 2
7
  from fastai.vision.all import *
 
18
  return dict(zip(categories, map(float,probs)))
19
 
20
  # %% gradio.ipynb 5
21
+ title="Vague Image Personality Detector"
22
+ description="Dit model kan bepalen welke kleur persoonlijkheid een persoon heeft. Upload een foto van jezelf en zie welke kleur je bent."
23
+ article="""<h2>DISC theorie</>
24
+ <p>Het DISC-model geeft inzicht in het gedrag van mensen. Het geeft bijvoorbeeld weer hoe iemand overkomt in de communicatie met zijn/haar omgeving. Dit is zowel verbaal als non-verbaal.</p>
25
+ <p>Bij de vier verschillende gedragsstijlen horen vier kleuren en elke kleur zou een bepaalde voorkeur voor kleding hebben.</p>
26
+ <p><a href='https://ugrow.nl/bibliotheek/gedrag'>meer leren over de kleuren</a> of <a href="https://nl.wikipedia.org/wiki/DISC">lees op Wikipedia</a></p>"""
27
 
28
+ # %% gradio.ipynb 6
29
+ image = gr.components.Image(shape=(224,224))
30
+ label = gr.components.Label()
31
+ examples = ['colorful.jpg', 'functional.jpg']
32
+
33
+ intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples, title=title, description=description, article=article)
34
  intf.launch(inline=False)
colorful.jpg CHANGED
functional.jpg CHANGED