mirror of
https://github.com/Bing-su/adetailer.git
synced 2026-01-26 11:19:53 +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:
13
aaaaaa/ui.py
13
aaaaaa/ui.py
@@ -294,14 +294,21 @@ def detection(w: Widgets, n: int, is_img2img: bool):
|
||||
visible=True,
|
||||
elem_id=eid("ad_confidence"),
|
||||
)
|
||||
w.ad_mask_k_largest = gr.Slider(
|
||||
label="Mask only the top k largest (0 to disable)" + suffix(n),
|
||||
w.ad_mask_filter_method = gr.Radio(
|
||||
choices=["Area", "Confidence"],
|
||||
value="Area",
|
||||
label="Method to filter top k masks by (confidence or area)",
|
||||
visible=True,
|
||||
elem_id=eid("ad_mask_filter_method"),
|
||||
)
|
||||
w.ad_mask_k = gr.Slider(
|
||||
label="Mask only the top k (0 to disable)" + suffix(n),
|
||||
minimum=0,
|
||||
maximum=10,
|
||||
step=1,
|
||||
value=0,
|
||||
visible=True,
|
||||
elem_id=eid("ad_mask_k_largest"),
|
||||
elem_id=eid("ad_mask_k"),
|
||||
)
|
||||
|
||||
with gr.Column(variant="compact"):
|
||||
|
||||
Reference in New Issue
Block a user