Skip to content

Commit

Permalink
handle asset folder and switch to tract release
Browse files Browse the repository at this point in the history
  • Loading branch information
adambratschikaye committed Apr 29, 2024
1 parent a9d3419 commit b1f6fcc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion benchmarks/tract-onnx-image-classification/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ RUN rustup target add wasm32-wasi
WORKDIR /usr/src
ADD rust-benchmark rust-benchmark
ADD assets assets
ADD setup.sh setup.sh
RUN ./setup.sh
WORKDIR /usr/src/rust-benchmark
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
RUN cargo build --release --target wasm32-wasi
RUN ls target/wasm32-wasi/release
RUN mkdir /benchmark
RUN cp target/wasm32-wasi/release/benchmark.wasm /benchmark/
# We output the Wasm file to the `/benchmark` directory, where the client
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ anyhow = "1.0"
bytes = "1.5.0"
prost = "0.11.0"
image = { version = "0.25.1", features = ["png"], default-features = false }
tract-onnx = { git = "https://github.com/sonos/tract", version = "=0.21.4-pre" }
tract-onnx = "0.21.4"
2 changes: 2 additions & 0 deletions benchmarks/tract-onnx-image-classification/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -euxo pipefail
MODEL_URL="https://www.github.com/onnx/models/raw/main/validated/vision/classification/mobilenet/model/mobilenetv2-7.onnx?download=:"
MODEL_FILE="assets/mobilenetv2-7.onnx"

mkdir -p assets

if [ ! -f $MODEL_FILE ]; then
echo "Downloading model to $MODEL_FILE"

Expand Down

0 comments on commit b1f6fcc

Please sign in to comment.