init
Browse files- .ipynb_checkpoints/README-checkpoint.md +13 -0
- .ipynb_checkpoints/app-checkpoint.py +7 -0
- .ipynb_checkpoints/project1-checkpoint.ipynb +0 -0
- app.py +20 -0
- berry_model.pkl +3 -0
- project1.ipynb +0 -0
.ipynb_checkpoints/README-checkpoint.md
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: Berries
|
3 |
+
emoji: 🔥
|
4 |
+
colorFrom: green
|
5 |
+
colorTo: gray
|
6 |
+
sdk: gradio
|
7 |
+
sdk_version: 3.10.1
|
8 |
+
app_file: app.py
|
9 |
+
pinned: false
|
10 |
+
license: apache-2.0
|
11 |
+
---
|
12 |
+
|
13 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
.ipynb_checkpoints/app-checkpoint.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def greet(name):
|
4 |
+
return "Hello " + name + "!!"
|
5 |
+
|
6 |
+
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
+
iface.launch()
|
.ipynb_checkpoints/project1-checkpoint.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
app.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from fastai.vision.all import *
|
3 |
+
|
4 |
+
learn = load_learner('model.pkl')
|
5 |
+
|
6 |
+
def greet(name):
|
7 |
+
return "Hello " + name + "!!"
|
8 |
+
|
9 |
+
|
10 |
+
catergories = ("strawberry", "blueberry", "raspberry", "cranberry", "mulberry", "other")
|
11 |
+
|
12 |
+
def classify_image(img):
|
13 |
+
pred,idx,probs = learn.predict(img)
|
14 |
+
return dict(zip(categories, map(float,probs)))
|
15 |
+
|
16 |
+
image = gr.inputs.Image(shape=(128,128))
|
17 |
+
label = gr.outputs.Label()
|
18 |
+
|
19 |
+
iface = gr.Interface(fn=classify_image, inputs=image, outputs=label)
|
20 |
+
iface.launch(inline=False)
|
berry_model.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dbbf348f433755da1da945234c1b0e81cbbe66d6ffe58a65337bee50d955d3e9
|
3 |
+
size 46982629
|
project1.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|