Spaces:
Sleeping
Sleeping
Kushwanth Chowday Kandala
commited on
Commit
·
be1c697
1
Parent(s):
908d9b4
update upload a image
Browse files
app.py
CHANGED
|
@@ -43,10 +43,13 @@ for i in st.session_state["chat_history"]:
|
|
| 43 |
st.write(i["content"])
|
| 44 |
|
| 45 |
|
| 46 |
-
#
|
| 47 |
-
# from PIL import Image
|
| 48 |
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
st.write(i["content"])
|
| 44 |
|
| 45 |
|
| 46 |
+
# img_file_buffer = st.file_uploader('Upload a PNG image', type='png')
|
|
|
|
| 47 |
|
| 48 |
+
|
| 49 |
+
import numpy as np
|
| 50 |
+
from PIL import Image
|
| 51 |
+
|
| 52 |
+
img_file_buffer = st.file_uploader('Upload a PNG image', on_change= type=['png','jpg'])
|
| 53 |
+
if img_file_buffer is not None:
|
| 54 |
+
image = Image.open(img_file_buffer)
|
| 55 |
+
img_array = np.array(image)
|