Tiago Canzian commited on
Commit
480d697
1 Parent(s): bec97d6

fix: adding again ColorReplacer route

Browse files
Files changed (1) hide show
  1. server.py +5 -0
server.py CHANGED
@@ -134,6 +134,10 @@ async def recolor(file: UploadFile = File(...), colors: str = Form(...), new_col
134
  random.shuffle(new_colors)
135
  print('StrictTransfer random', colors, new_colors)
136
  recolorStrictTransfer.recolor(image_np, colors, new_colors)
 
 
 
 
137
 
138
  elif method == "ColorMask":
139
  print('ColorMask started')
@@ -148,6 +152,7 @@ async def recolor(file: UploadFile = File(...), colors: str = Form(...), new_col
148
  result_np = np.array(result_image)
149
  print('result_np', result_np.size)
150
  print('image_np', image_np.size)
 
151
  if mask_image.size != result_image.size:
152
  mask_image = mask_image.resize(result_image.size)
153
 
 
134
  random.shuffle(new_colors)
135
  print('StrictTransfer random', colors, new_colors)
136
  recolorStrictTransfer.recolor(image_np, colors, new_colors)
137
+
138
+ elif method == "ColorReplacer":
139
+ print('ColorReplacer started')
140
+ ColorReplacer.recolor_selected_area(image_np, colors[0], colors[1])
141
 
142
  elif method == "ColorMask":
143
  print('ColorMask started')
 
152
  result_np = np.array(result_image)
153
  print('result_np', result_np.size)
154
  print('image_np', image_np.size)
155
+ print('mask_image', mask_image.size)
156
  if mask_image.size != result_image.size:
157
  mask_image = mask_image.resize(result_image.size)
158