Skip to content

Commit

Permalink
Fix: 변경 인페인팅 방식
Browse files Browse the repository at this point in the history
  • Loading branch information
semnisem committed Nov 19, 2024
1 parent 099529d commit 91d37ce
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/AIProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ def segment_from_boxes(self, image, bbox, save_path=None):
return masks_np

def inpainting(self, image, mask_total):
inpainted_image = cv2.inpaint(image.copy(), mask_total, 10, cv2.INPAINT_TELEA)
# inpainted_image = cv2.inpaint(image.copy(), mask_total, 10, cv2.INPAINT_TELEA)
print(mask_total.shape) # (1893, 1577) with 0 or 255
# print(image.shape) # (1893, 1577, 3)

inpainted_image = image.copy()
inpainted_image[mask_total == 255] = [255, 255, 255]
final_image = cv2.convertScaleAbs(inpainted_image, alpha=1.5, beta=10)
# cv2.imwrite('test_images/inpainted_init.png', inpainted_image)
# cv2.imwrite('test_images/inpainted_final.png', final_image)
Expand Down

0 comments on commit 91d37ce

Please sign in to comment.