Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -219,7 +219,7 @@ with col1:
|
|
| 219 |
y=np.sin(np.radians(rotation_y)) * np.cos(np.radians(rotation_x)),
|
| 220 |
z=np.sin(np.radians(rotation_x))))))
|
| 221 |
|
| 222 |
-
st.plotly_chart(fig)
|
| 223 |
|
| 224 |
# Use st_canvas for touch input
|
| 225 |
canvas_result = st_canvas(
|
|
@@ -250,31 +250,31 @@ with col2:
|
|
| 250 |
use_synesthesia = st.checkbox("Enable Synesthesia", value=False)
|
| 251 |
|
| 252 |
# Initialize EnhancedAutonomy
|
| 253 |
-
if 'autonomy' not in st.session_state:
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
if canvas_result.json_data is not None:
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
|
| 279 |
# Calculate overall sensations
|
| 280 |
pain_level = pain * measured_pressure * touch_pressure
|
|
@@ -295,26 +295,27 @@ if canvas_result.json_data is not None:
|
|
| 295 |
neural_inputs = [pain_level, pleasure_level, measured_pressure, measured_temp, measured_em, tickle_level, itch_level, proprioception]
|
| 296 |
neural_response = NeuralNetworkSimulator.process(neural_inputs)
|
| 297 |
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
|
|
|
| 318 |
# Define the prompt_template and ai_response
|
| 319 |
prompt_template = (
|
| 320 |
"Human: Analyze the sensory input for a hyper-advanced AI humanoid:\n"
|
|
|
|
| 219 |
y=np.sin(np.radians(rotation_y)) * np.cos(np.radians(rotation_x)),
|
| 220 |
z=np.sin(np.radians(rotation_x))))))
|
| 221 |
|
| 222 |
+
st.plotly_chart(fig, use_container_width=True)
|
| 223 |
|
| 224 |
# Use st_canvas for touch input
|
| 225 |
canvas_result = st_canvas(
|
|
|
|
| 250 |
use_synesthesia = st.checkbox("Enable Synesthesia", value=False)
|
| 251 |
|
| 252 |
# Initialize EnhancedAutonomy
|
| 253 |
+
if 'autonomy' not in st.session_state:
|
| 254 |
+
st.session_state.autonomy = EnhancedAutonomy()
|
| 255 |
+
|
| 256 |
+
if canvas_result.json_data is not None:
|
| 257 |
+
objects = canvas_result.json_data["objects"]
|
| 258 |
+
if len(objects) > 0:
|
| 259 |
+
last_touch = objects[-1]
|
| 260 |
+
touch_x, touch_y = last_touch["left"], last_touch["top"]
|
| 261 |
+
|
| 262 |
+
sensation = avatar_sensation_map[int(touch_y), int(touch_x)]
|
| 263 |
+
(
|
| 264 |
+
pain, pleasure, pressure_sens, temp_sens, texture_sens,
|
| 265 |
+
em_sens, tickle_sens, itch_sens, quantum_sens, neural_sens,
|
| 266 |
+
proprioception_sens, synesthesia_sens
|
| 267 |
+
) = sensation
|
| 268 |
|
| 269 |
+
measured_pressure = QuantumSensor.measure(touch_x, touch_y, pressure_sens) * touch_pressure
|
| 270 |
+
measured_temp = NanoThermalSensor.measure(37, touch_pressure, touch_duration)
|
| 271 |
+
measured_texture = AdaptiveTextureSensor.measure(touch_x, touch_y)
|
| 272 |
+
measured_em = EMFieldSensor.measure(touch_x, touch_y, em_sens)
|
| 273 |
|
| 274 |
+
if use_quantum:
|
| 275 |
+
quantum_state = QuantumSensor.measure(touch_x, touch_y, quantum_sens)
|
| 276 |
+
else:
|
| 277 |
+
quantum_state = "N/A"
|
| 278 |
|
| 279 |
# Calculate overall sensations
|
| 280 |
pain_level = pain * measured_pressure * touch_pressure
|
|
|
|
| 295 |
neural_inputs = [pain_level, pleasure_level, measured_pressure, measured_temp, measured_em, tickle_level, itch_level, proprioception]
|
| 296 |
neural_response = NeuralNetworkSimulator.process(neural_inputs)
|
| 297 |
|
| 298 |
+
# Create a futuristic data display
|
| 299 |
+
data_display = f"""
|
| 300 |
+
```
|
| 301 |
+
βββββββββββββββββββββββββββββββββββββββββββββββ
|
| 302 |
+
β Pressure : {measured_pressure:.2f}β
|
| 303 |
+
β Temperature : {measured_temp:.2f}Β°C β
|
| 304 |
+
β Texture : {measured_texture} β
|
| 305 |
+
β EM Field : {measured_em:.2f} ΞΌT β
|
| 306 |
+
β Quantum State: {quantum_state:.2f} β
|
| 307 |
+
βββββββββββββββββββββββββββββββββββββββββββββββ€
|
| 308 |
+
β Pain Level : {pain_level:.2f} β
|
| 309 |
+
β Pleasure : {pleasure_level:.2f} β
|
| 310 |
+
β Tickle : {tickle_level:.2f} β
|
| 311 |
+
β Itch : {itch_level:.2f} β
|
| 312 |
+
β Proprioception: {proprioception:.2f} β
|
| 313 |
+
β Synesthesia : {synesthesia} β
|
| 314 |
+
β Neural Response: {neural_response:.2f}β
|
| 315 |
+
βββββββββββββββββββββββββββββββββββββββββββββββ
|
| 316 |
+
```
|
| 317 |
+
"""
|
| 318 |
+
st.code(data_display, language="")
|
| 319 |
# Define the prompt_template and ai_response
|
| 320 |
prompt_template = (
|
| 321 |
"Human: Analyze the sensory input for a hyper-advanced AI humanoid:\n"
|