Commit
·
8e6c66b
1
Parent(s):
7ae96e1
classes
Browse files- app.py +2 -2
- models/classes.txt → classes.txt +0 -0
- examples/example1.jpg +0 -0
- examples/example2.jpg +0 -0
- models/dum.txt +0 -0
app.py
CHANGED
@@ -24,7 +24,7 @@ STATIC_DIR.mkdir(parents=True, exist_ok=True)
|
|
24 |
|
25 |
# Global variables
|
26 |
MODEL_PATH = MODELS_DIR / "resnet_50.pth"
|
27 |
-
CLASSES_PATH =
|
28 |
DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
29 |
|
30 |
def load_class_labels() -> Optional[list]:
|
@@ -152,7 +152,7 @@ def get_example_list() -> list:
|
|
152 |
try:
|
153 |
examples = []
|
154 |
for ext in ['.jpg', '.jpeg', '.png']:
|
155 |
-
examples.extend(list(EXAMPLES_DIR.glob(f'
|
156 |
return [[str(ex)] for ex in sorted(examples)]
|
157 |
except Exception as e:
|
158 |
logger.error(f"Error loading examples: {str(e)}")
|
|
|
24 |
|
25 |
# Global variables
|
26 |
MODEL_PATH = MODELS_DIR / "resnet_50.pth"
|
27 |
+
CLASSES_PATH = BASE_DIR / "classes.txt"
|
28 |
DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
29 |
|
30 |
def load_class_labels() -> Optional[list]:
|
|
|
152 |
try:
|
153 |
examples = []
|
154 |
for ext in ['.jpg', '.jpeg', '.png']:
|
155 |
+
examples.extend(list(EXAMPLES_DIR.glob(f'*.{ext}')))
|
156 |
return [[str(ex)] for ex in sorted(examples)]
|
157 |
except Exception as e:
|
158 |
logger.error(f"Error loading examples: {str(e)}")
|
models/classes.txt → classes.txt
RENAMED
File without changes
|
examples/example1.jpg
ADDED
![]() |
examples/example2.jpg
ADDED
![]() |
models/dum.txt
DELETED
File without changes
|