From 9adf53cc482ec6c163e9cbb0ba32a102426cae12 Mon Sep 17 00:00:00 2001 From: Josh Bailey Date: Sat, 13 Jul 2024 06:36:16 +0000 Subject: [PATCH] allow batch inference config. --- docker/Dockerfile.base | 2 +- gamutrf/grscan.py | 3 ++- gamutrf/scan.py | 7 +++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index ade7242e..921276d6 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -15,7 +15,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ pybind11-dev \ python3-numpy WORKDIR /root -RUN git clone https://github.com/iqtlabs/gr-iqtlabs -b 1.0.112 +RUN git clone https://github.com/iqtlabs/gr-iqtlabs -b 1.0.113 COPY --from=iqtlabs/gamutrf-vkfft:latest /root /root/gr-iqtlabs WORKDIR /root/gr-iqtlabs/build COPY --from=iqtlabs/gamutrf-sigmf:latest /usr/local /usr/local diff --git a/gamutrf/grscan.py b/gamutrf/grscan.py index 3794f3d7..7428a114 100644 --- a/gamutrf/grscan.py +++ b/gamutrf/grscan.py @@ -52,6 +52,7 @@ def __init__( gps_server="", igain=0, inference_addr="0.0.0.0", # nosec + inference_batch=1, inference_min_confidence=0.5, inference_min_db=-200, inference_model_name="", @@ -330,7 +331,7 @@ def __init__( samp_rate=int(samp_rate), power_inference=iq_power_inference, background=iq_inference_background, - batch=0, # TODO: not used yet. + batch=inference_batch, ) self.inference_blocks.append(self.iq_inference_block) if self.write_samples_block: diff --git a/gamutrf/scan.py b/gamutrf/scan.py index 921984ac..1370fde6 100644 --- a/gamutrf/scan.py +++ b/gamutrf/scan.py @@ -148,6 +148,13 @@ def argument_parser(): default=10000, help="Log FFT results to this port", ) + parser.add_argument( + "--inference_batch", + dest="inference_batch", + type=int, + default=5, + help="How many inference requests to make at once", + ) parser.add_argument( "--inference_addr", dest="inference_addr",