Skip to content

Commit d514901

Browse files
authored
Add sound recognizer test api (#1770)
1 parent e2bcdd1 commit d514901

File tree

6 files changed

+579
-0
lines changed

6 files changed

+579
-0
lines changed

build/lint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ output=$(cd "$ROOT" && find . -type f \
128128
! -path "./.git/*" \
129129
! -name ".*" \
130130
! -name "*.bin" \
131+
! -name "*.wav" \
131132
-exec egrep -l " +$" {} \;)
132133
if [[ $output ]]; then
133134
echo "File(s) have lines with trailing whitespace:"
@@ -147,6 +148,7 @@ output=$(cd "$ROOT" && find . -type f \
147148
! -path "./.git/*" \
148149
! -name ".*" \
149150
! -name "*.bin" \
151+
! -name "*.wav" \
150152
-print0 | \
151153
xargs -0 -L1 bash -c 'test "$(tail -c 1 "$0")" && echo "No new line at end of $0"' || true)
152154
if [[ $output ]]; then
@@ -166,6 +168,7 @@ output=$(cd "$ROOT" && find . -type f \
166168
! -path "./.git/*" \
167169
! -name ".*" \
168170
! -name "*.bin" \
171+
! -name "*.wav" \
169172
-print0 | \
170173
xargs -0 -L1 bash -c 'test "$(tail -c 2 "$0")" || [ ! -s "$0" ] || echo "Multiple new lines at end of $0"' || true)
171174
if [[ $output ]]; then
@@ -185,6 +188,7 @@ output=$(cd "$ROOT" && find . -type f \
185188
! -path "./.git/*" \
186189
! -name ".*" \
187190
! -name "*.bin" \
191+
! -name "*.wav" \
188192
-print0 | \
189193
xargs -0 -L1 bash -c 'test "$(head -c 1 "$0")" || [ ! -s "$0" ] || echo "New line at beginning of $0"' || true)
190194
if [[ $output ]]; then
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Sound Classifier
2+
3+
Based on https://tfhub.dev/google/yamnet/1.
4+
5+
Export the endpoint:
6+
7+
```bash
8+
export ENDPOINT=<API endpoint> # you can find this with `cortex get sound-classifier`
9+
```
10+
11+
And then run the inference:
12+
13+
```bash
14+
curl $ENDPOINT -X POST -H "Content-type: application/octet-stream" --data-binary "@silence.wav"
15+
```

0 commit comments

Comments
 (0)