Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added "CNN Face Detection" app #383

Merged
merged 3 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
# job control
jobs:
format:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Apt Update
run: sudo apt-get update
Expand All @@ -24,7 +24,7 @@ jobs:
- name: Clang Format
run: ./format.sh -d
test:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Apt Update
run: sudo apt-get update
Expand Down
4 changes: 4 additions & 0 deletions applications/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ all: \
gps_ekf.install \
license_plate_detection.install \
resize_image.install \
cnn_face_detection.install \
scratch_storage_get.install \
scratch_storage_set.install \
scratch_storage_delete.install \
Expand Down Expand Up @@ -105,6 +106,9 @@ gps_ekf.install: ../runtime/bin/gps_ekf.wasm.so
.PHONY: license_plate_detection.install
license_plate_detection.install: ../runtime/bin/license_plate_detection.wasm.so

.PHONY: cnn_face_detection.install
cnn_face_detection.install: ../runtime/bin/cnn_face_detection.wasm.so

.PHONY: trap_divzero.install
trap_divzero.install: ../runtime/bin/trap_divzero.wasm.so

Expand Down
2 changes: 1 addition & 1 deletion awsm
20 changes: 10 additions & 10 deletions tests/CMSIS_5_NN/imageclassification/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ debug:

.PHONY: client
client:
@curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/airplane1.bmp" "localhost:10000/rand"
@curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/automobile1.bmp" "localhost:10000/rand"
@curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/bird1.bmp" "localhost:10000/rand"
@curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/cat1.bmp" "localhost:10000/rand"
@curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/deer1.bmp" "localhost:10000/rand"
@curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/dog1.bmp" "localhost:10000/rand"
@curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/frog1.bmp" "localhost:10000/rand"
@curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/horse1.bmp" "localhost:10000/rand"
@curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/ship1.bmp" "localhost:10000/rand"
@curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/truck1.bmp" "localhost:10000/rand"
@curl -H 'Expect:' -H "Content-Type: image/bmp" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/airplane1.bmp" "localhost:10000/rand"
@curl -H 'Expect:' -H "Content-Type: image/bmp" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/automobile1.bmp" "localhost:10000/rand"
@curl -H 'Expect:' -H "Content-Type: image/bmp" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/bird1.bmp" "localhost:10000/rand"
@curl -H 'Expect:' -H "Content-Type: image/bmp" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/cat1.bmp" "localhost:10000/rand"
@curl -H 'Expect:' -H "Content-Type: image/bmp" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/deer1.bmp" "localhost:10000/rand"
@curl -H 'Expect:' -H "Content-Type: image/bmp" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/dog1.bmp" "localhost:10000/rand"
@curl -H 'Expect:' -H "Content-Type: image/bmp" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/frog1.bmp" "localhost:10000/rand"
@curl -H 'Expect:' -H "Content-Type: image/bmp" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/horse1.bmp" "localhost:10000/rand"
@curl -H 'Expect:' -H "Content-Type: image/bmp" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/ship1.bmp" "localhost:10000/rand"
@curl -H 'Expect:' -H "Content-Type: image/bmp" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/truck1.bmp" "localhost:10000/rand"
9 changes: 3 additions & 6 deletions tests/multi-tenancy-sample/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"relative-deadline-us": 10000,
"http-resp-content-type": "text/plain"
}
],
"extra-exec-percentile": 0
]
},
{
"name": "long-000",
Expand All @@ -48,8 +47,7 @@
"relative-deadline-us": 18000,
"http-resp-content-type": "text/plain"
}
],
"extra-exec-percentile": 0
]
},
{
"name": "short-000",
Expand All @@ -66,7 +64,6 @@
"relative-deadline-us": 18000,
"http-resp-content-type": "text/plain"
}
],
"extra-exec-percentile": 0
]
}
]
Empty file.
26 changes: 26 additions & 0 deletions tests/sod/cnn_face_detection/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
RUNTIME_DIR=../../../runtime/
SLEDGE_BINARY_DIR=${RUNTIME_DIR}/bin
HOSTNAME=localhost

.PHONY: all
all: run

.PHONY: clean
clean:
rm -rf res/*

.PHONY: run
run:
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} ${SLEDGE_BINARY_DIR}/sledgert spec.json

.PHONY: debug
debug:
SLEDGE_DISABLE_PREEMPTION=true SLEDGE_NWORKERS=1 LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert \
--eval-command="handle SIGUSR1 noprint nostop" \
--eval-command="handle SIGPIPE noprint nostop" \
--eval-command="set pagination off" \
--eval-command="run spec.json"

.PHONY: client
client:
curl -H 'Expect:' -H "Content-Type: image/jpeg" --data-binary "@cnn_faces.jpg" "${HOSTNAME}:10000/face"
5 changes: 5 additions & 0 deletions tests/sod/cnn_face_detection/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# CNN Face Detection

Originally, this workload returned an image where all the human faces were circles, along with the coordinates of the faces. It was modified to return a textual representation of faces, that is just the coordinates of the faces.

The scripts DO NOT check for functional correctness of output for this reason. Please look at other scripts to have a better example for new applications.
Binary file added tests/sod/cnn_face_detection/cnn_faces.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions tests/sod/cnn_face_detection/spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[
{
"name": "gwu",
"port": 10000,
"replenishment-period-us": 0,
"max-budget-us": 0,
"reservation-percentile": 0,
"routes": [
{
"route": "/face",
"path": "cnn_face_detection.wasm.so",
"admissions-percentile": 50,
"expected-execution-us": 320000,
"relative-deadline-us": 500000,
"http-resp-content-type": "text/plain"
}
]
}
]
2 changes: 1 addition & 1 deletion tests/sod/image_resize/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ debug:
--eval-command="run spec.json"

client:
curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@flower.jpg" --output "result.jpg" "${HOSTNAME}:10000/resize"
curl -H 'Expect:' -H "Content-Type: image/jpeg" --data-binary "@flower.jpg" --output "result.jpg" "${HOSTNAME}:10000/resize"