Skip to content

Commit

Permalink
set up prop.
Browse files Browse the repository at this point in the history
  • Loading branch information
anarkiwi committed Oct 5, 2024
1 parent c0807c8 commit e9b427d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion utils/count_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

sigmf_file = sys.argv[1]
label_class = sys.argv[2]
prop_thresh = sys.argv[3]

labels = 0
correct_labels = 0
Expand All @@ -22,6 +23,6 @@

prop = round(correct_labels / labels * 100, 2)
print(correct_labels, labels, prop)
if prop < 99:
if prop < prop_thresh:
print("predicted class is less than threshold")
sys.exit(-1)
4 changes: 2 additions & 2 deletions utils/gamutrf_offline_siggen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PYTHON="${PYTHON:=python3}"
TORCHSERVE="${TORCHSERVE:=torchserve.yml}"
OFFLINE="${OFFLINE:=offline.yml}"
DATA="${DATA:=/data}"

PROP="${PROP:=95}"

docker compose -f $DATA/gamutrf-deploy/$OFFLINE down --remove-orphans
docker compose -f $DATA/gamutrf-deploy/$TORCHSERVE down --remove-orphans
Expand All @@ -16,7 +16,7 @@ for i in am fm ; do
sudo rm -rf $DATA/samples
VOL_PREFIX=$DATA RECORDING=/logs/siggen/test/$i.sigmf-meta docker compose -f $DATA/gamutrf-deploy/$OFFLINE up gamutrf
echo $i
$PYTHON ./utils/count_labels.py $DATA/samples/*/*sigmf-meta $i
$PYTHON ./utils/count_labels.py $DATA/samples/*/*sigmf-meta $i $PROP
done

VOL_PREFIX=$DATA docker compose -f $DATA/gamutrf-deploy/$TORCHSERVE down

0 comments on commit e9b427d

Please sign in to comment.