-
Notifications
You must be signed in to change notification settings - Fork 2
/
label_mavic.py
60 lines (52 loc) · 2.24 KB
/
label_mavic.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
56
57
58
59
60
import glob
from pathlib import Path
from tqdm import tqdm
import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], ".."))
import rfml.annotation_utils as annotation_utils
import rfml.data as data_class
data_globs = {
"dji_samples": [
"/home/iqt/lberndt/gamutrf-depoly/data/samples/mavic-30gain/samples_1723144831.684000_2408703998Hz_20480000sps.raw.sigmf-meta",
"/home/iqt/lberndt/gamutrf-depoly/data/samples/mavic-40gain/samples_1723144790.020000_2408703998Hz_20480000sps.raw.sigmf-meta",
"/home/iqt/lberndt/gamutrf-depoly/data/samples/mavic-30db/samples_1722867361.666000_2408703998Hz_20480000sps.raw.sigmf-meta",
"/home/iqt/lberndt/gamutrf-depoly/data/samples/mavic-0db/samples_1722883251.180000_2408703998Hz_20480000sps.raw.sigmf-meta",
]
}
for label in data_globs:
for data_glob in data_globs[label]:
for f in tqdm(glob.glob(str(Path(data_glob)))):
# annotation_utils.annotate(f, label=label, avg_window_len=256, avg_duration=0.25, debug=True, spectral_energy_threshold=0.99, force_threshold_db=-40)
print(f"\nAnnotating {f}\n-----------------------------------\n")
data_obj = data_class.Data(f)
annotation_utils.reset_annotations(data_obj)
# annotation_utils.annotate(
# f,
# label="mavic3_remoteid",
# avg_window_len=256,
# avg_duration=0.10,
# debug=False,
# spectral_energy_threshold=0.90,
# #force_threshold_db=-48,
# overwrite=True,
# min_bandwidth=1e5,
# max_bandwidth=2e6,
# min_annotation_length=500,
# # max_annotations=500,
# dc_block=True
# )
annotation_utils.annotate(
f,
label="mavic3_video",
avg_window_len=256,
avg_duration=0.25,
debug=False,
spectral_energy_threshold=0.99,
force_threshold_db=-58,
overwrite=True,
min_bandwidth=8e6,
min_annotation_length=10000,
# max_annotations=500,
dc_block=True,
)