-
Notifications
You must be signed in to change notification settings - Fork 0
/
checks.py
41 lines (28 loc) · 911 Bytes
/
checks.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
"""simple sanity checks"""
from argparse import ArgumentParser
from pathlib import Path
def check_sampler():
from detect_to_track.data.imagenet import VIDTrnSampler, DETSampler
root = Path("~/datasets/ILSVRC2015").expanduser()
s = VIDTrnSampler(root)
# s = DETSampler(root)
i0, i1 = s.sample()
i0.im.show()
print(i0.labels)
print()
print(i1.labels)
def check_anchors():
from detect_to_track.utils import build_anchors
anchors = build_anchors(
fm_shape=(2, 2), anchor_areas=[1, 2, 3], aspect_ratios=[1, 2], flatten=False
)
print(anchors)
if __name__ == "__main__":
parser = ArgumentParser(__doc__)
parser.add_argument("--sampler", action="store_true")
parser.add_argument("--anchors", action="store_true")
args = parser.parse_args()
if args.sampler:
check_sampler()
if args.anchors:
check_anchors()