Spaces:
Sleeping
Sleeping
Commit
·
a7ad35c
1
Parent(s):
09541b6
changes
Browse files
README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
colorFrom: yellow
|
5 |
colorTo: purple
|
6 |
sdk: gradio
|
|
|
1 |
---
|
2 |
+
title: World Puzzle Solver
|
3 |
+
emoji: 🧩
|
4 |
colorFrom: yellow
|
5 |
colorTo: purple
|
6 |
sdk: gradio
|
app.py
CHANGED
@@ -58,7 +58,7 @@ def predict(img) -> Tuple[Dict, float]:
|
|
58 |
### 4. Gradio app ###
|
59 |
|
60 |
# Create title, description and article strings
|
61 |
-
title = "World Puzzle Solver"
|
62 |
description = "A World Puzzle Solver app that uses a PyTorch model to predict the letters in a target image."
|
63 |
article = ""
|
64 |
|
|
|
58 |
### 4. Gradio app ###
|
59 |
|
60 |
# Create title, description and article strings
|
61 |
+
title = "World Puzzle Solver 🧩"
|
62 |
description = "A World Puzzle Solver app that uses a PyTorch model to predict the letters in a target image."
|
63 |
article = ""
|
64 |
|
model.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import torch
|
2 |
import torchvision
|
3 |
from torch import nn
|
|
|
4 |
|
5 |
|
6 |
def create_model(num_classes: int = 32,
|
@@ -17,7 +18,7 @@ def create_model(num_classes: int = 32,
|
|
17 |
transforms (torchvision.transforms): vit image transforms.
|
18 |
"""
|
19 |
IMG_SIZE = 28
|
20 |
-
|
21 |
transforms.Resize((IMG_SIZE, IMG_SIZE)),
|
22 |
transforms.Grayscale(num_output_channels=1),
|
23 |
transforms.ToTensor()])
|
@@ -64,4 +65,4 @@ def create_model(num_classes: int = 32,
|
|
64 |
# print(x.shape)
|
65 |
x = self.classifier(self.block_2(self.block_1(x)))
|
66 |
return x
|
67 |
-
return Model,
|
|
|
1 |
import torch
|
2 |
import torchvision
|
3 |
from torch import nn
|
4 |
+
from torchvision import transforms
|
5 |
|
6 |
|
7 |
def create_model(num_classes: int = 32,
|
|
|
18 |
transforms (torchvision.transforms): vit image transforms.
|
19 |
"""
|
20 |
IMG_SIZE = 28
|
21 |
+
model_transforms = transforms.Compose([
|
22 |
transforms.Resize((IMG_SIZE, IMG_SIZE)),
|
23 |
transforms.Grayscale(num_output_channels=1),
|
24 |
transforms.ToTensor()])
|
|
|
65 |
# print(x.shape)
|
66 |
x = self.classifier(self.block_2(self.block_1(x)))
|
67 |
return x
|
68 |
+
return Model, model_transforms
|