MCPcopy
hub / github.com/nadermx/backgroundremover / main

Function main

backgroundremover/cmd/cli.py:8–464  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6
7
8def main():
9 model_choices = ["u2net", "u2net_human_seg", "u2netp"]
10
11 ap = argparse.ArgumentParser()
12
13 ap.add_argument(
14 "-m",
15 "--model",
16 default="u2net",
17 type=str,
18 choices=model_choices,
19 help="The model name, u2net, u2netp, u2net_human_seg",
20 )
21
22 ap.add_argument(
23 "-a",
24 "--alpha-matting",
25 nargs="?",
26 const=True,
27 default=False,
28 type=lambda x: bool(strtobool(x)),
29 help="When true use alpha matting cutout.",
30 )
31
32 ap.add_argument(
33 "-af",
34 "--alpha-matting-foreground-threshold",
35 default=240,
36 type=int,
37 help="The trimap foreground threshold.",
38 )
39
40 ap.add_argument(
41 "-ab",
42 "--alpha-matting-background-threshold",
43 default=10,
44 type=int,
45 help="The trimap background threshold.",
46 )
47
48 ap.add_argument(
49 "-ae",
50 "--alpha-matting-erode-size",
51 default=10,
52 type=int,
53 help="Size of element used for the erosion.",
54 )
55
56 ap.add_argument(
57 "-az",
58 "--alpha-matting-base-size",
59 default=1000,
60 type=int,
61 help="The image base size.",
62 )
63
64 ap.add_argument(
65 "-om",

Callers 1

cli.pyFile · 0.70

Calls 4

max_workersFunction · 0.90
removeFunction · 0.90
is_video_fileFunction · 0.85
is_image_fileFunction · 0.85

Tested by

no test coverage detected