Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,7 +59,7 @@ def health_check():
|
|
| 59 |
}
|
| 60 |
prompt_template = """
|
| 61 |
You are a neuromarketing expert AI analyzing an ad creative image critically with emphasis on copy, CTA, best time and platform etc..
|
| 62 |
-
Evaluate this image strictly on these 5 cognitive parameters. Give a score between 0.
|
| 63 |
Also provide a VERY brief 1-sentence analytical reason based exactly on what is visibly in the image.
|
| 64 |
The parameters are:
|
| 65 |
- visual_saliency (How effectively it draws the eye with contrast, colors, shapes)
|
|
@@ -122,7 +122,7 @@ async def analyze_creative(
|
|
| 122 |
except Exception as e:
|
| 123 |
scores = {
|
| 124 |
"visual_saliency": 0.32, "cognitive_ease": 0.28,
|
| 125 |
-
"emotional_arousal": 0.
|
| 126 |
}
|
| 127 |
reasons = {k: f"Error: {str(e)[:50]}..." for k in scores}
|
| 128 |
insights = [f"API Error: {str(e)}"]
|
|
@@ -133,11 +133,11 @@ async def analyze_creative(
|
|
| 133 |
h = int(hashlib.md5(seed.encode()).hexdigest(), 16)
|
| 134 |
|
| 135 |
scores = {
|
| 136 |
-
"visual_saliency": 0.
|
| 137 |
-
"cognitive_ease": 0.
|
| 138 |
-
"emotional_arousal": 0.
|
| 139 |
-
"value_recognition": 0.
|
| 140 |
-
"memory_encoding": 0.
|
| 141 |
}
|
| 142 |
reasons = {
|
| 143 |
"visual_saliency": "Mock reason based on deterministic simulation.",
|
|
|
|
| 59 |
}
|
| 60 |
prompt_template = """
|
| 61 |
You are a neuromarketing expert AI analyzing an ad creative image critically with emphasis on copy, CTA, best time and platform etc..
|
| 62 |
+
Evaluate this image strictly on these 5 cognitive parameters. Give a score between 0.10 and 0.98.
|
| 63 |
Also provide a VERY brief 1-sentence analytical reason based exactly on what is visibly in the image.
|
| 64 |
The parameters are:
|
| 65 |
- visual_saliency (How effectively it draws the eye with contrast, colors, shapes)
|
|
|
|
| 122 |
except Exception as e:
|
| 123 |
scores = {
|
| 124 |
"visual_saliency": 0.32, "cognitive_ease": 0.28,
|
| 125 |
+
"emotional_arousal": 0.10, "value_recognition": 0.45, "memory_encoding": 0.24
|
| 126 |
}
|
| 127 |
reasons = {k: f"Error: {str(e)[:50]}..." for k in scores}
|
| 128 |
insights = [f"API Error: {str(e)}"]
|
|
|
|
| 133 |
h = int(hashlib.md5(seed.encode()).hexdigest(), 16)
|
| 134 |
|
| 135 |
scores = {
|
| 136 |
+
"visual_saliency": 0.10 + ((h % 31) / 100),
|
| 137 |
+
"cognitive_ease": 0.10 + (((h // 2) % 31) / 100),
|
| 138 |
+
"emotional_arousal": 0.10 + (((h // 5) % 31) / 100),
|
| 139 |
+
"value_recognition": 0.10 + (((h // 11) % 31) / 100),
|
| 140 |
+
"memory_encoding": 0.10 + (((h // 7) % 31) / 100),
|
| 141 |
}
|
| 142 |
reasons = {
|
| 143 |
"visual_saliency": "Mock reason based on deterministic simulation.",
|