Spaces:
Build error
Build error
Sandhya
commited on
Commit
·
594c7c2
1
Parent(s):
fc3095a
add requirements
Browse files
app.py
CHANGED
|
@@ -4,6 +4,8 @@ from torch import nn
|
|
| 4 |
from PIL import Image
|
| 5 |
from torchvision import transforms
|
| 6 |
import numpy as np
|
|
|
|
|
|
|
| 7 |
|
| 8 |
def predict(img_path,model=None):
|
| 9 |
if model is None:
|
|
@@ -27,10 +29,6 @@ def predict(img_path,model=None):
|
|
| 27 |
|
| 28 |
return predict_dict
|
| 29 |
|
| 30 |
-
|
| 31 |
-
import numpy as np
|
| 32 |
-
import gradio as gr
|
| 33 |
-
|
| 34 |
demo = gr.Interface(predict, gr.Image(), outputs=gr.Label(num_top_classes=3))
|
| 35 |
if __name__ == "__main__":
|
| 36 |
demo.launch()
|
|
|
|
| 4 |
from PIL import Image
|
| 5 |
from torchvision import transforms
|
| 6 |
import numpy as np
|
| 7 |
+
import gradio as gr
|
| 8 |
+
|
| 9 |
|
| 10 |
def predict(img_path,model=None):
|
| 11 |
if model is None:
|
|
|
|
| 29 |
|
| 30 |
return predict_dict
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
demo = gr.Interface(predict, gr.Image(), outputs=gr.Label(num_top_classes=3))
|
| 33 |
if __name__ == "__main__":
|
| 34 |
demo.launch()
|