AfshinMA commited on
Commit
abf31f7
·
verified ·
1 Parent(s): 3253601

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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, 'Project_7_Traffic_Sign_Detection', 'models', 'cnn_model.keras'),
19
- 'VGG19': os.path.join(current_dir, 'Project_7_Traffic_Sign_Detection', 'models', 'vgg19_model.keras'),
20
- 'ResNet50': os.path.join(current_dir, 'Project_7_Traffic_Sign_Detection', 'models', 'resnet50_model.keras'),
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, 'Project_7_Traffic_Sign_Detection', 'images')
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