Update app/routes.py
Browse files- app/routes.py +0 -10
app/routes.py
CHANGED
|
@@ -34,16 +34,6 @@ def analyze_ingredients():
|
|
| 34 |
text_input = data.get('ingredients') or request.form.get('ingredients')
|
| 35 |
logging.info(f"Text input from JSON/form: {text_input}")
|
| 36 |
|
| 37 |
-
# Fallback OCR from form field 'image'
|
| 38 |
-
if not text_input and 'image' in request.files:
|
| 39 |
-
from PIL import Image
|
| 40 |
-
import pytesseract
|
| 41 |
-
logging.info("Fallback OCR from 'image' field")
|
| 42 |
-
image_file = request.files['image']
|
| 43 |
-
image = Image.open(image_file.stream)
|
| 44 |
-
text_input = pytesseract.image_to_string(image)
|
| 45 |
-
logging.info(f"Fallback OCR text result: {text_input}")
|
| 46 |
-
|
| 47 |
# Parse text input
|
| 48 |
if isinstance(text_input, str):
|
| 49 |
import re
|
|
|
|
| 34 |
text_input = data.get('ingredients') or request.form.get('ingredients')
|
| 35 |
logging.info(f"Text input from JSON/form: {text_input}")
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
# Parse text input
|
| 38 |
if isinstance(text_input, str):
|
| 39 |
import re
|