Spaces:
Sleeping
Sleeping
π Fix Stage 3 feature analysis display issue
Browse files- Add proper handling for feature_descriptions field (which is a list)
- Add detailed logging to debug stage result content
- Now properly displays actual VLM feature analysis instead of generic 'Analysis completed'
π€ Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
app.py
CHANGED
|
@@ -292,11 +292,26 @@ if current_image is not None:
|
|
| 292 |
elif status == "completed":
|
| 293 |
stage_statuses[stage_key].success(f"β
{stage_name}: Completed")
|
| 294 |
|
| 295 |
-
# Extract content from stage data
|
| 296 |
if isinstance(data, dict):
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 300 |
|
| 301 |
if content and content.startswith('```'):
|
| 302 |
lines = content.split('\n')
|
|
|
|
| 292 |
elif status == "completed":
|
| 293 |
stage_statuses[stage_key].success(f"β
{stage_name}: Completed")
|
| 294 |
|
| 295 |
+
# Extract content from stage data
|
| 296 |
if isinstance(data, dict):
|
| 297 |
+
logger.info(f"Stage {stage_key} data keys: {list(data.keys())}")
|
| 298 |
+
|
| 299 |
+
# Handle different stage result formats
|
| 300 |
+
content = data.get('description')
|
| 301 |
+
if not content:
|
| 302 |
+
content = data.get('segmentation_guidance')
|
| 303 |
+
if not content:
|
| 304 |
+
content = data.get('population_summary')
|
| 305 |
+
if not content:
|
| 306 |
+
# Stage 3 feature_descriptions is a list
|
| 307 |
+
feature_descs = data.get('feature_descriptions', [])
|
| 308 |
+
logger.info(f"Stage 3 feature_descriptions: {feature_descs}")
|
| 309 |
+
if feature_descs and isinstance(feature_descs, list):
|
| 310 |
+
content = '\n'.join(str(desc) for desc in feature_descs)
|
| 311 |
+
else:
|
| 312 |
+
content = 'Analysis completed'
|
| 313 |
+
|
| 314 |
+
logger.info(f"Stage {stage_key} final content: {content[:100]}...")
|
| 315 |
|
| 316 |
if content and content.startswith('```'):
|
| 317 |
lines = content.split('\n')
|