forked from yijingru/BBAVectors-Oriented-Object-Detection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmerge_trainWithEval
32 lines (28 loc) · 947 Bytes
/
merge_trainWithEval
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
import click
from dotadevkit.ops import mergebypoly, mergebyrec
# @click.command()
# @click.argument("src", type=click.Path(exists=True))
# @click.argument("dst", type=click.Path(exists=True))
# @click.argument("num_process", default=1, type=int)
# @click.argument("nms_thresh", default=0.3, required=False, type=float)
# @click.option("--task1/--task2", default=True)
def merge(src, dst, num_process=1, nms_thresh=.3, task1=True):
"""
\b
Merges annotations according to DOTA Tasks.
Task 1 = Oriented Bounding Box
Task 2 = Horizontal Bounding Box
\b
Args:
src (str): Source directory
dst (str): Destination directory
num_process (int): Num of threads
nms_thresh (float): NMS threshold
task1 (bool): Task1 (Oriented BBox)
Returns:
None
"""
if task1:
mergebypoly(src, dst, num_process, nms_thresh)
else:
mergebyrec(src, dst, nms_thresh)