Spaces:
Sleeping
Sleeping
Added download button
Browse files
app.py
CHANGED
|
@@ -192,6 +192,12 @@ elif app_mode == 'Check on Image':
|
|
| 192 |
st.subheader('Output Image')
|
| 193 |
st.image(out_image, channels = 'BGR', use_column_width = True)
|
| 194 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
elif app_mode == 'Check on Video':
|
| 196 |
|
| 197 |
st.set_option('deprecation.showfileUploaderEncoding', False)
|
|
|
|
| 192 |
st.subheader('Output Image')
|
| 193 |
st.image(out_image, channels = 'BGR', use_column_width = True)
|
| 194 |
|
| 195 |
+
pil_out_image = Image.fromarray(cv2.cvtColor(out_image, cv2.COLOR_BGR2RGB))
|
| 196 |
+
out_image_bytes = io.BytesIO()
|
| 197 |
+
pil_out_image.save(out_image_bytes, format='JPEG')
|
| 198 |
+
|
| 199 |
+
st.download_button('Download', data=out_image_bytes.getvalue(), file_name='out_image.jpg')
|
| 200 |
+
|
| 201 |
elif app_mode == 'Check on Video':
|
| 202 |
|
| 203 |
st.set_option('deprecation.showfileUploaderEncoding', False)
|