Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -110,7 +110,7 @@ def predict_xray(image):
|
|
| 110 |
logger.error(f"Error in prediction: {e}")
|
| 111 |
return f"Error: {str(e)}"
|
| 112 |
|
| 113 |
-
# Enhanced PDF analysis function
|
| 114 |
def analyze_report(file):
|
| 115 |
if not file or not file.name.endswith(".pdf"):
|
| 116 |
return "Please upload a valid PDF file."
|
|
@@ -132,9 +132,9 @@ def analyze_report(file):
|
|
| 132 |
condition = "Pneumonia"
|
| 133 |
# Add more keyword matching conditions as needed
|
| 134 |
|
|
|
|
| 135 |
disease_status = f"Disease Identified: {condition}"
|
| 136 |
-
|
| 137 |
-
return f"{disease_status}\n\nPreview:\n{preview}"
|
| 138 |
|
| 139 |
except Exception as e:
|
| 140 |
logger.error(f"Failed to process PDF: {e}")
|
|
|
|
| 110 |
logger.error(f"Error in prediction: {e}")
|
| 111 |
return f"Error: {str(e)}"
|
| 112 |
|
| 113 |
+
# Enhanced PDF analysis function (No preview)
|
| 114 |
def analyze_report(file):
|
| 115 |
if not file or not file.name.endswith(".pdf"):
|
| 116 |
return "Please upload a valid PDF file."
|
|
|
|
| 132 |
condition = "Pneumonia"
|
| 133 |
# Add more keyword matching conditions as needed
|
| 134 |
|
| 135 |
+
# Return only the identified condition without preview
|
| 136 |
disease_status = f"Disease Identified: {condition}"
|
| 137 |
+
return f"{disease_status}"
|
|
|
|
| 138 |
|
| 139 |
except Exception as e:
|
| 140 |
logger.error(f"Failed to process PDF: {e}")
|