Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,13 @@ import gradio as gr
|
|
| 2 |
from fastai.vision.all import *
|
| 3 |
import os
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
# Load model
|
| 6 |
learn = load_learner('model.pkl')
|
| 7 |
labels = learn.dls.vocab
|
|
|
|
| 2 |
from fastai.vision.all import *
|
| 3 |
import os
|
| 4 |
|
| 5 |
+
# Define the functions to get the x and y values from the input dictionary - in this case, the x value is the image and the y value is the diagnosis
|
| 6 |
+
# needed to load the model since we defined them during training
|
| 7 |
+
def get_x(r): return ""
|
| 8 |
+
|
| 9 |
+
def get_y(r): return r['diagnosis']
|
| 10 |
+
|
| 11 |
+
|
| 12 |
# Load model
|
| 13 |
learn = load_learner('model.pkl')
|
| 14 |
labels = learn.dls.vocab
|