Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,20 +1,17 @@
|
|
1 |
-
import numpy as np # linear algebra
|
2 |
-
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
|
3 |
-
|
4 |
import os
|
5 |
for dirname, _, filenames in os.walk('/kaggle/input'):
|
6 |
for filename in filenames:
|
7 |
print(os.path.join(dirname, filename))
|
8 |
|
9 |
from fastai.vision.all import *
|
|
|
10 |
import gradio as gr
|
11 |
|
12 |
share = True
|
13 |
-
def is_cat(x): return x[0].isupper()
|
14 |
|
15 |
-
learn = load_learner('
|
16 |
|
17 |
-
categories = ('Batteries', 'Organic Matter', 'Primary', 'Tertiary')
|
18 |
|
19 |
def classify_image(img):
|
20 |
pred,idx,probs = learn.predict(img)
|
@@ -23,5 +20,5 @@ def classify_image(img):
|
|
23 |
image = "image"
|
24 |
label = "label"
|
25 |
|
26 |
-
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label)
|
27 |
-
intf.launch(inline=False, share = True)
|
|
|
|
|
|
|
|
|
1 |
import os
|
2 |
for dirname, _, filenames in os.walk('/kaggle/input'):
|
3 |
for filename in filenames:
|
4 |
print(os.path.join(dirname, filename))
|
5 |
|
6 |
from fastai.vision.all import *
|
7 |
+
!pip install gradio
|
8 |
import gradio as gr
|
9 |
|
10 |
share = True
|
|
|
11 |
|
12 |
+
learn = load_learner('wastedetective.pkl')
|
13 |
|
14 |
+
categories = ('Batteries', 'Organic Matter', 'Primary', 'Tertiary', 'Metals')
|
15 |
|
16 |
def classify_image(img):
|
17 |
pred,idx,probs = learn.predict(img)
|
|
|
20 |
image = "image"
|
21 |
label = "label"
|
22 |
|
23 |
+
intf = gr.Interface(fn=classify_image, inputs = image, outputs = label)
|
24 |
+
intf.launch(inline = False, share = True)
|