Skip to content

Commit 883bcfe

Browse files
marc0oloclaude
andcommitted
fix(rust/face-recognition): remove unused colorgrad dep, add icp.yaml comments
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2ee3c0a commit 883bcfe

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

rust/face-recognition/backend/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ crate-type = ["cdylib"]
1111
anyhow = "1.0"
1212
bytes = "1.5.0"
1313
candid = "0.10"
14-
colorgrad = "0.6"
1514
ic-cdk = "0.20"
1615
ic-stable-structures = "0.7"
1716
ic-wasi-polyfill = "0.13"

rust/face-recognition/icp.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,25 @@ canisters:
44
steps:
55
- type: script
66
commands:
7+
# wasi2ic and wasm-opt are installed on first run if not present.
78
- which wasi2ic || cargo install wasi2ic
89
- which wasm-opt || cargo install wasm-opt
10+
# Enable Wasm SIMD instructions for faster Tract inference.
911
- export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+simd128"
12+
# Compile to wasm32-wasip1 (WASI) so Tract can use POSIX file I/O.
1013
- cargo build --package backend --target wasm32-wasip1 --release
14+
# wasi2ic rewrites WASI syscalls to IC system API calls.
1115
- wasi2ic ./target/wasm32-wasip1/release/backend.wasm "$ICP_WASM_OUTPUT_PATH"
16+
# Optimise the WASM binary size and enable SIMD + bulk-memory proposals.
1217
- wasm-opt -Os --enable-simd --enable-bulk-memory -o "$ICP_WASM_OUTPUT_PATH" "$ICP_WASM_OUTPUT_PATH"
18+
# Embed the Candid interface as public WASM metadata.
1319
- ic-wasm "$ICP_WASM_OUTPUT_PATH" -o "$ICP_WASM_OUTPUT_PATH" metadata candid:service -f backend/backend.did -v public --keep-name-section
1420
sync:
1521
steps:
1622
- type: script
1723
commands:
24+
# Downloads/generates ONNX models and uploads them to the canister.
25+
# Skipped automatically if models are already loaded (e.g. on redeployment).
1826
- bash upload-models-to-canister.sh
1927

2028
- name: frontend

0 commit comments

Comments
 (0)