Spaces:
Running
on
Zero
Running
on
Zero
Update fashion_mnist_cloth.py
Browse files- fashion_mnist_cloth.py +2 -0
fashion_mnist_cloth.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
from transformers import AutoImageProcessor
|
3 |
from transformers import SiglipForImageClassification
|
4 |
from transformers.image_utils import load_image
|
@@ -10,6 +11,7 @@ model_name = "prithivMLmods/Fashion-Mnist-SigLIP2"
|
|
10 |
model = SiglipForImageClassification.from_pretrained(model_name)
|
11 |
processor = AutoImageProcessor.from_pretrained(model_name)
|
12 |
|
|
|
13 |
def fashion_mnist_classification(image):
|
14 |
"""Predicts fashion category for an image."""
|
15 |
image = Image.fromarray(image).convert("RGB")
|
|
|
1 |
import gradio as gr
|
2 |
+
import spaces
|
3 |
from transformers import AutoImageProcessor
|
4 |
from transformers import SiglipForImageClassification
|
5 |
from transformers.image_utils import load_image
|
|
|
11 |
model = SiglipForImageClassification.from_pretrained(model_name)
|
12 |
processor = AutoImageProcessor.from_pretrained(model_name)
|
13 |
|
14 |
+
@spaces.GPU
|
15 |
def fashion_mnist_classification(image):
|
16 |
"""Predicts fashion category for an image."""
|
17 |
image = Image.fromarray(image).convert("RGB")
|