ethanrom commited on
Commit
e7eeec0
·
1 Parent(s): 727a268

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
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
- img = cv2.imread(uploaded_file.name)
 
 
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