Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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": "[
|
| 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() == "
|
| 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"])
|