Spaces:
Sleeping
Sleeping
Dharini Baskaran
commited on
Commit
·
573eb90
1
Parent(s):
24ad810
updated app.py
Browse files
app.py
CHANGED
|
@@ -98,10 +98,14 @@ def predict(uploaded_file_path):
|
|
| 98 |
if uploaded_file_path is None:
|
| 99 |
return None, None, "No file uploaded."
|
| 100 |
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
|
| 106 |
# Prepare output paths
|
| 107 |
output_json_name = input_filename.replace(".png", "_result.json").replace(".jpg", "_result.json").replace(".jpeg", "_result.json")
|
|
|
|
| 98 |
if uploaded_file_path is None:
|
| 99 |
return None, None, "No file uploaded."
|
| 100 |
|
| 101 |
+
uploaded_path = uploaded_file.name
|
| 102 |
+
input_filename = os.path.basename(uploaded_path)
|
| 103 |
+
print(f"✅ Image received at {uploaded_path}")
|
| 104 |
+
|
| 105 |
+
# input_filename = os.path.basename(uploaded_file_path)
|
| 106 |
+
# uploaded_path = os.path.join(UPLOAD_DIR, input_filename)
|
| 107 |
+
# shutil.copy(uploaded_file_path, uploaded_path)
|
| 108 |
+
# print(f"✅ Image saved to {uploaded_path}")
|
| 109 |
|
| 110 |
# Prepare output paths
|
| 111 |
output_json_name = input_filename.replace(".png", "_result.json").replace(".jpg", "_result.json").replace(".jpeg", "_result.json")
|