Sephfox commited on
Commit
d8bfff4
1 Parent(s): 6a06b12

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -10
app.py CHANGED
@@ -578,16 +578,6 @@ def create_avatar():
578
 
579
  return img
580
 
581
- # Adjust alpha channel of heatmap
582
- data = np.array(heatmap_img)
583
- if data.shape[2] == 3: # If RGB, add an alpha channel
584
- data = np.concatenate([data, np.full((data.shape[0], data.shape[1], 1), 255, dtype=np.uint8)], axis=2)
585
- data[:, :, 3] = data[:, :, 3] * 0.5 # Reduce opacity to 50%
586
- heatmap_img = Image.fromarray(data)
587
-
588
- combined_img = Image.alpha_composite(avatar_img.convert('RGBA'), heatmap_img)
589
- return combined_img
590
-
591
 
592
  # Create and display avatar with heatmap
593
  st.subheader("Avatar with Sensation Heatmap")
@@ -647,6 +637,15 @@ def create_avatar():
647
  draw.line([start, end], fill=(0, 255, 255, 50), width=1)
648
 
649
  return img
 
 
 
 
 
 
 
 
 
650
 
651
  # Streamlit app
652
  st.title("NeuraSense AI: Advanced Humanoid Techno-Sensory Simulation")
 
578
 
579
  return img
580
 
 
 
 
 
 
 
 
 
 
 
581
 
582
  # Create and display avatar with heatmap
583
  st.subheader("Avatar with Sensation Heatmap")
 
637
  draw.line([start, end], fill=(0, 255, 255, 50), width=1)
638
 
639
  return img
640
+ # Adjust alpha channel of heatmap
641
+ data = np.array(heatmap_img)
642
+ if data.shape[2] == 3: # If RGB, add an alpha channel
643
+ data = np.concatenate([data, np.full((data.shape[0], data.shape[1], 1), 255, dtype=np.uint8)], axis=2)
644
+ data[:, :, 3] = data[:, :, 3] * 0.5 # Reduce opacity to 50%
645
+ heatmap_img = Image.fromarray(data)
646
+
647
+ combined_img = Image.alpha_composite(avatar_img.convert('RGBA'), heatmap_img)
648
+ return combined_img
649
 
650
  # Streamlit app
651
  st.title("NeuraSense AI: Advanced Humanoid Techno-Sensory Simulation")