-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdota_viewer.py
55 lines (48 loc) · 1.32 KB
/
dota_viewer.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
49
50
51
52
53
54
55
import argparse
import sys
from PyQt5.QtWidgets import QApplication
from dota_viewer.window_interface import WindowInterface
def main(images_path, annotations_path, save_images_path, save_masks_path):
app = QApplication(sys.argv)
viewer = WindowInterface(
images_path, annotations_path, save_images_path, save_masks_path
)
viewer.show()
sys.exit(app.exec_())
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--images-path",
default="./images/",
type=str,
metavar="PATH",
help="Path to images folder",
)
parser.add_argument(
"--annotations-path",
default="./annotations/",
type=str,
metavar="PATH",
help="Path to annotations json file",
)
parser.add_argument(
"--save-images-path",
default="",
type=str,
metavar="PATH",
help="Path to the folder for saving photos with annotations",
)
parser.add_argument(
"--save-masks-path",
default="",
type=str,
metavar="PATH",
help="Path to the folder for saving binary masks",
)
args = parser.parse_args()
main(
args.images_path,
args.annotations_path,
args.save_images_path,
args.save_masks_path,
)