Commit
•
af9f412
1
Parent(s):
8488f36
Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,8 @@ SparseZoo contains models that have been pruned and quantized. They are, therefo
|
|
19 |
Here is sample code for an Image Classification pipeline with the ResNet model.
|
20 |
```python
|
21 |
from deepsparse import Pipeline
|
22 |
-
pipeline = Pipeline.create(task="image_classification",
|
|
|
23 |
inference = pipeline(image)
|
24 |
print(inference)
|
25 |
```
|
@@ -64,7 +65,7 @@ with gr.Blocks() as demo:
|
|
64 |
""")
|
65 |
image = gr.Image(type="pil",shape=(224, 224))
|
66 |
btn = gr.Button("Classify Image")
|
67 |
-
sparse_answers = gr.
|
68 |
num_top_classes=2
|
69 |
)
|
70 |
sparse_duration = gr.Number(label="Sparse Latency (ms):")
|
|
|
19 |
Here is sample code for an Image Classification pipeline with the ResNet model.
|
20 |
```python
|
21 |
from deepsparse import Pipeline
|
22 |
+
pipeline = Pipeline.create(task="image_classification",
|
23 |
+
model_path="zoo:cv/classification/resnet_v1-50/pytorch/sparseml/imagenet/base-none")
|
24 |
inference = pipeline(image)
|
25 |
print(inference)
|
26 |
```
|
|
|
65 |
""")
|
66 |
image = gr.Image(type="pil",shape=(224, 224))
|
67 |
btn = gr.Button("Classify Image")
|
68 |
+
sparse_answers = gr.Label(label="Sparse model answers",
|
69 |
num_top_classes=2
|
70 |
)
|
71 |
sparse_duration = gr.Number(label="Sparse Latency (ms):")
|