-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
31 lines (23 loc) · 825 Bytes
/
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
import logging
import argparse
from magic_finger import MagicFinger
parser = argparse.ArgumentParser(description='magic finger demo')
parser.add_argument('-v', '--verbosity', choices=['DEBUG', 'INFO', 'CRITICAL'], help='control output verbosity')
parser.add_argument('-f', '--file', help='input image path')
args = parser.parse_args()
if args.verbosity == 'DEBUG':
level = logging.DEBUG
elif args.verbosity == 'INFO':
level = logging.INFO
else:
level = logging.CRITICAL
LOG_FORMAT = "%(asctime)s - %(levelname)s - %(message)s"
logging.basicConfig(level=level, format=LOG_FORMAT)
img_path = './3.jpg'
if (args.file):
img_path = args.file
mf = MagicFinger(precision=3, max_len_cn=1, scale=1.5)
mf.set_image(img_path)
mf.draw(mode=mf.DRAWLINE | mf.INTERACTIVE)
# result = mf.translate()
# print(result)