add crop infor for lama
This commit is contained in:
BIN
lama_cleaner/tests/mask.jpg
Normal file
BIN
lama_cleaner/tests/mask.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
15
lama_cleaner/tests/test_boxes_from_mask.py
Normal file
15
lama_cleaner/tests/test_boxes_from_mask.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import cv2
|
||||
import numpy as np
|
||||
|
||||
from lama_cleaner.helper import boxes_from_mask
|
||||
|
||||
|
||||
def test_boxes_from_mask():
|
||||
mask = cv2.imread("mask.jpg", cv2.IMREAD_GRAYSCALE)
|
||||
mask = mask[:, :, np.newaxis]
|
||||
mask = (mask / 255).transpose(2, 0, 1)
|
||||
boxes = boxes_from_mask(mask)
|
||||
print(boxes)
|
||||
|
||||
|
||||
test_boxes_from_mask()
|
||||
Reference in New Issue
Block a user