Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,9 @@ import streamlit.components.v1 as components
|
|
| 5 |
from transformers import pipeline
|
| 6 |
from gtts import gTTS
|
| 7 |
import os
|
|
|
|
| 8 |
|
|
|
|
| 9 |
st.set_page_config(page_title="AR/VR Code Visualizer", layout="wide")
|
| 10 |
st.title("π AR/VR Code Visualizer with Editing, Interaction, and Export")
|
| 11 |
|
|
@@ -142,5 +144,20 @@ if code.strip():
|
|
| 142 |
|
| 143 |
st.subheader("π Interactive 3D Function Visualizer")
|
| 144 |
components.iframe(data_url, height=600)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
else:
|
| 146 |
st.info("Write some Python code above to visualize, narrate, and explore it in VR.")
|
|
|
|
| 5 |
from transformers import pipeline
|
| 6 |
from gtts import gTTS
|
| 7 |
import os
|
| 8 |
+
import qrcode # QR code generation
|
| 9 |
|
| 10 |
+
# Set up the Streamlit page
|
| 11 |
st.set_page_config(page_title="AR/VR Code Visualizer", layout="wide")
|
| 12 |
st.title("π AR/VR Code Visualizer with Editing, Interaction, and Export")
|
| 13 |
|
|
|
|
| 144 |
|
| 145 |
st.subheader("π Interactive 3D Function Visualizer")
|
| 146 |
components.iframe(data_url, height=600)
|
| 147 |
+
|
| 148 |
+
# QR Code for AR View on Mobile
|
| 149 |
+
qr = qrcode.QRCode(
|
| 150 |
+
version=1,
|
| 151 |
+
error_correction=qrcode.constants.ERROR_CORRECT_L,
|
| 152 |
+
box_size=10,
|
| 153 |
+
border=4,
|
| 154 |
+
)
|
| 155 |
+
url = "https://huggingface.co/spaces/your-space-url" # Replace with your Hugging Face Space URL
|
| 156 |
+
qr.add_data(url)
|
| 157 |
+
qr.make(fit=True)
|
| 158 |
+
|
| 159 |
+
# Create and display the QR Code
|
| 160 |
+
img = qr.make_image(fill='black', back_color='white')
|
| 161 |
+
st.image(img, caption="Scan this QR code to view the VR scene in AR on your mobile!")
|
| 162 |
else:
|
| 163 |
st.info("Write some Python code above to visualize, narrate, and explore it in VR.")
|