Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,17 +1,14 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
from io import BytesIO
|
| 3 |
-
import imageio.v3 as iio
|
| 4 |
import os
|
| 5 |
|
| 6 |
def get_image_path(img):
|
| 7 |
-
# Create a directory and save the uploaded image.
|
| 8 |
file_path = f"data/uploadedImages/{img.name}"
|
| 9 |
os.makedirs(os.path.dirname(file_path), exist_ok=True)
|
| 10 |
with open(file_path, "wb") as img_file:
|
| 11 |
img_file.write(img.getbuffer())
|
| 12 |
return file_path
|
| 13 |
|
| 14 |
-
uploaded_file = st.file_uploader("**Upload
|
| 15 |
if uploaded_file is not None:
|
| 16 |
# Get actual image file
|
| 17 |
bytes_data = get_image_path(uploaded_file)
|
|
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
| 2 |
import os
|
| 3 |
|
| 4 |
def get_image_path(img):
|
|
|
|
| 5 |
file_path = f"data/uploadedImages/{img.name}"
|
| 6 |
os.makedirs(os.path.dirname(file_path), exist_ok=True)
|
| 7 |
with open(file_path, "wb") as img_file:
|
| 8 |
img_file.write(img.getbuffer())
|
| 9 |
return file_path
|
| 10 |
|
| 11 |
+
uploaded_file = st.file_uploader("**Upload Image**", type= ['png', 'jpg'] )
|
| 12 |
if uploaded_file is not None:
|
| 13 |
# Get actual image file
|
| 14 |
bytes_data = get_image_path(uploaded_file)
|