Chamin09 commited on
Commit
fe24486
·
verified ·
1 Parent(s): c86d747

updated Gradio app.py to display new image analysis info.

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -46,14 +46,25 @@ Label: {text_result['label']}
46
  Confidence: {text_result['confidence']:.2%}
47
  """)
48
 
 
 
 
 
 
 
 
 
 
49
  if image_result:
50
  output_parts.append(f"""
51
  Image Analysis Results:
52
  ----------------------
53
  Caption: {image_result['caption']}
54
  Model Used: {image_result['model_used']}
 
55
  Confidence: {image_result['confidence']:.2%}
56
  """)
 
57
 
58
  # Add correlation analysis if both text and image were processed
59
  if final_analysis["correlation"]:
 
46
  Confidence: {text_result['confidence']:.2%}
47
  """)
48
 
49
+ # if image_result:
50
+ # output_parts.append(f"""
51
+ # Image Analysis Results:
52
+ # ----------------------
53
+ # Caption: {image_result['caption']}
54
+ # Model Used: {image_result['model_used']}
55
+ # Confidence: {image_result['confidence']:.2%}
56
+ # """)
57
+
58
  if image_result:
59
  output_parts.append(f"""
60
  Image Analysis Results:
61
  ----------------------
62
  Caption: {image_result['caption']}
63
  Model Used: {image_result['model_used']}
64
+ Safety: {"Safe" if image_result['is_safe'] else "Potentially Unsafe"}
65
  Confidence: {image_result['confidence']:.2%}
66
  """)
67
+
68
 
69
  # Add correlation analysis if both text and image were processed
70
  if final_analysis["correlation"]: