Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
# AUTOGENERATED! DO NOT EDIT! File to edit: ../
|
2 |
|
3 |
# %% auto 0
|
4 |
__all__ = ['learn', 'categories', 'image', 'label', 'examples', 'intf', 'classify_image']
|
@@ -10,7 +10,8 @@ from pathlib import Path
|
|
10 |
|
11 |
|
12 |
# %% ../my_model.ipynb 4
|
13 |
-
|
|
|
14 |
|
15 |
# %% ../my_model.ipynb 5
|
16 |
categories = ['eagle', 'parrot']
|
@@ -26,5 +27,3 @@ examples = ['parrot.jpg', 'eagle.jpg', 'lion.jpg']
|
|
26 |
|
27 |
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
28 |
intf.launch(inline=False)
|
29 |
-
|
30 |
-
|
|
|
1 |
+
# AUTOGENERATED! DO NOT EDIT! File to edit: ../app.ipynb.
|
2 |
|
3 |
# %% auto 0
|
4 |
__all__ = ['learn', 'categories', 'image', 'label', 'examples', 'intf', 'classify_image']
|
|
|
10 |
|
11 |
|
12 |
# %% ../my_model.ipynb 4
|
13 |
+
model_file_path = Path(__file__).parent / 'eagle_or_parrot_model.pkl'
|
14 |
+
learn = load_learner(model_file_path, cpu=True)
|
15 |
|
16 |
# %% ../my_model.ipynb 5
|
17 |
categories = ['eagle', 'parrot']
|
|
|
27 |
|
28 |
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
29 |
intf.launch(inline=False)
|
|
|
|