mirror of
https://github.com/Bing-su/adetailer.git
synced 2026-01-26 19:29:54 +00:00
Feature: Filter k most confident masks (#720)
* add filter to things that return confidences need to add ui elements to select between the two methods * add ui elements for controlling method * forgot to remove this * fix incorrect early exit * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: pop mask only top k params * fix: filter confidences * refactor: change to one public function --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Dowon <ks2515@naver.com>
This commit is contained in:
@@ -52,7 +52,7 @@ from adetailer.args import (
|
||||
from adetailer.common import PredictOutput, ensure_pil_image, safe_mkdir
|
||||
from adetailer.mask import (
|
||||
filter_by_ratio,
|
||||
filter_k_largest,
|
||||
filter_k_by,
|
||||
has_intersection,
|
||||
is_all_black,
|
||||
mask_preprocess,
|
||||
@@ -596,7 +596,7 @@ class AfterDetailerScript(scripts.Script):
|
||||
pred = filter_by_ratio(
|
||||
pred, low=args.ad_mask_min_ratio, high=args.ad_mask_max_ratio
|
||||
)
|
||||
pred = filter_k_largest(pred, k=args.ad_mask_k_largest)
|
||||
pred = filter_k_by(pred, k=args.ad_mask_k, by=args.ad_mask_filter_method)
|
||||
pred = self.sort_bboxes(pred)
|
||||
masks = mask_preprocess(
|
||||
pred.masks,
|
||||
|
||||
Reference in New Issue
Block a user