Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -24,13 +24,14 @@ user_image_object = st.file_uploader("upload your image", type=['png', 'jpg'], a
|
|
24 |
if user_image_object is not None:
|
25 |
st.image(user_image_object )
|
26 |
|
|
|
27 |
user_image_name = "input_image.png"
|
28 |
|
29 |
#re-encode for streamlit interface
|
30 |
-
user_image_object.save(user_image_name )
|
31 |
|
32 |
# load image with alpha channel
|
33 |
-
img = cv2.imread(
|
34 |
|
35 |
# extract alpha channel
|
36 |
#alpha = img[:,:,3]
|
@@ -52,7 +53,6 @@ if user_image_object is not None:
|
|
52 |
my_hue_list = list( range(0, 180, color_step) ) #Color step basically gives step range of this list, ie if color_step = 2 then it is [0,2,4,6,....,178]
|
53 |
#180 at end means highest it can go is 179 (same as hue param )
|
54 |
#including 0 makes original image part of the outputs/gif
|
55 |
-
print(my_hue_list)
|
56 |
|
57 |
#H,S,V = Hue , Saturation, Value (ie color value) parameters
|
58 |
#Hue has range [0,179] , Saturation [0,255] , Value [0,255]
|
|
|
24 |
if user_image_object is not None:
|
25 |
st.image(user_image_object )
|
26 |
|
27 |
+
|
28 |
user_image_name = "input_image.png"
|
29 |
|
30 |
#re-encode for streamlit interface
|
31 |
+
#user_image_object.save(user_image_name )
|
32 |
|
33 |
# load image with alpha channel
|
34 |
+
img = cv2.imread( user_image_object , cv2.IMREAD_UNCHANGED)
|
35 |
|
36 |
# extract alpha channel
|
37 |
#alpha = img[:,:,3]
|
|
|
53 |
my_hue_list = list( range(0, 180, color_step) ) #Color step basically gives step range of this list, ie if color_step = 2 then it is [0,2,4,6,....,178]
|
54 |
#180 at end means highest it can go is 179 (same as hue param )
|
55 |
#including 0 makes original image part of the outputs/gif
|
|
|
56 |
|
57 |
#H,S,V = Hue , Saturation, Value (ie color value) parameters
|
58 |
#Hue has range [0,179] , Saturation [0,255] , Value [0,255]
|