Skip to content

Commit

Permalink
add image inference text color.
Browse files Browse the repository at this point in the history
  • Loading branch information
anarkiwi committed Jan 14, 2024
1 parent c3b04b3 commit b6344e4
Show file tree
Hide file tree
Showing 6 changed files with 185 additions and 152 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libvulkan-dev \
python3-numpy
WORKDIR /root
RUN git clone https://github.com/iqtlabs/gr-iqtlabs -b 1.0.67
RUN git clone https://github.com/iqtlabs/gr-iqtlabs -b 1.0.68
COPY --from=iqtlabs/gamutrf-vkfft:latest /root /root/gr-iqtlabs
WORKDIR /root/gr-iqtlabs/build
COPY --from=sigmf-builder /usr/local /usr/local
Expand Down
10 changes: 6 additions & 4 deletions gamutrf/grscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ def __init__(
gps_server="",
igain=0,
inference_addr="0.0.0.0", # nosec
inference_port=8002,
inference_min_confidence=0.5,
inference_min_db=-200,
inference_model_server="",
inference_model_name="",
inference_model_server="",
inference_output_dir="",
inference_port=8002,
inference_text_color="",
iqtlabs=None,
logaddr="0.0.0.0", # nosec
logport=8001,
Expand All @@ -66,16 +67,16 @@ def __init__(
sigmf=True,
skip_tune_step=0,
sweep_sec=30,
tune_step_fft=0,
tag_now=False,
tune_dwell_ms=0,
tune_step_fft=0,
tuneoverlap=0.5,
tuning_ranges="",
use_external_gps=False,
use_external_heading=False,
vkfft=False,
wavelearner=None,
write_samples=0,
tag_now=False,
):
gr.top_block.__init__(self, "scan", catch_exceptions=True)

Expand Down Expand Up @@ -242,6 +243,7 @@ def __init__(
n_image=n_image,
n_inference=n_inference,
samp_rate=int(samp_rate),
text_color=inference_text_color,
)
]
)
Expand Down
14 changes: 14 additions & 0 deletions gamutrf/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import signal
import time
import sys
import webcolors
from argparse import ArgumentParser, BooleanOptionalAction

try:
Expand Down Expand Up @@ -148,6 +149,13 @@ def argument_parser():
default=8002,
help="Log inference results to this port",
)
parser.add_argument(
"--inference_text_color",
dest="inference_text_color",
type=str,
default="white",
help="CSS3 color name for inference text (https://www.w3.org/wiki/CSS/Properties/color/keywords)",
)
parser.add_argument(
"--promport",
dest="promport",
Expand Down Expand Up @@ -425,6 +433,12 @@ def check_options(options):
if options.scaling not in ["spectrum", "density"]:
return "scaling must be 'spectrum' or 'density'"

if options.inference_text_color:
wc = webcolors.name_to_rgb(options.inference_text_color, "css3")
options.inference_text_color = ",".join(
[str(c) for c in [wc.blue, wc.green, wc.red]]
)

return ""


Expand Down
1 change: 1 addition & 0 deletions orchestrator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ services:
- --inference_port=10001
- --inference_min_confidence=0.25
- --inference_min_db=-1e9
- --inference_text_color=black
# can be multiple, separate with comma
- --inference_model_name=mini2_snr
- --n_inference=5
Expand Down
Loading

0 comments on commit b6344e4

Please sign in to comment.