Spaces:
Sleeping
Sleeping
Fix
Browse files- README.md +1 -1
- __init__.py +0 -0
- app.py +0 -19
README.md
CHANGED
|
@@ -5,7 +5,7 @@ colorFrom: green
|
|
| 5 |
colorTo: indigo
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 3.19.1
|
| 8 |
-
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
| 11 |
---
|
|
|
|
| 5 |
colorTo: indigo
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 3.19.1
|
| 8 |
+
app_file: src/app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
| 11 |
---
|
__init__.py
DELETED
|
File without changes
|
app.py
DELETED
|
@@ -1,19 +0,0 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
from fastai.learner import load_learner
|
| 3 |
-
from fastai.vision.core import PILImage
|
| 4 |
-
|
| 5 |
-
# Load the model
|
| 6 |
-
learn = load_learner('exported_fastai.pkl', cpu=False)
|
| 7 |
-
|
| 8 |
-
def classify_image(inp):
|
| 9 |
-
inp = PILImage.create(inp)
|
| 10 |
-
pred, _, _ = learn.predict(inp)
|
| 11 |
-
return pred
|
| 12 |
-
|
| 13 |
-
iface = gr.Interface(
|
| 14 |
-
fn=classify_image,
|
| 15 |
-
inputs=gr.inputs.Image(),
|
| 16 |
-
outputs="text",
|
| 17 |
-
title="Fastai Classifier",
|
| 18 |
-
description="An example of using Fastai in Gradio.",
|
| 19 |
-
).launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|