-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlabel_env.py
45 lines (38 loc) · 1.5 KB
/
label_env.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
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 = {
# "mini2_video": [
# "data/gamutrf/gamutrf-arl/01_30_23/mini2_iq_label/*.sigmf-meta",
# ],
"mini2_video": [
"/home/iqt/lberndt/gamutrf-depoly/data/samples/environment/samples_1722872733.648000_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)
data_obj = data_class.Data(f)
annotation_utils.reset_annotations(data_obj)
annotation_utils.annotate(
f,
label="environment",
avg_window_len=256,
avg_duration=0.10,
debug=False,
spectral_energy_threshold=0.90,
# force_threshold_db=-48,
overwrite=True,
min_bandwidth=None,
max_bandwidth=None,
min_annotation_length=1000,
# max_annotations=500,
dc_block=True,
)