Spaces:
Sleeping
Sleeping
sehyun commited on
Commit ·
3f605f2
1
Parent(s): afb90db
Changes to order of class names list
Browse files- __pycache__/model.cpython-311.pyc +0 -0
- app.py +2 -3
__pycache__/model.cpython-311.pyc
ADDED
|
Binary file (1.32 kB). View file
|
|
|
app.py
CHANGED
|
@@ -6,7 +6,7 @@ from typing import Dict
|
|
| 6 |
from pathlib import Path
|
| 7 |
|
| 8 |
# Define Class names
|
| 9 |
-
class_names = ["Dark", "
|
| 10 |
|
| 11 |
# Load path for example photo list
|
| 12 |
exp_list = list(Path("examples/").glob("*.png"))
|
|
@@ -14,8 +14,7 @@ exp_list = list(Path("examples/").glob("*.png"))
|
|
| 14 |
# Build and load model params
|
| 15 |
model, transforms = build_effnetb1()
|
| 16 |
model_path = "effnetb1.pth"
|
| 17 |
-
model.load_state_dict(torch.load(model_path,
|
| 18 |
-
map_location=torch.device("cpu")))
|
| 19 |
|
| 20 |
|
| 21 |
# Predict based on image given | move everything to device("cpu") / Spaces run on CPU
|
|
|
|
| 6 |
from pathlib import Path
|
| 7 |
|
| 8 |
# Define Class names
|
| 9 |
+
class_names = ["Dark", "Green", "Light", "Medium"]
|
| 10 |
|
| 11 |
# Load path for example photo list
|
| 12 |
exp_list = list(Path("examples/").glob("*.png"))
|
|
|
|
| 14 |
# Build and load model params
|
| 15 |
model, transforms = build_effnetb1()
|
| 16 |
model_path = "effnetb1.pth"
|
| 17 |
+
model.load_state_dict(torch.load(f=model_path, map_location="cpu"))
|
|
|
|
| 18 |
|
| 19 |
|
| 20 |
# Predict based on image given | move everything to device("cpu") / Spaces run on CPU
|