Rename Rubbish.py to app.py
Browse files- Rubbish.py +0 -4
- app.py +26 -0
Rubbish.py
DELETED
|
@@ -1,4 +0,0 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
|
| 3 |
-
x = st.slider('Select a value')
|
| 4 |
-
st.write(x, 'squared is', x * x)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# app.py
|
| 2 |
+
import streamlit as st
|
| 3 |
+
from model import load_pipeline, generate_3d_gif
|
| 4 |
+
from PIL import Image
|
| 5 |
+
|
| 6 |
+
# Load pipeline once when the app starts
|
| 7 |
+
pipe = load_pipeline()
|
| 8 |
+
|
| 9 |
+
st.title("3D Model to GIF Generator")
|
| 10 |
+
prompt = st.text_input("Enter a prompt for the 3D model:", "a shark")
|
| 11 |
+
|
| 12 |
+
if st.button("Generate 3D GIF"):
|
| 13 |
+
with st.spinner("Generating 3D model..."):
|
| 14 |
+
gif_path = generate_3d_gif(pipe, prompt)
|
| 15 |
+
|
| 16 |
+
# Display the GIF
|
| 17 |
+
st.image(gif_path)
|
| 18 |
+
|
| 19 |
+
# Provide a download link
|
| 20 |
+
with open(gif_path, "rb") as file:
|
| 21 |
+
st.download_button(
|
| 22 |
+
label="Download GIF",
|
| 23 |
+
data=file,
|
| 24 |
+
file_name="generated_3d.gif",
|
| 25 |
+
mime="image/gif"
|
| 26 |
+
)
|