Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -72,6 +72,10 @@ def process_file_path(file_path_input):
|
|
72 |
file_path = file_path_input # Store the file path
|
73 |
|
74 |
logging.info(f"Received file path: {file_path}")
|
|
|
|
|
|
|
|
|
75 |
|
76 |
if not os.path.exists(file_path):
|
77 |
logging.error(f"File not found at {file_path}")
|
@@ -81,6 +85,7 @@ def process_file_path(file_path_input):
|
|
81 |
logging.info(f"Processing image from path: {file_path}")
|
82 |
return predict_from_image(image)
|
83 |
|
|
|
84 |
# Function to fetch the result (for the GET request)
|
85 |
def fetch_result():
|
86 |
if file_path:
|
|
|
72 |
file_path = file_path_input # Store the file path
|
73 |
|
74 |
logging.info(f"Received file path: {file_path}")
|
75 |
+
|
76 |
+
# Ensure the path is correctly formatted for Windows
|
77 |
+
file_path = file_path.replace("\\", "/") # Replace backslashes with forward slashes
|
78 |
+
logging.info(f"Corrected file path: {file_path}")
|
79 |
|
80 |
if not os.path.exists(file_path):
|
81 |
logging.error(f"File not found at {file_path}")
|
|
|
85 |
logging.info(f"Processing image from path: {file_path}")
|
86 |
return predict_from_image(image)
|
87 |
|
88 |
+
|
89 |
# Function to fetch the result (for the GET request)
|
90 |
def fetch_result():
|
91 |
if file_path:
|