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

fix: limit 3 channels in StrictTransfer

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. recolorStrictTransfer.py +3 -2
README.md CHANGED
@@ -9,4 +9,4 @@ pinned: false
9
 
10
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
11
 
12
- Run with Bind Mount to autoreload when developing: docker run -v "$(pwd)":/home/user/app -p 7860:7860 farm-recolor
 
9
 
10
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
11
 
12
+ Run with Bind Mount to autoreload when developing: docker build . && docker run -v "$(pwd)":/home/user/app -p 7860:7860 farm-recolor
recolorStrictTransfer.py CHANGED
@@ -50,6 +50,7 @@ def color_transfer(image, old_colors_hex, new_colors_hex):
50
 
51
  # return recolored_image_path
52
 
53
- def recolor(source, old_colors, new_colors):
54
- recolored = color_transfer(source, old_colors, new_colors)
 
55
  return recolored
 
50
 
51
  # return recolored_image_path
52
 
53
+ def recolor(image_np, old_colors, new_colors):
54
+ image_np = image_np[:, :, :3]
55
+ recolored = color_transfer(image_np, old_colors, new_colors)
56
  return recolored