reset to biomedparse+biomedllama_3b_multimodal
Browse files
app.py
CHANGED
@@ -384,15 +384,13 @@ def process_image(image_path, user_prompt, modality=None):
|
|
384 |
color_descriptions = []
|
385 |
# First loop: collect prompts found in the analysis
|
386 |
found_prompts = []
|
387 |
-
count = 0
|
388 |
for idx, prompt in enumerate(relevant_prompts):
|
389 |
-
|
390 |
-
|
391 |
-
color_name = {(255,0,0): "red", (0,255,0): "green", (0,0,255): "blue",
|
392 |
(255,255,0): "yellow", (255,0,255): "magenta"}[color]
|
|
|
393 |
color_descriptions.append(f"The {prompt} is highlighted in {color_name} color for reference")
|
394 |
found_prompts.append(prompt)
|
395 |
-
count += 1
|
396 |
|
397 |
# Second loop: only process prompts found in analysis
|
398 |
for idx, prompt in enumerate(found_prompts):
|
|
|
384 |
color_descriptions = []
|
385 |
# First loop: collect prompts found in the analysis
|
386 |
found_prompts = []
|
|
|
387 |
for idx, prompt in enumerate(relevant_prompts):
|
388 |
+
color = colors[idx % len(colors)]
|
389 |
+
color_name = {(255,0,0): "red", (0,255,0): "green", (0,0,255): "blue",
|
|
|
390 |
(255,255,0): "yellow", (255,0,255): "magenta"}[color]
|
391 |
+
if prompt in detailed_analysis.lower():
|
392 |
color_descriptions.append(f"The {prompt} is highlighted in {color_name} color for reference")
|
393 |
found_prompts.append(prompt)
|
|
|
394 |
|
395 |
# Second loop: only process prompts found in analysis
|
396 |
for idx, prompt in enumerate(found_prompts):
|