Diego Carpintero
commited on
Commit
·
c80d125
1
Parent(s):
c912b6b
refactor
Browse files
app.py
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
| 3 |
-
from model import *
|
| 4 |
-
|
| 5 |
-
from PIL import Image
|
| 6 |
import torchvision.transforms as transforms
|
| 7 |
|
|
|
|
| 8 |
|
| 9 |
-
title = "
|
| 10 |
description = "Trained on the Fashion MNIST dataset (28x28 pixels). The model expects images containing only one garment article as in the examples."
|
| 11 |
inputs = gr.components.Image()
|
| 12 |
outputs = gr.components.Label()
|
|
@@ -14,7 +14,7 @@ examples = "examples"
|
|
| 14 |
|
| 15 |
model = torch.load("model/fashion.mnist.base.pt", map_location=torch.device("cpu"))
|
| 16 |
|
| 17 |
-
# Images need to be transformed to
|
| 18 |
# see https://arxiv.org/abs/1708.07747
|
| 19 |
transform = transforms.Compose(
|
| 20 |
[
|
|
|
|
| 1 |
+
from PIL import Image
|
| 2 |
+
|
| 3 |
import gradio as gr
|
| 4 |
import torch
|
|
|
|
|
|
|
|
|
|
| 5 |
import torchvision.transforms as transforms
|
| 6 |
|
| 7 |
+
from model import *
|
| 8 |
|
| 9 |
+
title = "Garment Classifier"
|
| 10 |
description = "Trained on the Fashion MNIST dataset (28x28 pixels). The model expects images containing only one garment article as in the examples."
|
| 11 |
inputs = gr.components.Image()
|
| 12 |
outputs = gr.components.Label()
|
|
|
|
| 14 |
|
| 15 |
model = torch.load("model/fashion.mnist.base.pt", map_location=torch.device("cpu"))
|
| 16 |
|
| 17 |
+
# Images need to be transformed to the `Fashion MNIST` dataset format
|
| 18 |
# see https://arxiv.org/abs/1708.07747
|
| 19 |
transform = transforms.Compose(
|
| 20 |
[
|