-
Notifications
You must be signed in to change notification settings - Fork 0
/
__main__.py
48 lines (42 loc) · 1.12 KB
/
__main__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import os
import argparse
from configparser import ConfigParser
from src import app
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
'-d',
"--debug",
help="Log debug output",
action='store_const',
const=True
)
parser.add_argument(
"--render",
help="render comparison image of most similar duplicate image",
action='store_const',
const=True
)
parser.add_argument(
"--restore",
help="Move images in duplicates dir back to images dir",
action='store_const',
const=True
)
parser.add_argument(
"--remove",
help="Remove detected duplicate images",
action='store_const',
const=True
)
args = parser.parse_args()
config = ConfigParser()
config.read(os.path.join(os.path.dirname(__file__), 'config.ini'))
options = {
'debug': args.debug,
'render_comparison_images': args.render,
'restore_duplicates': args.restore,
'remove_duplicates': args.remove,
'config': config,
}
app(**options)