scdrand23 commited on
Commit
274d219
·
1 Parent(s): 8409fbf

reset to biomedparse+biomedllama_3b_multimodal

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -384,13 +384,14 @@ 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
  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):
 
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
  if prompt in detailed_analysis.lower():
390
+ color = colors[count % len(colors)]
391
+ color_name = {(255,0,0): "red", (0,255,0): "green", (0,0,255): "blue", (255,255,0): "yellow", (255,0,255): "magenta"}[color]
392
  color_descriptions.append(f"The {prompt} is highlighted in {color_name} color for reference")
393
  found_prompts.append(prompt)
394
+ count += 1
395
 
396
  # Second loop: only process prompts found in analysis
397
  for idx, prompt in enumerate(found_prompts):