Fix bugs
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ def is_cat(x) -> bool:
|
|
| 11 |
|
| 12 |
learn = load_learner("model.pkl")
|
| 13 |
|
| 14 |
-
categories =
|
| 15 |
|
| 16 |
def classify_image(img):
|
| 17 |
_, _, probs = learn.predict(img)
|
|
@@ -21,4 +21,4 @@ image = gr.inputs.Image(shape=(192, 192))
|
|
| 21 |
label = gr.outputs.Label()
|
| 22 |
examples = [str(x) for x in Path("examples").iterdir()]
|
| 23 |
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
| 24 |
-
intf.launch(
|
|
|
|
| 11 |
|
| 12 |
learn = load_learner("model.pkl")
|
| 13 |
|
| 14 |
+
categories = learn.dls.vocab
|
| 15 |
|
| 16 |
def classify_image(img):
|
| 17 |
_, _, probs = learn.predict(img)
|
|
|
|
| 21 |
label = gr.outputs.Label()
|
| 22 |
examples = [str(x) for x in Path("examples").iterdir()]
|
| 23 |
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
| 24 |
+
intf.launch()
|