mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
feat: only process sam_options.dino_erode_or_dilate when set
This commit is contained in:
@@ -83,6 +83,7 @@ def generate_mask_from_image(image: np.ndarray, mask_model: str = 'sam', extras=
|
|||||||
if boxes.size(0) > 0:
|
if boxes.size(0) > 0:
|
||||||
sam_predictor.set_image(image)
|
sam_predictor.set_image(image)
|
||||||
|
|
||||||
|
if sam_options.dino_erode_or_dilate != 0:
|
||||||
for index in range(boxes.size(0)):
|
for index in range(boxes.size(0)):
|
||||||
assert boxes.size(1) == 4
|
assert boxes.size(1) == 4
|
||||||
boxes[index][0] -= sam_options.dino_erode_or_dilate
|
boxes[index][0] -= sam_options.dino_erode_or_dilate
|
||||||
|
|||||||
Reference in New Issue
Block a user