Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -107,6 +107,11 @@ def process_file(filename):
|
|
107 |
flash('No files selected for processing')
|
108 |
logging.warning("No files selected for processing")
|
109 |
return redirect(url_for('index'))
|
|
|
|
|
|
|
|
|
|
|
110 |
|
111 |
file_paths = [os.path.join(app.config['UPLOAD_FOLDER'], filename) for filename in uploaded_files]
|
112 |
logging.info(f"Processing files: {file_paths}")
|
@@ -150,10 +155,9 @@ def process_file(filename):
|
|
150 |
session['processed_Img'] = processed_Img
|
151 |
flash('Data processed and analyzed successfully')
|
152 |
logging.info("Data processed and analyzed successfully")
|
153 |
-
return jsonify(
|
154 |
-
|
155 |
-
|
156 |
-
)
|
157 |
|
158 |
@app.route('/result')
|
159 |
def result():
|
|
|
107 |
flash('No files selected for processing')
|
108 |
logging.warning("No files selected for processing")
|
109 |
return redirect(url_for('index'))
|
110 |
+
|
111 |
+
BASE_DIR = 'uploads/'
|
112 |
+
|
113 |
+
# Joining the base and the requested path
|
114 |
+
#file_paths = os.path.join(BASE_DIR, filename)
|
115 |
|
116 |
file_paths = [os.path.join(app.config['UPLOAD_FOLDER'], filename) for filename in uploaded_files]
|
117 |
logging.info(f"Processing files: {file_paths}")
|
|
|
155 |
session['processed_Img'] = processed_Img
|
156 |
flash('Data processed and analyzed successfully')
|
157 |
logging.info("Data processed and analyzed successfully")
|
158 |
+
return jsonify({'process_data': [processed_data],
|
159 |
+
'process_image': processed_Img
|
160 |
+
})
|
|
|
161 |
|
162 |
@app.route('/result')
|
163 |
def result():
|