-
Notifications
You must be signed in to change notification settings - Fork 4
/
iqtlabs_iq_inference.block.yml
105 lines (95 loc) · 2.94 KB
/
iqtlabs_iq_inference.block.yml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
id: iqtlabs_iq_inference
label: iq_inference
category: '[iqtlabs]'
flags: [python, cpp]
documentation: |-
This block accepts a stream of complex I/Q samples and dB values,
correlates them in time, and runs inference on the samples via Torchserve.
Torchserve inference is done in a background thread, to avoid
blocking the flowgraph. Torchserve batching is currently not done,
to trade inference latency for efficiency (generally, the inference
response time is much less than scanner dwell time).
input:
vector of complex, representing original I/Q samples,
tagged with center frequency.
vector of floats, representing FFT dB power values,
tagged with center frequency.
output:
JSON inference results.
parameters:
tag: received frequency tag name.
vlen: length of complex/FFT dB vector.
n_vlen: number of vectors aggregate.
sample_buffer: size of sample lookback buffer.
min_peak_points: Only run inference with this minimum average dB power.
model_names: if not empty, comma separated list of model names.
model_server: if not empty, inference to this address ("hostname:port")
confidence: Only output inference results where confidence is greater.
n_inference: if > 0, only run inference on 1/n_inference images.
samp_rate: sample rate.
power_inference: if True, infer on power as well as samples.
background: if True, do inference in the background.
batch: if > 1, batch inference requests.
templates:
imports: from gnuradio import iqtlabs
make: >
iqtlabs.iq_inference(
${tag}, ${vlen}, ${n_vlen}, ${sample_buffer}, ${min_peak_points},
${model_server}, ${model_names}, ${confidence}, ${n_inference},
${samp_rate}, ${power_inference}, ${background}, ${batch})
cpp_templates:
includes: ['#include <gnuradio/iqtlabs/iq_inference.h>']
declarations: 'gr::iqtlabs::iq_inference::sptr ${id};'
make: >
this->${id} = gr::iqtlabs::iq_inference::make(
${tag}, ${vlen}, ${n_vlen}, ${sample_buffer, ${min_peak_points},
${model_server}, ${model_names}, ${confidence}, ${n_inference},
${samp_rate}, ${power_inference}, ${background}, ${batch});
link: ['libgnuradio-iqtlabs.so']
parameters:
- id: tag
dtype: string
default: 'rx_freq'
- id: vlen
dtype: int
- id: n_vlen
dtype: int
- id: sample_buffer
dtype: int
- id: min_peak_points
dtype: float
- id: model_server
dtype: str
- id: model_names
dtype: str
- id: confidence
dtype: float
- id: n_inference
dtype: int
- id: samp_rate
dtype: int
- id: power_inference
dtype: bool
- id: background
dtype: bool
- id: batch
dtype: int
asserts:
- ${ tag != "" }
- ${ vlen > 0 }
- ${ sample_buffer > 0 }
- ${ batch > 0 }
inputs:
- label: samples
domain: stream
dtype: complex
vlen: ${ vlen }
- label: FFT power
domain: stream
dtype: float
vlen: ${ vlen }
outputs:
- id: inference
domain: message
file_format: 1