Update app.py
Browse files
app.py
CHANGED
|
@@ -15,9 +15,9 @@ def load_model_safely(path: str):
|
|
| 15 |
# Retrieve the current directory and specify model paths
|
| 16 |
current_dir = os.getcwd() # Ensure correct initial directory
|
| 17 |
model_paths = {
|
| 18 |
-
'CNN': os.path.join(current_dir, '
|
| 19 |
-
'VGG19': os.path.join(current_dir, '
|
| 20 |
-
'ResNet50': os.path.join(current_dir, '
|
| 21 |
}
|
| 22 |
|
| 23 |
# Load models and handle potential exceptions
|
|
@@ -92,7 +92,7 @@ def get_example_images(images_dir:str, size=(50, 50)) -> list:
|
|
| 92 |
return images
|
| 93 |
|
| 94 |
# Directory for example images
|
| 95 |
-
images_dir = os.path.join(current_dir, '
|
| 96 |
examples = get_example_images(images_dir, (50, 50))
|
| 97 |
|
| 98 |
# Function to preprocess the image and predict the class
|
|
|
|
| 15 |
# Retrieve the current directory and specify model paths
|
| 16 |
current_dir = os.getcwd() # Ensure correct initial directory
|
| 17 |
model_paths = {
|
| 18 |
+
'CNN': os.path.join(current_dir, 'models', 'cnn_model.keras'),
|
| 19 |
+
'VGG19': os.path.join(current_dir, 'models', 'vgg19_model.keras'),
|
| 20 |
+
'ResNet50': os.path.join(current_dir, 'models', 'resnet50_model.keras'),
|
| 21 |
}
|
| 22 |
|
| 23 |
# Load models and handle potential exceptions
|
|
|
|
| 92 |
return images
|
| 93 |
|
| 94 |
# Directory for example images
|
| 95 |
+
images_dir = os.path.join(current_dir, 'images')
|
| 96 |
examples = get_example_images(images_dir, (50, 50))
|
| 97 |
|
| 98 |
# Function to preprocess the image and predict the class
|