Spaces:
Sleeping
Sleeping
FatmaU commited on
Commit ·
2bb2921
1
Parent(s): 61ce90a
delete_gpu_settign
Browse files
app.py
CHANGED
|
@@ -1,6 +1,4 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
import spaces
|
| 3 |
-
import torch
|
| 4 |
from fastai.vision.all import *
|
| 5 |
|
| 6 |
def is_cat(x):
|
|
@@ -10,7 +8,6 @@ learn = load_learner('model.pkl')
|
|
| 10 |
|
| 11 |
categories = ('Dog', 'Cat')
|
| 12 |
|
| 13 |
-
@spaces.GPU
|
| 14 |
def classify_image(img):
|
| 15 |
pred, idx, probs = learn.predict(img)
|
| 16 |
return dict(zip(categories, map(float, probs)))
|
|
@@ -18,6 +15,5 @@ def classify_image(img):
|
|
| 18 |
image = gr.Image()
|
| 19 |
label = gr.Label()
|
| 20 |
|
| 21 |
-
|
| 22 |
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label)
|
| 23 |
intf.launch()
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
| 2 |
from fastai.vision.all import *
|
| 3 |
|
| 4 |
def is_cat(x):
|
|
|
|
| 8 |
|
| 9 |
categories = ('Dog', 'Cat')
|
| 10 |
|
|
|
|
| 11 |
def classify_image(img):
|
| 12 |
pred, idx, probs = learn.predict(img)
|
| 13 |
return dict(zip(categories, map(float, probs)))
|
|
|
|
| 15 |
image = gr.Image()
|
| 16 |
label = gr.Label()
|
| 17 |
|
|
|
|
| 18 |
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label)
|
| 19 |
intf.launch()
|