Skip to content

Commit

Permalink
Merge pull request #957 from anarkiwi/notes
Browse files Browse the repository at this point in the history
very basic augment integration test.
  • Loading branch information
anarkiwi authored Nov 7, 2023
2 parents 9a142c7 + 449c39d commit 5d1b751
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions augment/augment.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ def write_signal(filename, signal, transforms_text):

def augment(signal, filename, output_dir, n, transforms_text):
# TODO: sadly, due to Torchsig complexity, literal_eval can't be used.
transforms = eval(transforms_text) # nosec
transforms = eval(transforms_text) # nosec
i = 0
base_augment_name = os.path.basename(filename)
dot = base_augment_name.find(".")
if dot != "-1":
if dot != -1:
base_augment_name = base_augment_name[:dot]
for _ in range(n):
while True:
Expand All @@ -114,7 +114,9 @@ def augment(signal, filename, output_dir, n, transforms_text):


def argument_parser():
parser = ArgumentParser()
parser = ArgumentParser(
description="Run transforms on a recording from https://github.com/TorchDSP/torchsig/blob/main/torchsig/transforms/transforms.py"
)
parser.add_argument(
"filename",
type=str,
Expand Down
2 changes: 2 additions & 0 deletions docker/Dockerfile.torchsig
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ COPY --from=torchsig-builder /usr/local/lib/python3.10/dist-packages /usr/local/
RUN python3 -c "from torchsig.transforms import transforms"
RUN python3 -c "from gamutrf import grscan"
COPY augment/augment.py /root/augment.py
RUN dd if=/dev/zero of=/tmp/gamutrf_recording_ettus__gain40_1_1Hz_1000sps.raw bs=8 count=1000 && /root/augment.py /tmp/gamutrf_recording_ettus__gain40_1_1Hz_1000sps.raw /tmp 1 "ST.Compose([ST.Identity()])" && diff -b /tmp/gamutrf_recording_ettus__gain40_1_1Hz_1000sps.raw /tmp/augmented-0-gamutrf_recording_ettus__gain40_1_1Hz_1000sps && rm -f /tmp/gamutrf*

ENTRYPOINT ["/root/augment.py"]

0 comments on commit 5d1b751

Please sign in to comment.