Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -583,22 +583,22 @@ if canvas_result.json_data is not None:
|
|
| 583 |
|
| 584 |
|
| 585 |
# Calculate overall sensations
|
| 586 |
-
|
| 587 |
pleasure_level = pleasure * (measured_temp - 37) / 10
|
| 588 |
tickle_level = tickle_sens * (1 - np.exp(-touch_duration / 0.5))
|
| 589 |
itch_level = itch_sens * (1 - np.exp(-touch_duration / 1.5))
|
| 590 |
|
| 591 |
# Proprioception (sense of body position)
|
| 592 |
-
|
| 593 |
|
| 594 |
# Synesthesia (mixing of senses)
|
| 595 |
-
|
| 596 |
synesthesia = synesthesia_sens * (measured_pressure + measured_temp + measured_em) / 3
|
| 597 |
-
|
| 598 |
synesthesia = "N/A"
|
| 599 |
|
| 600 |
# Neural network simulation
|
| 601 |
-
|
| 602 |
neural_response = NeuralNetworkSimulator.process(neural_inputs)
|
| 603 |
|
| 604 |
|
|
|
|
| 583 |
|
| 584 |
|
| 585 |
# Calculate overall sensations
|
| 586 |
+
pain_level = pain * measured_pressure * touch_pressure
|
| 587 |
pleasure_level = pleasure * (measured_temp - 37) / 10
|
| 588 |
tickle_level = tickle_sens * (1 - np.exp(-touch_duration / 0.5))
|
| 589 |
itch_level = itch_sens * (1 - np.exp(-touch_duration / 1.5))
|
| 590 |
|
| 591 |
# Proprioception (sense of body position)
|
| 592 |
+
proprioception = proprioception_sens * np.linalg.norm([touch_x - AVATAR_WIDTH/2, touch_y - AVATAR_HEIGHT/2]) / (AVATAR_WIDTH/2)
|
| 593 |
|
| 594 |
# Synesthesia (mixing of senses)
|
| 595 |
+
if use_synesthesia:
|
| 596 |
synesthesia = synesthesia_sens * (measured_pressure + measured_temp + measured_em) / 3
|
| 597 |
+
else:
|
| 598 |
synesthesia = "N/A"
|
| 599 |
|
| 600 |
# Neural network simulation
|
| 601 |
+
neural_inputs = [pain_level, pleasure_level, measured_pressure, measured_temp, measured_em, tickle_level, itch_level, proprioception]
|
| 602 |
neural_response = NeuralNetworkSimulator.process(neural_inputs)
|
| 603 |
|
| 604 |
|