fountai commited on
Commit
180c6d2
1 Parent(s): 88004fc

fix colors

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -71,7 +71,7 @@ def random_positioning(input, output_size=(1024, 1024)):
71
 
72
  resized_image = cv2.resize(input, new_size, interpolation=cv2.INTER_AREA)
73
 
74
- background = np.zeros((output_size[1], output_size[0], 3), dtype=np.uint8)
75
 
76
  x_offset = random.randint(0, output_size[0] - new_size[0])
77
  y_offset = random.randint(0, output_size[1] - new_size[1])
@@ -126,6 +126,9 @@ def execute(image, prompt):
126
  cv2.imwrite("mask.jpg", maskHead('base_image.jpg'))
127
 
128
  im = Image.open('base_image.jpg')
 
 
 
129
  mask = Image.open('mask.jpg')
130
 
131
  result = pipe(
 
71
 
72
  resized_image = cv2.resize(input, new_size, interpolation=cv2.INTER_AREA)
73
 
74
+ background = np.ones((output_size[1], output_size[0], 3), dtype=np.uint8) * 255
75
 
76
  x_offset = random.randint(0, output_size[0] - new_size[0])
77
  y_offset = random.randint(0, output_size[1] - new_size[1])
 
126
  cv2.imwrite("mask.jpg", maskHead('base_image.jpg'))
127
 
128
  im = Image.open('base_image.jpg')
129
+ np_arr = np.array(im)
130
+ rgb_image = cv2.cvtColor(np_image, cv2.COLOR_BGR2RGB)
131
+ im = Image.fromarray(rgb_image)
132
  mask = Image.open('mask.jpg')
133
 
134
  result = pipe(