lordsquirrel commited on
Commit
6425640
1 Parent(s): c5fed56
Files changed (2) hide show
  1. demo.py +4 -5
  2. model-test.ipynb +9 -8
demo.py CHANGED
@@ -1,7 +1,7 @@
1
  # AUTOGENERATED! DO NOT EDIT! File to edit: model-test.ipynb.
2
 
3
  # %% auto 0
4
- __all__ = ['plt', 'learn', 'categories', 'title', 'image', 'label', 'examples', 'iface', 'is_albani', 'classify_image']
5
 
6
  # %% model-test.ipynb 2
7
  from fastai.vision.all import *
@@ -21,8 +21,8 @@ def classify_image(img):
21
  pred,idx,probs = learn.predict(img)
22
  return dict(zip(categories, map(float, probs)))
23
 
24
- title = """
25
- # Er du i tvivl om at den øl du sidder med i hånden lige, nu er god?
26
  ### Tvivl ej 68 års invotation inden for machine learning skal nok fortælle dig om øllen er god eller ej
27
  """
28
  image = gr.Image(shape=(192, 192))
@@ -34,8 +34,7 @@ iface = gr.Interface(
34
  inputs=image,
35
  outputs=label,
36
  examples=examples,
37
- description=title,
38
- title="Er du i tvivl om at den øl du sidder med i hånden lige nu er god? "
39
  )
40
 
41
  iface.launch(inline=False)
 
1
  # AUTOGENERATED! DO NOT EDIT! File to edit: model-test.ipynb.
2
 
3
  # %% auto 0
4
+ __all__ = ['plt', 'learn', 'categories', 'description', 'image', 'label', 'examples', 'iface', 'is_albani', 'classify_image']
5
 
6
  # %% model-test.ipynb 2
7
  from fastai.vision.all import *
 
21
  pred,idx,probs = learn.predict(img)
22
  return dict(zip(categories, map(float, probs)))
23
 
24
+ description = """
25
+ ## Er du i tvivl om at den øl du sidder med i hånden lige, nu er god?
26
  ### Tvivl ej 68 års invotation inden for machine learning skal nok fortælle dig om øllen er god eller ej
27
  """
28
  image = gr.Image(shape=(192, 192))
 
34
  inputs=image,
35
  outputs=label,
36
  examples=examples,
37
+ description=description,
 
38
  )
39
 
40
  iface.launch(inline=False)
model-test.ipynb CHANGED
@@ -75,14 +75,16 @@
75
  },
76
  {
77
  "cell_type": "code",
78
- "execution_count": 45,
79
  "metadata": {},
80
  "outputs": [
81
  {
82
  "name": "stdout",
83
  "output_type": "stream",
84
  "text": [
85
- "Running on local URL: http://127.0.0.1:7873\n",
 
 
86
  "\n",
87
  "To create a public link, set `share=True` in `launch()`.\n"
88
  ]
@@ -91,7 +93,7 @@
91
  "data": {
92
  "text/plain": []
93
  },
94
- "execution_count": 45,
95
  "metadata": {},
96
  "output_type": "execute_result"
97
  }
@@ -106,8 +108,8 @@
106
  " pred,idx,probs = learn.predict(img)\n",
107
  " return dict(zip(categories, map(float, probs)))\n",
108
  "\n",
109
- "title = \"\"\"\n",
110
- " # Er du i tvivl om at den øl du sidder med i hånden lige, nu er god?\n",
111
  " ### Tvivl ej 68 års invotation inden for machine learning skal nok fortælle dig om øllen er god eller ej\n",
112
  "\"\"\"\n",
113
  "image = gr.Image(shape=(192, 192))\n",
@@ -119,8 +121,7 @@
119
  " inputs=image, \n",
120
  " outputs=label, \n",
121
  " examples=examples, \n",
122
- " description=title,\n",
123
- " title=\"Er du i tvivl om at den øl du sidder med i hånden lige nu er god? \"\n",
124
  ")\n",
125
  "\n",
126
  "iface.launch(inline=False)\n"
@@ -136,7 +137,7 @@
136
  },
137
  {
138
  "cell_type": "code",
139
- "execution_count": 42,
140
  "metadata": {},
141
  "outputs": [
142
  {
 
75
  },
76
  {
77
  "cell_type": "code",
78
+ "execution_count": 50,
79
  "metadata": {},
80
  "outputs": [
81
  {
82
  "name": "stdout",
83
  "output_type": "stream",
84
  "text": [
85
+ "\n",
86
+ "Thanks for being a Gradio user! If you have questions or feedback, please join our Discord server and chat with us: https://discord.gg/feTf9x3ZSB\n",
87
+ "Running on local URL: http://127.0.0.1:7877\n",
88
  "\n",
89
  "To create a public link, set `share=True` in `launch()`.\n"
90
  ]
 
93
  "data": {
94
  "text/plain": []
95
  },
96
+ "execution_count": 50,
97
  "metadata": {},
98
  "output_type": "execute_result"
99
  }
 
108
  " pred,idx,probs = learn.predict(img)\n",
109
  " return dict(zip(categories, map(float, probs)))\n",
110
  "\n",
111
+ "description = \"\"\"\n",
112
+ " ## Er du i tvivl om at den øl du sidder med i hånden lige, nu er god?\n",
113
  " ### Tvivl ej 68 års invotation inden for machine learning skal nok fortælle dig om øllen er god eller ej\n",
114
  "\"\"\"\n",
115
  "image = gr.Image(shape=(192, 192))\n",
 
121
  " inputs=image, \n",
122
  " outputs=label, \n",
123
  " examples=examples, \n",
124
+ " description=description,\n",
 
125
  ")\n",
126
  "\n",
127
  "iface.launch(inline=False)\n"
 
137
  },
138
  {
139
  "cell_type": "code",
140
+ "execution_count": 52,
141
  "metadata": {},
142
  "outputs": [
143
  {