GDavila commited on
Commit
3ac8916
1 Parent(s): d52c181

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -60,6 +60,7 @@ if user_image_object is not None:
60
  #Hue has range [0,179] , Saturation [0,255] , Value [0,255]
61
 
62
  img_array = []
 
63
  for i in my_hue_list:
64
  # modify hue channel by adding difference and modulo 180 (modulo because hue parameter only goes up to index 180, shouldn't exceed that )
65
  hnew = np.mod(h + i, 180).astype(np.uint8) #<<<<<<<<<<<<<<<< where the iter comes in
@@ -78,7 +79,8 @@ if user_image_object is not None:
78
 
79
  # save output AS FILE LABELED BY ITERABLE
80
  output_filename = 'output_bgr_new_' + str(i) +'.png' #<<<<<<<<<<<<<<<< where the iter comes in
81
- #cv2.imwrite(output_filename, bgr_new)
 
82
 
83
 
84
  height, width, layers = bgr_new.shape
@@ -108,7 +110,7 @@ if user_image_object is not None:
108
  st.video(video_bytes )
109
  '''
110
 
111
- img, *imgs = [Image.open(f) for f in img_array]
112
  img.save(fp="output_gif.gif", format='GIF', append_images=imgs,
113
  save_all=True, duration=duration_parameter, loop=loop_parameter)
114
 
 
60
  #Hue has range [0,179] , Saturation [0,255] , Value [0,255]
61
 
62
  img_array = []
63
+ output_filename_array = []
64
  for i in my_hue_list:
65
  # modify hue channel by adding difference and modulo 180 (modulo because hue parameter only goes up to index 180, shouldn't exceed that )
66
  hnew = np.mod(h + i, 180).astype(np.uint8) #<<<<<<<<<<<<<<<< where the iter comes in
 
79
 
80
  # save output AS FILE LABELED BY ITERABLE
81
  output_filename = 'output_bgr_new_' + str(i) +'.png' #<<<<<<<<<<<<<<<< where the iter comes in
82
+ output_filename_array.append(output_filename)
83
+ cv2.imwrite(output_filename, bgr_new)
84
 
85
 
86
  height, width, layers = bgr_new.shape
 
110
  st.video(video_bytes )
111
  '''
112
 
113
+ img, *imgs = [Image.open(f) for f in output_filename_array]
114
  img.save(fp="output_gif.gif", format='GIF', append_images=imgs,
115
  save_all=True, duration=duration_parameter, loop=loop_parameter)
116