Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -60,10 +60,13 @@ def main():
|
|
| 60 |
st.write('## Preview')
|
| 61 |
if uploaded_file and input_file:
|
| 62 |
st.write('### Text File Contents')
|
|
|
|
| 63 |
input_data = pd.read_csv(input_file)
|
| 64 |
st.write(input_data)
|
| 65 |
st.write('### Image Preview')
|
| 66 |
-
|
|
|
|
|
|
|
| 67 |
st.image(img, channels='BGR', caption='Uploaded Image')
|
| 68 |
|
| 69 |
|
|
|
|
| 60 |
st.write('## Preview')
|
| 61 |
if uploaded_file and input_file:
|
| 62 |
st.write('### Text File Contents')
|
| 63 |
+
# read input file into a variable before closing it
|
| 64 |
input_data = pd.read_csv(input_file)
|
| 65 |
st.write(input_data)
|
| 66 |
st.write('### Image Preview')
|
| 67 |
+
# read image file into a variable before closing it
|
| 68 |
+
img_bytes = uploaded_file.read()
|
| 69 |
+
img = cv2.imdecode(np.frombuffer(img_bytes, np.uint8), 1)
|
| 70 |
st.image(img, channels='BGR', caption='Uploaded Image')
|
| 71 |
|
| 72 |
|