reab5555 commited on
Commit
9ebaa8a
·
verified ·
1 Parent(s): 5b92b22

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -76,7 +76,7 @@ def analyze_image(image):
76
  Additionally, write one sentence about what would be expected in this scene, and one sentence about what is unexpected.
77
  Provide the response as a JSON with the following structure:
78
  {
79
- "label": "[Surprising OR Not Surprising]",
80
  "element": "[element]",
81
  "rating": [1-5],
82
  "expected": "[one sentence about what would be expected]",
@@ -349,7 +349,7 @@ def process_and_analyze(image):
349
 
350
  print(f"Response data: {response_data}") # Debug print
351
 
352
- if response_data["label"].lower() == "Surprising" and response_data["element"].lower() != "na":
353
  try:
354
  print("Starting image detection...") # Debug print
355
  result_buf = process_image_detection(image, response_data["element"], response_data["rating"])
 
76
  Additionally, write one sentence about what would be expected in this scene, and one sentence about what is unexpected.
77
  Provide the response as a JSON with the following structure:
78
  {
79
+ "label": "[surprising OR not surprising]",
80
  "element": "[element]",
81
  "rating": [1-5],
82
  "expected": "[one sentence about what would be expected]",
 
349
 
350
  print(f"Response data: {response_data}") # Debug print
351
 
352
+ if response_data["label"].lower() == "surprising" and response_data["element"].lower() != "na":
353
  try:
354
  print("Starting image detection...") # Debug print
355
  result_buf = process_image_detection(image, response_data["element"], response_data["rating"])