Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,6 +8,7 @@ import warnings
|
|
| 8 |
from PIL import Image
|
| 9 |
import streamlit as st
|
| 10 |
warnings.filterwarnings("ignore", category=UserWarning)
|
|
|
|
| 11 |
|
| 12 |
|
| 13 |
|
|
@@ -49,9 +50,13 @@ file = st.file_uploader('Upload an Image',type=(["jpeg","jpg","png"]))
|
|
| 49 |
if file is None:
|
| 50 |
st.write("Please upload an image file")
|
| 51 |
else:
|
| 52 |
-
image= Image.open(
|
| 53 |
st.image(image,use_column_width = True)
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
|
| 57 |
|
|
|
|
| 8 |
from PIL import Image
|
| 9 |
import streamlit as st
|
| 10 |
warnings.filterwarnings("ignore", category=UserWarning)
|
| 11 |
+
from tempfile import NamedTemporaryFile
|
| 12 |
|
| 13 |
|
| 14 |
|
|
|
|
| 50 |
if file is None:
|
| 51 |
st.write("Please upload an image file")
|
| 52 |
else:
|
| 53 |
+
image= Image.open(f)
|
| 54 |
st.image(image,use_column_width = True)
|
| 55 |
+
with NamedTemporaryFile(dir='.', suffix='.csv') as f:
|
| 56 |
+
f.write(file.getbuffer())
|
| 57 |
+
#your_function_which_takes_a_path(f.name)
|
| 58 |
+
|
| 59 |
+
detect_object(f.name)
|
| 60 |
|
| 61 |
|
| 62 |
|