Spaces:
Running
Running
Commit
·
e05bf5d
1
Parent(s):
b55565e
Update app.py
Browse files
app.py
CHANGED
@@ -63,7 +63,7 @@ uploaded_file = st.file_uploader("", type=['jpg', 'png', 'jpeg', 'mp4'])
|
|
63 |
if uploaded_file is not None:
|
64 |
file_extension = os.path.splitext(uploaded_file.name)[1].lower()
|
65 |
|
66 |
-
if file_extension in ['jpg', 'png', 'jpeg']:
|
67 |
image = Image.open(uploaded_file)
|
68 |
|
69 |
col1, col2 = st.columns([0.5, 0.5])
|
@@ -90,7 +90,8 @@ if uploaded_file is not None:
|
|
90 |
st.image(out_img_siggraph17, width=300)
|
91 |
else:
|
92 |
st.image(image, width=300)
|
93 |
-
|
|
|
94 |
# Save the video file to a temporary location
|
95 |
temp_file = tempfile.NamedTemporaryFile(delete=False)
|
96 |
temp_file.write(uploaded_file.read())
|
|
|
63 |
if uploaded_file is not None:
|
64 |
file_extension = os.path.splitext(uploaded_file.name)[1].lower()
|
65 |
|
66 |
+
if file_extension in ['.jpg', '.png', '.jpeg']:
|
67 |
image = Image.open(uploaded_file)
|
68 |
|
69 |
col1, col2 = st.columns([0.5, 0.5])
|
|
|
90 |
st.image(out_img_siggraph17, width=300)
|
91 |
else:
|
92 |
st.image(image, width=300)
|
93 |
+
|
94 |
+
elif file_extension == '.mp4': # If uploaded file is a video
|
95 |
# Save the video file to a temporary location
|
96 |
temp_file = tempfile.NamedTemporaryFile(delete=False)
|
97 |
temp_file.write(uploaded_file.read())
|