Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,7 @@ import requests
|
|
5 |
import io
|
6 |
from PIL import Image
|
7 |
import os
|
8 |
-
|
9 |
-
import numpy as np
|
10 |
|
11 |
# Create a text input
|
12 |
|
@@ -28,16 +27,10 @@ image_bytes = query({
|
|
28 |
"inputs": user_input,
|
29 |
})
|
30 |
|
31 |
-
def bytes_to_image_opencv(image_bytes):
|
32 |
-
np_arr = np.frombuffer(image_bytes, np.uint8)
|
33 |
-
image = cv2.imdecode(np_arr, cv2.IMREAD_COLOR)
|
34 |
-
return image
|
35 |
|
36 |
-
result_image_opencv = bytes_to_image_opencv(image_bytes)
|
37 |
-
st.image(result_image_opencv,caption="image",output_format="JPG")
|
38 |
|
39 |
-
|
40 |
-
|
41 |
# st.image(image=image,caption="image")
|
42 |
# st.image(image)
|
43 |
# st.image(image : image,caption=image)
|
|
|
5 |
import io
|
6 |
from PIL import Image
|
7 |
import os
|
8 |
+
|
|
|
9 |
|
10 |
# Create a text input
|
11 |
|
|
|
27 |
"inputs": user_input,
|
28 |
})
|
29 |
|
|
|
|
|
|
|
|
|
30 |
|
|
|
|
|
31 |
|
32 |
+
image = Image.open(io.BytesIO(image_bytes))
|
33 |
+
st.image(image, caption="image", width=None, use_column_width=None, clamp=False, channels="RGB", output_format="PNG")
|
34 |
# st.image(image=image,caption="image")
|
35 |
# st.image(image)
|
36 |
# st.image(image : image,caption=image)
|