r1sh1 commited on
Commit
459aa22
·
verified ·
1 Parent(s): 4f0afec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
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.20 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,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.20, "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,11 +133,11 @@ async def analyze_creative(
133
  h = int(hashlib.md5(seed.encode()).hexdigest(), 16)
134
 
135
  scores = {
136
- "visual_saliency": 0.20 + ((h % 31) / 100),
137
- "cognitive_ease": 0.20 + (((h // 2) % 31) / 100),
138
- "emotional_arousal": 0.20 + (((h // 5) % 31) / 100),
139
- "value_recognition": 0.20 + (((h // 11) % 31) / 100),
140
- "memory_encoding": 0.20 + (((h // 7) % 31) / 100),
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.",