diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml new file mode 100644 index 0000000..e94a0b8 --- /dev/null +++ b/.github/workflows/deploy-pages.yml @@ -0,0 +1,57 @@ +name: deploy github pages + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: write + +env: + CARGO_TERM_COLOR: always + RUST_BACKTRACE: 1 + + +jobs: + deploy: + runs-on: macos-latest + + steps: + - name: checkout repository + uses: actions/checkout@v3 + + - name: setup nightly rust toolchain with caching + uses: brndnmtthws/rust-action@v1 + with: + toolchain: nightly + components: rustfmt, clippy + enable-sccache: "false" + + - name: install wasm32-unknown-unknown + run: rustup target add wasm32-unknown-unknown + + - name: install wasm-bindgen-cli + run: cargo install wasm-bindgen-cli + + # - name: install wasm-opt + # run: cargo install wasm-opt --locked + + - name: build wasm artifacts + run: cargo build -p bevy_burn_depth --target wasm32-unknown-unknown --release --no-default-features --features "web" + + # - name: optimize wasm artifacts + # run: wasm-opt -O -ol 100 -s 100 -o ./target/wasm32-unknown-unknown/release/bevy_burn_depth_opt.wasm ./target/wasm32-unknown-unknown/release/bevy_burn_depth.wasm + + - name: generate bindings with wasm-bindgen + run: wasm-bindgen --out-dir ./crates/bevy_burn_depth/www/out/ --target web ./target/wasm32-unknown-unknown/release/bevy_burn_depth.wasm + + - name: copy assets + run: mkdir -p ./crates/bevy_burn_depth/www/assets && cp -r ./assets/* ./crates/bevy_burn_depth/assets/ && cp -r ./crates/bevy_burn_depth/assets/* ./crates/bevy_burn_depth/www/assets/ + + - name: deploy to github pages + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: ./crates/bevy_burn_depth/www + branch: www diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 726cc82..5a3f2b6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,4 +34,4 @@ jobs: enable-sccache: "false" - name: test (default) - run: cargo test --no-default-features --features backend_ndarray + run: cargo test --no-default-features --features=backend_ndarray diff --git a/.gitignore b/.gitignore index 5e79b24..1cd4b19 100644 --- a/.gitignore +++ b/.gitignore @@ -10,10 +10,11 @@ out/ !tool/*.py *.mpk +__pycache__/ + *.ply *.gcloud *.safetensors -assets/model/ __pycache__/ @@ -24,11 +25,11 @@ test_depth.png screenshots/ headless_output/ www/assets/ -crates/bevy_burn_dino/assets/ -crates/bevy_burn_dino/www/assets/ +crates/bevy_burn_depth/assets/ +crates/bevy_burn_depth/www/assets/ assets/images/ -assets/models/ +assets/model/ assets/pca/ output/ sandbox/ diff --git a/Cargo.lock b/Cargo.lock index 8c664a9..427edbf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -97,6 +97,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "aligned" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "377e4c0ba83e4431b10df45c1d4666f178ea9c552cac93e60c3a88bf32785923" +dependencies = [ + "as-slice", +] + [[package]] name = "aligned-vec" version = "0.6.4" @@ -192,22 +201,22 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.10" +version = "3.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -225,6 +234,15 @@ dependencies = [ "num-traits", ] +[[package]] +name = "ar_archive_writer" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c269894b6fe5e9d7ada0cf69b5bf847ff35bc25fc271f08e1d080fce80339a" +dependencies = [ + "object", +] + [[package]] name = "arbitrary" version = "1.4.2" @@ -242,7 +260,7 @@ checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -263,6 +281,15 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" +[[package]] +name = "as-slice" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516" +dependencies = [ + "stable_deref_trait", +] + [[package]] name = "ash" version = "0.38.0+1.3.281" @@ -280,7 +307,7 @@ checksum = "f548ad2c4031f2902e3edc1f29c29e835829437de49562d8eb5dc5584d3a1043" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -383,6 +410,26 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +[[package]] +name = "av-scenechange" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f321d77c20e19b92c39e7471cf986812cbb46659d2af674adc4331ef3f18394" +dependencies = [ + "aligned", + "anyhow", + "arg_enum_proc_macro", + "arrayvec", + "log", + "num-rational", + "num-traits", + "pastey", + "rayon", + "thiserror 2.0.17", + "v_frame", + "y4m", +] + [[package]] name = "av1-grain" version = "0.2.5" @@ -406,73 +453,12 @@ dependencies = [ "arrayvec", ] -[[package]] -name = "axum" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18ed336352031311f4e0b4dd2ff392d4fbb370777c9d18d7fc9d7359f73871" -dependencies = [ - "axum-core", - "base64", - "bytes", - "form_urlencoded", - "futures-util", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-util", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "serde_core", - "serde_json", - "serde_path_to_error", - "serde_urlencoded", - "sha1", - "sync_wrapper", - "tokio", - "tokio-tungstenite", - "tower", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "axum-core" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59446ce19cd142f8833f856eb31f3eb097812d1479ab224f54d72428ca21ea22" -dependencies = [ - "bytes", - "futures-core", - "http", - "http-body", - "http-body-util", - "mime", - "pin-project-lite", - "sync_wrapper", - "tower-layer", - "tower-service", - "tracing", -] - [[package]] name = "base64" version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "base64ct" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" - [[package]] name = "bevy" version = "0.17.2" @@ -613,24 +599,23 @@ dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] name = "bevy_burn" -version = "0.4.1" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ff62e1c3105d1ce251eca77f6db3e4d9718f174444507e6205c9bd5fbd95363" +checksum = "64914097c9eb2cda89bc7a8f4b4d31789c48c0ed09e01fd42e252d89a998861d" dependencies = [ "bevy", "burn", "burn-core", "burn-cubecl", - "burn-fusion", + "burn-cubecl-fusion", "burn-wgpu", "bytemuck", "console_error_panic_hook", - "cubecl", "getrandom 0.3.4", "wasm-bindgen", "web-sys", @@ -645,6 +630,8 @@ dependencies = [ "bevy_args", "bevy_burn", "burn", + "burn-cubecl-fusion", + "burn-wgpu", "burn_depth", "clap", "console_error_panic_hook", @@ -739,7 +726,7 @@ checksum = "b8c733807158f8fcac68e23222e69ed91a6492ae9410fc2c145b9bb182cfd63e" dependencies = [ "bevy_macro_utils", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -796,7 +783,7 @@ dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -846,7 +833,7 @@ checksum = "714273aa7f285c0aaa874b7fbe37fe4e6e45355e3e6f3321aefa1b78cda259e0" dependencies = [ "bevy_macro_utils", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -1005,8 +992,8 @@ dependencies = [ "parking_lot", "proc-macro2", "quote", - "syn 2.0.109", - "toml_edit 0.23.7", + "syn 2.0.110", + "toml_edit", ] [[package]] @@ -1021,7 +1008,7 @@ dependencies = [ "glam", "itertools 0.14.0", "libm", - "rand 0.9.2", + "rand", "rand_distr", "serde", "smallvec", @@ -1182,7 +1169,7 @@ dependencies = [ "indexmap", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", "uuid", ] @@ -1244,7 +1231,7 @@ dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -1344,7 +1331,7 @@ checksum = "5c3e4e32b1b96585740a2b447661af7db1b9d688db5e4d96da50461cd8f5ce63" dependencies = [ "bevy_macro_utils", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -1572,7 +1559,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.109", + "syn 2.0.110", "which", ] @@ -1593,7 +1580,7 @@ dependencies = [ "regex", "rustc-hash 2.1.1", "shlex", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -1635,9 +1622,12 @@ dependencies = [ [[package]] name = "bitstream-io" -version = "2.6.0" +version = "4.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6099cdc01846bc367c4e7dd630dc5966dccf36b652fae7a74e17b640411a91b2" +checksum = "60d4bd9d1db2c6bdf285e223a7fa369d5ce98ec767dec949c6ca62863ce61757" +dependencies = [ + "core2", +] [[package]] name = "blake3" @@ -1649,7 +1639,7 @@ dependencies = [ "arrayvec", "cc", "cfg-if 1.0.4", - "constant_time_eq 0.3.1", + "constant_time_eq", ] [[package]] @@ -1711,9 +1701,9 @@ dependencies = [ [[package]] name = "built" -version = "0.7.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ed6191a7e78c36abdb16ab65341eefd73d64d303fffccdbb00d51e4205967b" +checksum = "f4ad8f11f288f48ca24471bbd51ac257aaeaaa07adae295591266b792902ae64" [[package]] name = "bumpalo" @@ -1729,7 +1719,6 @@ checksum = "0291ea5c68786545e239a02f63331cfe39da7485164ae05197d5be6f148d0557" dependencies = [ "burn-autodiff", "burn-candle", - "burn-collective", "burn-core", "burn-cpu", "burn-cuda", @@ -1737,12 +1726,9 @@ dependencies = [ "burn-ndarray", "burn-nn", "burn-optim", - "burn-remote", "burn-rocm", "burn-router", "burn-store", - "burn-tch", - "burn-train", "burn-wgpu", ] @@ -1775,24 +1761,6 @@ dependencies = [ "half", ] -[[package]] -name = "burn-collective" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78abb99dcf39d0eeca7caf4606afba32924036ed7c387342a0bb855e936ba93c" -dependencies = [ - "burn-common", - "burn-communication", - "burn-tensor", - "bytes", - "futures", - "log", - "rmp-serde", - "serde", - "tokio", - "tokio-util", -] - [[package]] name = "burn-common" version = "0.19.1" @@ -1804,30 +1772,6 @@ dependencies = [ "serde", ] -[[package]] -name = "burn-communication" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "675c33a2bd0b3861dc672d5f1c9b8469ce1fbb8cbd191b247767fdd2a76f08bf" -dependencies = [ - "axum", - "burn-common", - "burn-tensor", - "bytes", - "derive-new", - "futures", - "futures-util", - "log", - "rmp-serde", - "serde", - "serde_bytes", - "tokio", - "tokio-tungstenite", - "tokio-util", - "tracing-core", - "tracing-subscriber", -] - [[package]] name = "burn-core" version = "0.19.1" @@ -1849,7 +1793,7 @@ dependencies = [ "num-traits", "portable-atomic", "portable-atomic-util", - "rand 0.9.2", + "rand", "regex", "rmp-serde", "serde", @@ -1895,7 +1839,7 @@ dependencies = [ "hashbrown 0.15.5", "log", "num-traits", - "rand 0.9.2", + "rand", "serde", "spin 0.10.0", "text_placeholder", @@ -1947,14 +1891,14 @@ dependencies = [ "image", "r2d2", "r2d2_sqlite", - "rand 0.9.2", + "rand", "rmp-serde", "rusqlite", "sanitize-filename", "serde", "serde_json", "serde_rusqlite", - "strum 0.27.2", + "strum", "tempfile", "thiserror 2.0.17", ] @@ -1968,7 +1912,7 @@ dependencies = [ "derive-new", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -2008,7 +1952,7 @@ dependencies = [ "rust-format", "serde", "serde_json", - "syn 2.0.109", + "syn 2.0.110", "thiserror 2.0.17", "tracing-core", "tracing-subscriber", @@ -2038,10 +1982,8 @@ dependencies = [ "burn-common", "burn-ir", "burn-tensor", - "bytemuck", "const-random", "derive-new", - "itertools 0.14.0", "libm", "macerator", "matrixmultiply", @@ -2049,8 +1991,7 @@ dependencies = [ "num-traits", "paste", "portable-atomic-util", - "rand 0.9.2", - "seq-macro", + "rand", "spin 0.10.0", ] @@ -2078,33 +2019,6 @@ dependencies = [ "serde", ] -[[package]] -name = "burn-remote" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb8e7c0d5466776f884b951ba94eac61ea0c340e7ed2b547a790e303f360c0c" -dependencies = [ - "async-channel", - "axum", - "burn-common", - "burn-communication", - "burn-ir", - "burn-router", - "burn-tensor", - "bytes", - "derive-new", - "futures-util", - "log", - "rmp-serde", - "serde", - "serde_bytes", - "tokio", - "tokio-tungstenite", - "tokio-util", - "tracing-core", - "tracing-subscriber", -] - [[package]] name = "burn-rocm" version = "0.19.1" @@ -2155,22 +2069,6 @@ dependencies = [ "zip 6.0.0", ] -[[package]] -name = "burn-tch" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf3bc363952fcb0d3d92daec70e04111d94beb5c48aded06ee6719d0b22f8a8" -dependencies = [ - "burn-common", - "burn-tensor", - "cc", - "half", - "libc", - "log", - "tch", - "torch-sys", -] - [[package]] name = "burn-tensor" version = "0.19.1" @@ -2186,35 +2084,12 @@ dependencies = [ "half", "hashbrown 0.15.5", "num-traits", - "rand 0.9.2", + "rand", "rand_distr", "serde", "serde_bytes", ] -[[package]] -name = "burn-train" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0f1553197d50668823a4bafc187c62439df49b218973f0ca79e034b57ce38d6" -dependencies = [ - "async-channel", - "burn-core", - "burn-ndarray", - "burn-optim", - "derive-new", - "log", - "nvml-wrapper", - "ratatui", - "rstest", - "serde", - "sysinfo 0.37.2", - "systemstat", - "tracing-appender", - "tracing-core", - "tracing-subscriber", -] - [[package]] name = "burn-wgpu" version = "0.19.1" @@ -2229,7 +2104,7 @@ dependencies = [ [[package]] name = "burn_depth" -version = "0.2.0" +version = "0.3.0" dependencies = [ "burn", "burn-import", @@ -2245,6 +2120,7 @@ dependencies = [ "safetensors 0.6.2", "serde", "serde_json", + "stacker", "wasm-bindgen", "web-sys", "wgpu", @@ -2252,13 +2128,14 @@ dependencies = [ [[package]] name = "burn_dino" -version = "0.5.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96141bff70c0b3bb6ab51ab8e9b01fce0a61332115f361fb42212e830fa2dcd8" +checksum = "8900f0381f8d2b9c919d4ad976049b89dc2b9db01fa7866f466810d0eff3ba38" dependencies = [ "burn", "console_error_panic_hook", "safetensors 0.6.2", + "serde", "wasm-bindgen", "web-sys", ] @@ -2280,7 +2157,7 @@ checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -2297,25 +2174,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "bytes" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" - -[[package]] -name = "bytesize" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e93abca9e28e0a1b9877922aacb20576e05d4679ffa78c3d6dc22a26a216659" - -[[package]] -name = "bzip2" -version = "0.4.4" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" -dependencies = [ - "bzip2-sys", - "libc", -] +checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" [[package]] name = "bzip2" @@ -2326,16 +2187,6 @@ dependencies = [ "libbz2-rs-sys", ] -[[package]] -name = "bzip2-sys" -version = "0.1.13+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225bff33b2141874fe80d71e07d6eec4f85c5c216453dd96388240f96e1acc14" -dependencies = [ - "cc", - "pkg-config", -] - [[package]] name = "calloop" version = "0.13.0" @@ -2362,7 +2213,7 @@ dependencies = [ "memmap2", "num-traits", "num_cpus", - "rand 0.9.2", + "rand", "rand_distr", "rayon", "safetensors 0.4.5", @@ -2381,32 +2232,17 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "cassowary" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" - [[package]] name = "cast" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" -[[package]] -name = "castaway" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a" -dependencies = [ - "rustversion", -] - [[package]] name = "cc" -version = "1.2.45" +version = "1.2.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35900b6c8d709fb1d854671ae27aeaa9eec2f8b01b364e1619a40da3e6fe2afe" +checksum = "b97463e1064cb1b1c1384ad0a0b9c8abd0988e2a91f52606c80ef14aadb63e36" dependencies = [ "find-msvc-tools", "jobserver", @@ -2429,16 +2265,6 @@ dependencies = [ "nom 7.1.3", ] -[[package]] -name = "cfg-expr" -version = "0.15.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" -dependencies = [ - "smallvec", - "target-lexicon", -] - [[package]] name = "cfg-if" version = "0.1.10" @@ -2536,7 +2362,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -2581,7 +2407,7 @@ checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81" dependencies = [ "serde", "termcolor", - "unicode-width 0.2.0", + "unicode-width", ] [[package]] @@ -2615,20 +2441,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "compact_str" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b79c4069c6cad78e2e0cdfcbd26275770669fb39fd308a752dc110e83b9af32" -dependencies = [ - "castaway", - "cfg-if 1.0.4", - "itoa", - "rustversion", - "ryu", - "static_assertions", -] - [[package]] name = "comrak" version = "0.39.1" @@ -2704,12 +2516,6 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87ca1caa64ef4ed453e68bb3db612e51cf1b2f5b871337f0fcab1c8f87cc3dff" -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - [[package]] name = "constant_time_eq" version = "0.3.1" @@ -2848,6 +2654,15 @@ dependencies = [ "objc", ] +[[package]] +name = "core2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" +dependencies = [ + "memchr", +] + [[package]] name = "cosmic-text" version = "0.14.2" @@ -2987,41 +2802,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] -name = "crossterm" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" -dependencies = [ - "bitflags 2.10.0", - "crossterm_winapi", - "mio", - "parking_lot", - "rustix 0.38.44", - "signal-hook", - "signal-hook-mio", - "winapi", -] - -[[package]] -name = "crossterm_winapi" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" -dependencies = [ - "winapi", -] - -[[package]] -name = "crunchy" -version = "0.2.4" +name = "crunchy" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "crypto-common" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" dependencies = [ "generic-array", "typenum", @@ -3103,7 +2893,7 @@ dependencies = [ "parking_lot", "portable-atomic", "portable-atomic-util", - "rand 0.9.2", + "rand", "sanitize-filename", "serde", "serde_bytes", @@ -3193,7 +2983,7 @@ dependencies = [ "half", "log", "serde", - "sysinfo 0.36.1", + "sysinfo", "tracel-llvm", "tracel-llvm-bundler", ] @@ -3279,7 +3069,7 @@ dependencies = [ "prettyplease 0.2.37", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -3291,7 +3081,7 @@ dependencies = [ "darling 0.21.3", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -3356,7 +3146,7 @@ dependencies = [ "cubecl-std", "half", "num-traits", - "rand 0.9.2", + "rand", "serde", ] @@ -3372,7 +3162,7 @@ dependencies = [ "half", "num-traits", "pretty_assertions", - "rand 0.9.2", + "rand", "serde", ] @@ -3399,7 +3189,7 @@ dependencies = [ "serde_json", "spin 0.10.0", "thiserror 2.0.17", - "toml 0.9.8", + "toml", "variadics_please", "wasm-bindgen-futures", ] @@ -3445,9 +3235,9 @@ dependencies = [ [[package]] name = "cudarc" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff0da1a70ec91e66731c1752deb9fda3044f1154fe4ceb5873e3f96ed34cafa3" +checksum = "0bf99ab37ee7072d64d906aa2dada9a3422f1d975cdf8c8055a573bc84897ed8" dependencies = [ "libloading", ] @@ -3489,7 +3279,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -3503,7 +3293,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -3514,7 +3304,7 @@ checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core 0.20.11", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -3525,7 +3315,7 @@ checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" dependencies = [ "darling_core 0.21.3", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -3571,7 +3361,7 @@ checksum = "2cdc8d50f426189eef89dac62fabfa0abb27d5cc008f25bf4156a0203325becc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -3582,7 +3372,7 @@ checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -3602,7 +3392,7 @@ checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", "unicode-xid", ] @@ -3676,7 +3466,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -3838,7 +3628,7 @@ checksum = "1796db3d892515842ca2dfb11124c4bb4a9e58d9f2c5c1072e5bca1b2334507b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -3856,7 +3646,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -3877,7 +3667,7 @@ dependencies = [ "darling 0.21.3", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -3897,7 +3687,7 @@ checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -3959,9 +3749,9 @@ dependencies = [ [[package]] name = "exr" -version = "1.73.0" +version = "1.74.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83197f59927b46c04a183a619b7c29df34e63e63c7869320862268c0ef687e0" +checksum = "4300e043a56aa2cb633c01af81ca8f699a321879a7854d3896a0ba89056363be" dependencies = [ "bit_field", "half", @@ -4007,7 +3797,7 @@ checksum = "a0aca10fb742cb43f9e7bb8467c91aa9bcb8e3ffbc6a6f7389bb93ffc920577d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -4033,9 +3823,9 @@ dependencies = [ [[package]] name = "find-msvc-tools" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127" +checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" [[package]] name = "fixedbitset" @@ -4170,7 +3960,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -4274,7 +4064,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -4289,12 +4079,6 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" -[[package]] -name = "futures-timer" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" - [[package]] name = "futures-util" version = "0.3.31" @@ -4552,9 +4336,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.9" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb6743198531e02858aeaea5398fcc883e71851fcbcb5a2f773e2fb6cb1edf2" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -4599,9 +4383,9 @@ dependencies = [ [[package]] name = "gif" -version = "0.13.3" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae047235e33e2829703574b54fdec96bfbad892062d97fed2f76022287de61b" +checksum = "f954a9e9159ec994f73a30a12b96a702dde78f5547bcb561174597924f7d4162" dependencies = [ "color_quant", "weezl", @@ -4705,7 +4489,7 @@ checksum = "bd47b05dddf0005d850e5644cae7f2b14ac3df487979dbfff3b56f20b1a6ae46" dependencies = [ "bytemuck", "libm", - "rand 0.9.2", + "rand", "serde_core", ] @@ -4832,7 +4616,7 @@ dependencies = [ "cfg-if 1.0.4", "crunchy", "num-traits", - "rand 0.9.2", + "rand", "rand_distr", "serde", "zerocopy", @@ -4991,17 +4775,11 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - [[package]] name = "hyper" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3aa54a13a0dfe7fbe3a59e0c76093041720fdc77b110cc0fc260fafb4dc51e" +checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" dependencies = [ "atomic-waker", "bytes", @@ -5011,7 +4789,6 @@ dependencies = [ "http", "http-body", "httparse", - "httpdate", "itoa", "pin-project-lite", "pin-utils", @@ -5034,14 +4811,14 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", - "webpki-roots 1.0.4", + "webpki-roots", ] [[package]] name = "hyper-util" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c6995591a8f1380fcb4ba966a252a4b29188d51d2b89e3a252f5305be65aea8" +checksum = "52e9a2a24dc5c6821e71a7030e1e14b7b632acac55c40e9d2e082c621261bb56" dependencies = [ "base64", "bytes", @@ -5171,9 +4948,9 @@ dependencies = [ [[package]] name = "image" -version = "0.25.8" +version = "0.25.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "529feb3e6769d234375c4cf1ee2ce713682b8e76538cb13f9fc23e1400a591e7" +checksum = "e6506c6c10786659413faa717ceebcb8f70731c0a60cbae39795fdf114519c1a" dependencies = [ "bytemuck", "byteorder-lite", @@ -5189,8 +4966,8 @@ dependencies = [ "rayon", "rgb", "tiff", - "zune-core", - "zune-jpeg", + "zune-core 0.5.0", + "zune-jpeg 0.5.5", ] [[package]] @@ -5219,15 +4996,6 @@ dependencies = [ "hashbrown 0.16.0", ] -[[package]] -name = "indoc" -version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706" -dependencies = [ - "rustversion", -] - [[package]] name = "inout" version = "0.1.4" @@ -5237,19 +5005,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "instability" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435d80800b936787d62688c927b6490e887c7ef5ff9ce922c6c6050fca75eb9a" -dependencies = [ - "darling 0.20.11", - "indoc", - "proc-macro2", - "quote", - "syn 2.0.109", -] - [[package]] name = "interpolate_name" version = "0.2.4" @@ -5258,7 +5013,7 @@ checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -5292,15 +5047,6 @@ version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.13.0" @@ -5549,15 +5295,6 @@ dependencies = [ "imgref", ] -[[package]] -name = "lru" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" -dependencies = [ - "hashbrown 0.15.5", -] - [[package]] name = "lru-slab" version = "0.1.2" @@ -5599,7 +5336,7 @@ dependencies = [ "darling 0.20.11", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -5620,12 +5357,6 @@ dependencies = [ "regex-automata", ] -[[package]] -name = "matchit" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" - [[package]] name = "matrixmultiply" version = "0.3.10" @@ -5633,10 +5364,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08" dependencies = [ "autocfg", - "num_cpus", - "once_cell", "rawpointer", - "thread-tree", ] [[package]] @@ -5701,12 +5429,6 @@ dependencies = [ "paste", ] -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - [[package]] name = "minimal-lexical" version = "0.2.1" @@ -5730,7 +5452,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69d83b0086dc8ecf3ce9ae2874b2d1290252e2a30720bea58a5c6639b0092873" dependencies = [ "libc", - "log", "wasi", "windows-sys 0.61.2", ] @@ -5867,7 +5588,6 @@ dependencies = [ "portable-atomic", "portable-atomic-util", "rawpointer", - "rayon", ] [[package]] @@ -6088,7 +5808,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -6161,39 +5881,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.109", -] - -[[package]] -name = "num_threads" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" -dependencies = [ - "libc", -] - -[[package]] -name = "nvml-wrapper" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d5c6c0ef9702176a570f06ad94f3198bc29c524c8b498f1b9346e1b1bdcbb3a" -dependencies = [ - "bitflags 2.10.0", - "libloading", - "nvml-wrapper-sys", - "static_assertions", - "thiserror 1.0.69", - "wrapcenum-derive", -] - -[[package]] -name = "nvml-wrapper-sys" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd23dbe2eb8d8335d2bce0299e0a07d6a63c089243d626ca75b770a962ff49e6" -dependencies = [ - "libloading", + "syn 2.0.110", ] [[package]] @@ -6446,6 +6134,15 @@ dependencies = [ "cc", ] +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + [[package]] name = "offset-allocator" version = "0.2.0" @@ -6482,7 +6179,7 @@ dependencies = [ "protobuf-codegen", "regex", "serde", - "strum 0.27.2", + "strum", ] [[package]] @@ -6544,17 +6241,6 @@ dependencies = [ "windows-link 0.2.1", ] -[[package]] -name = "password-hash" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" -dependencies = [ - "base64ct", - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "paste" version = "1.0.15" @@ -6562,16 +6248,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] -name = "pbkdf2" -version = "0.11.0" +name = "pastey" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" -dependencies = [ - "digest", - "hmac", - "password-hash", - "sha2", -] +checksum = "35fb2e5f958ec131621fdd531e9fc186ed768cbe395337403ae56c17a74c68ec" [[package]] name = "pbkdf2" @@ -6622,7 +6302,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -6805,7 +6485,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -6814,7 +6494,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" dependencies = [ - "toml_edit 0.23.7", + "toml_edit", ] [[package]] @@ -6842,7 +6522,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52717f9a02b6965224f95ca2a81e2e0c5c43baacd28ca057577988930b6c3d5b" dependencies = [ "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -6897,6 +6577,16 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "psm" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d11f2fedc3b7dafdc2851bc52f277377c5473d378859be234bc7ebb593144d01" +dependencies = [ + "ar_archive_writer", + "cc", +] + [[package]] name = "pulp" version = "0.18.22" @@ -6976,7 +6666,7 @@ dependencies = [ "bytes", "getrandom 0.3.4", "lru-slab", - "rand 0.9.2", + "rand", "ring", "rustc-hash 2.1.1", "rustls", @@ -7045,35 +6735,14 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "019b4b213425016d7d84a153c4c73afb0946fbb4840e4eece7ba8848b9d6da22" -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - [[package]] name = "rand" version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" dependencies = [ - "rand_chacha 0.9.0", - "rand_core 0.9.3", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", + "rand_chacha", + "rand_core", ] [[package]] @@ -7083,16 +6752,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core 0.9.3", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.16", + "rand_core", ] [[package]] @@ -7111,7 +6771,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8615d50dcf34fa31f7ab52692afec947c4dd0ab803cc87cb3b0b4570ff7463" dependencies = [ "num-traits", - "rand 0.9.2", + "rand", ] [[package]] @@ -7122,47 +6782,27 @@ checksum = "c3d6831663a5098ea164f89cff59c6284e95f4e3c76ce9848d4529f5ccca9bde" [[package]] name = "rangemap" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7e49bb0bf967717f7bd674458b3d6b0c5f48ec7e3038166026a69fc22223" - -[[package]] -name = "ratatui" -version = "0.29.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b" -dependencies = [ - "bitflags 2.10.0", - "cassowary", - "compact_str", - "crossterm", - "indoc", - "instability", - "itertools 0.13.0", - "lru", - "paste", - "strum 0.26.3", - "time", - "unicode-segmentation", - "unicode-truncate", - "unicode-width 0.2.0", -] +checksum = "acbbbbea733ec66275512d0b9694f34102e7d5406fdbe2ad8d21b28dce92887c" [[package]] name = "rav1e" -version = "0.7.1" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd87ce80a7665b1cce111f8a16c1f3929f6547ce91ade6addf4ec86a8dda5ce9" +checksum = "43b6dd56e85d9483277cde964fd1bdb0428de4fec5ebba7540995639a21cb32b" dependencies = [ + "aligned-vec", "arbitrary", "arg_enum_proc_macro", "arrayvec", + "av-scenechange", "av1-grain", "bitstream-io", "built", "cfg-if 1.0.4", "interpolate_name", - "itertools 0.12.1", + "itertools 0.14.0", "libc", "libfuzzer-sys", "log", @@ -7171,23 +6811,21 @@ dependencies = [ "noop_proc_macro", "num-derive", "num-traits", - "once_cell", "paste", "profiling", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", "simd_helpers", - "system-deps", - "thiserror 1.0.69", + "thiserror 2.0.17", "v_frame", "wasm-bindgen", ] [[package]] name = "ravif" -version = "0.11.20" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5825c26fddd16ab9f515930d49028a630efec172e903483c94796cfe31893e6b" +checksum = "ef69c1990ceef18a116855938e74793a5f7496ee907562bd0857b6ac734ab285" dependencies = [ "avif-serialize", "imgref", @@ -7328,12 +6966,6 @@ version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" -[[package]] -name = "relative-path" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" - [[package]] name = "renderdoc-sys" version = "1.1.0" @@ -7378,7 +7010,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 1.0.4", + "webpki-roots", ] [[package]] @@ -7445,35 +7077,6 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97" -[[package]] -name = "rstest" -version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5a3193c063baaa2a95a33f03035c8a72b83d97a54916055ba22d35ed3839d49" -dependencies = [ - "futures-timer", - "futures-util", - "rstest_macros", -] - -[[package]] -name = "rstest_macros" -version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c845311f0ff7951c5506121a9ad75aec44d083c31583b2ea5a30bcb0b0abba0" -dependencies = [ - "cfg-if 1.0.4", - "glob", - "proc-macro-crate", - "proc-macro2", - "quote", - "regex", - "relative-path", - "rustc_version", - "syn 2.0.109", - "unicode-ident", -] - [[package]] name = "rusqlite" version = "0.37.0" @@ -7552,7 +7155,6 @@ version = "0.23.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "533f54bc6a7d4f647e46ad909549eda97bf5afc1585190ef692b4286b198bd8f" dependencies = [ - "log", "once_cell", "ring", "rustls-pki-types", @@ -7620,16 +7222,6 @@ version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" -[[package]] -name = "safetensors" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93279b86b3de76f820a8854dd06cbc33cfa57a417b19c47f6a25280112fb1df" -dependencies = [ - "serde", - "serde_json", -] - [[package]] name = "safetensors" version = "0.4.5" @@ -7744,7 +7336,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -7760,17 +7352,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "serde_path_to_error" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" -dependencies = [ - "itoa", - "serde", - "serde_core", -] - [[package]] name = "serde_rusqlite" version = "0.40.1" @@ -7781,15 +7362,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "serde_spanned" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" -dependencies = [ - "serde", -] - [[package]] name = "serde_spanned" version = "1.0.3" @@ -7858,17 +7430,6 @@ dependencies = [ "signal-hook-registry", ] -[[package]] -name = "signal-hook-mio" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b75a19a7a740b25bc7944bdee6172368f988763b744e3d4dfe753f6b4ece40cc" -dependencies = [ - "libc", - "mio", - "signal-hook", -] - [[package]] name = "signal-hook-registry" version = "1.4.6" @@ -7996,6 +7557,19 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" +[[package]] +name = "stacker" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1f8b29fb42aafcea4edeeb6b2f2d7ecd0d969c48b4cf0d2e64aafc471dd6e59" +dependencies = [ + "cc", + "cfg-if 1.0.4", + "libc", + "psm", + "windows-sys 0.59.0", +] + [[package]] name = "stackfuture" version = "0.3.0" @@ -8014,35 +7588,13 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" -[[package]] -name = "strum" -version = "0.26.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" -dependencies = [ - "strum_macros 0.26.4", -] - [[package]] name = "strum" version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" dependencies = [ - "strum_macros 0.27.2", -] - -[[package]] -name = "strum_macros" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.109", + "strum_macros", ] [[package]] @@ -8054,7 +7606,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -8092,9 +7644,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.109" +version = "2.0.110" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f17c7e013e88258aa9543dcbe81aca68a667a9ac37cd69c9fbc07858bfe0e2f" +checksum = "a99801b5bd34ede4cf3fc688c5919368fea4e4814a4664359503e6015b280aea" dependencies = [ "proc-macro2", "quote", @@ -8118,7 +7670,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -8172,47 +7724,6 @@ dependencies = [ "windows 0.61.3", ] -[[package]] -name = "sysinfo" -version = "0.37.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16607d5caffd1c07ce073528f9ed972d88db15dd44023fa57142963be3feb11f" -dependencies = [ - "libc", - "memchr", - "ntapi", - "objc2-core-foundation", - "objc2-io-kit", - "windows 0.61.3", -] - -[[package]] -name = "system-deps" -version = "6.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" -dependencies = [ - "cfg-expr", - "heck", - "pkg-config", - "toml 0.8.23", - "version-compare", -] - -[[package]] -name = "systemstat" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5021f5184d44b26fb184acd689671bbe1e4bbd24bbdaa6bc7ec383fad32d2033" -dependencies = [ - "bytesize", - "lazy_static", - "libc", - "nom 7.1.3", - "time", - "winapi", -] - [[package]] name = "taffy" version = "0.7.7" @@ -8236,29 +7747,6 @@ dependencies = [ "xattr", ] -[[package]] -name = "target-lexicon" -version = "0.12.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" - -[[package]] -name = "tch" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e09b91610202dc4820c21eb474a42b386ef69f323b1c0902b5472ba7456ebb5" -dependencies = [ - "half", - "lazy_static", - "libc", - "ndarray", - "rand 0.8.5", - "safetensors 0.3.3", - "thiserror 1.0.69", - "torch-sys", - "zip 0.6.6", -] - [[package]] name = "tempfile" version = "3.23.0" @@ -8318,7 +7806,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -8329,16 +7817,7 @@ checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", -] - -[[package]] -name = "thread-tree" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbd370cb847953a25954d9f63e14824a36113f8c72eecf6eccef5dc4b45d630" -dependencies = [ - "crossbeam-channel", + "syn 2.0.110", ] [[package]] @@ -8361,7 +7840,7 @@ dependencies = [ "half", "quick-error", "weezl", - "zune-jpeg", + "zune-jpeg 0.4.21", ] [[package]] @@ -8371,14 +7850,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" dependencies = [ "deranged", - "itoa", - "libc", "num-conv", - "num_threads", "powerfmt", "serde", "time-core", - "time-macros", ] [[package]] @@ -8387,16 +7862,6 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" -[[package]] -name = "time-macros" -version = "0.2.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3" -dependencies = [ - "num-conv", - "time-core", -] - [[package]] name = "tiny-keccak" version = "2.0.2" @@ -8451,23 +7916,10 @@ dependencies = [ "libc", "mio", "pin-project-lite", - "signal-hook-registry", "socket2", - "tokio-macros", "windows-sys 0.61.2", ] -[[package]] -name = "tokio-macros" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.109", -] - [[package]] name = "tokio-rustls" version = "0.26.4" @@ -8478,18 +7930,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-tungstenite" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25a406cddcc431a75d3d9afc6a7c0f7428d4891dd973e4d54c56b46127bf857" -dependencies = [ - "futures-util", - "log", - "tokio", - "tungstenite", -] - [[package]] name = "tokio-util" version = "0.7.17" @@ -8503,18 +7943,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "toml" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" -dependencies = [ - "serde", - "serde_spanned 0.6.9", - "toml_datetime 0.6.11", - "toml_edit 0.22.27", -] - [[package]] name = "toml" version = "0.9.8" @@ -8523,22 +7951,13 @@ checksum = "f0dc8b1fb61449e27716ec0e1bdf0f6b8f3e8f6b05391e8497b8b6d7804ea6d8" dependencies = [ "indexmap", "serde_core", - "serde_spanned 1.0.3", - "toml_datetime 0.7.3", + "serde_spanned", + "toml_datetime", "toml_parser", "toml_writer", "winnow", ] -[[package]] -name = "toml_datetime" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" -dependencies = [ - "serde", -] - [[package]] name = "toml_datetime" version = "0.7.3" @@ -8548,19 +7967,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "toml_edit" -version = "0.22.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" -dependencies = [ - "indexmap", - "serde", - "serde_spanned 0.6.9", - "toml_datetime 0.6.11", - "winnow", -] - [[package]] name = "toml_edit" version = "0.23.7" @@ -8568,7 +7974,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6485ef6d0d9b5d0ec17244ff7eb05310113c3f316f2d14200d4de56b3cb98f8d" dependencies = [ "indexmap", - "toml_datetime 0.7.3", + "toml_datetime", "toml_parser", "winnow", ] @@ -8588,21 +7994,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2" -[[package]] -name = "torch-sys" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef40c585e342df95b66a1fa7c923188623999c2b657227befb481dfb03a6a42" -dependencies = [ - "anyhow", - "cc", - "libc", - "serde", - "serde_json", - "ureq", - "zip 0.6.6", -] - [[package]] name = "tower" version = "0.5.2" @@ -8616,7 +8007,6 @@ dependencies = [ "tokio", "tower-layer", "tower-service", - "tracing", ] [[package]] @@ -8699,7 +8089,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.109", + "syn 2.0.110", "tracel-llvm-bundler", "tracel-tblgen-rs", "unindent", @@ -8734,24 +8124,11 @@ version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ - "log", "pin-project-lite", "tracing-attributes", "tracing-core", ] -[[package]] -name = "tracing-appender" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" -dependencies = [ - "crossbeam-channel", - "thiserror 1.0.69", - "time", - "tracing-subscriber", -] - [[package]] name = "tracing-attributes" version = "0.1.30" @@ -8760,7 +8137,7 @@ checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -8843,23 +8220,6 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c591d83f69777866b9126b24c6dd9a18351f177e49d625920d19f989fd31cf8" -[[package]] -name = "tungstenite" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8628dcc84e5a09eb3d8423d6cb682965dea9133204e8fb3efee74c2a0c259442" -dependencies = [ - "bytes", - "data-encoding", - "http", - "httparse", - "log", - "rand 0.9.2", - "sha1", - "thiserror 2.0.17", - "utf-8", -] - [[package]] name = "twox-hash" version = "2.1.2" @@ -8977,28 +8337,11 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" -[[package]] -name = "unicode-truncate" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf" -dependencies = [ - "itertools 0.13.0", - "unicode-segmentation", - "unicode-width 0.1.14", -] - [[package]] name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - -[[package]] -name = "unicode-width" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" [[package]] name = "unicode-xid" @@ -9030,24 +8373,6 @@ version = "0.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae" -[[package]] -name = "ureq" -version = "2.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" -dependencies = [ - "base64", - "flate2", - "log", - "once_cell", - "rustls", - "rustls-pki-types", - "serde", - "serde_json", - "url", - "webpki-roots 0.26.11", -] - [[package]] name = "url" version = "2.5.7" @@ -9060,12 +8385,6 @@ dependencies = [ "serde", ] -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" - [[package]] name = "utf8_iter" version = "1.0.4" @@ -9086,7 +8405,7 @@ checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" dependencies = [ "getrandom 0.3.4", "js-sys", - "rand 0.9.2", + "rand", "serde", "wasm-bindgen", ] @@ -9136,7 +8455,7 @@ checksum = "41b6d82be61465f97d42bd1d15bf20f3b0a3a0905018f38f9d6f6962055b0b5c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -9145,12 +8464,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "version-compare" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e" - [[package]] name = "version_check" version = "0.9.5" @@ -9242,7 +8555,7 @@ dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", "wasm-bindgen-shared", ] @@ -9275,15 +8588,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "0.26.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" -dependencies = [ - "webpki-roots 1.0.4", -] - [[package]] name = "webpki-roots" version = "1.0.4" @@ -9295,9 +8599,9 @@ dependencies = [ [[package]] name = "weezl" -version = "0.1.10" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a751b3277700db47d3e574514de2eced5e54dc8a5436a3bf7a0b248b2cee16f3" +checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" [[package]] name = "wgpu" @@ -9614,7 +8918,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -9625,7 +8929,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -9636,7 +8940,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -9647,7 +8951,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -10045,18 +9349,6 @@ version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" -[[package]] -name = "wrapcenum-derive" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76ff259533532054cfbaefb115c613203c73707017459206380f03b3b3f266e" -dependencies = [ - "darling 0.20.11", - "proc-macro2", - "quote", - "syn 2.0.109", -] - [[package]] name = "writeable" version = "0.6.2" @@ -10130,6 +9422,12 @@ version = "0.8.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ae8337f8a065cfc972643663ea4279e04e7256de865aa66fe25cec5fb912d3f" +[[package]] +name = "y4m" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5a4b21e1a62b67a2970e6831bc091d7b87e119e7f9791aef9702e3bef04448" + [[package]] name = "yansi" version = "1.0.1" @@ -10173,7 +9471,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", "synstructure", ] @@ -10185,7 +9483,7 @@ checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", "synstructure", ] @@ -10212,7 +9510,7 @@ checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -10232,7 +9530,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", "synstructure", ] @@ -10253,7 +9551,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -10286,27 +9584,7 @@ checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", -] - -[[package]] -name = "zip" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" -dependencies = [ - "aes", - "byteorder", - "bzip2 0.4.4", - "constant_time_eq 0.1.5", - "crc32fast", - "crossbeam-utils", - "flate2", - "hmac", - "pbkdf2 0.11.0", - "sha1", - "time", - "zstd 0.11.2+zstd.1.5.2", + "syn 2.0.110", ] [[package]] @@ -10332,8 +9610,8 @@ checksum = "eb2a05c7c36fde6c09b08576c9f7fb4cda705990f73b58fe011abf7dfb24168b" dependencies = [ "aes", "arbitrary", - "bzip2 0.6.1", - "constant_time_eq 0.3.1", + "bzip2", + "constant_time_eq", "crc32fast", "deflate64", "flate2", @@ -10342,13 +9620,13 @@ dependencies = [ "indexmap", "lzma-rust2", "memchr", - "pbkdf2 0.12.2", + "pbkdf2", "ppmd-rust", "sha1", "time", "zeroize", "zopfli", - "zstd 0.13.3", + "zstd", ] [[package]] @@ -10369,32 +9647,13 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "zstd" -version = "0.11.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" -dependencies = [ - "zstd-safe 5.0.2+zstd.1.5.2", -] - [[package]] name = "zstd" version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" dependencies = [ - "zstd-safe 7.2.4", -] - -[[package]] -name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" -dependencies = [ - "libc", - "zstd-sys", + "zstd-safe", ] [[package]] @@ -10422,6 +9681,12 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" +[[package]] +name = "zune-core" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "111f7d9820f05fd715df3144e254d6fc02ee4088b0644c0ffd0efc9e6d9d2773" + [[package]] name = "zune-inflate" version = "0.2.54" @@ -10437,7 +9702,16 @@ version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29ce2c8a9384ad323cf564b67da86e21d3cfdff87908bc1223ed5c99bc792713" dependencies = [ - "zune-core", + "zune-core 0.4.12", +] + +[[package]] +name = "zune-jpeg" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc6fb7703e32e9a07fb3f757360338b3a567a5054f21b5f52a666752e333d58e" +dependencies = [ + "zune-core 0.5.0", ] [[patch.unused]] diff --git a/Cargo.toml b/Cargo.toml index c7591fb..f5baef3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "burn_depth" description = "burn depth pro model inference" -version = "0.2.0" +version = "0.3.0" edition = "2024" authors = ["mosure "] license = "MIT OR Apache-2.0" @@ -62,8 +62,8 @@ backend_wgpu = ["burn/wgpu", "burn_dino/backend_wgpu", "half"] [dependencies] -burn = "0.19" -burn_dino = { version = "0.5.2", default-features = false } +burn_dino = { version = "0.6", default-features = false } +image = { version = "0.25", default-features = false, features = ["png", "jpeg"] } half = { version = "2", optional = true } @@ -75,6 +75,14 @@ serde_json = { version = "1.0", optional = true } safetensors = { version = "0.6", optional = true } +[dependencies.burn] +version = "0.19" +default-features = false +features = [ + "std", +] + + [target.'cfg(target_arch = "wasm32")'.dependencies] console_error_panic_hook = "0.1" wasm-bindgen = "0.2" @@ -91,14 +99,17 @@ features = [ 'Window', ] +[target.'cfg(not(target_arch = "wasm32"))'.dependencies] +stacker = "0.1" + [dev-dependencies] criterion = { version = "0.7", features = ["html_reports"] } futures-intrusive = { version = "0.5.0" } -image = { version = "0.25", default-features = false, features = ["png", "jpeg"] } pollster = { version = "0.4.0" } safetensors = "0.6" wgpu = "26.0" +clap = { version = "4.5", features = ["derive"] } [patch.crates-io] @@ -139,6 +150,16 @@ path = "example/inference.rs" name = "correctness" path = "example/correctness.rs" +[[example]] +name = "da3_small_correctness" +path = "example/da3_small_correctness.rs" +required-features = ["backend_ndarray"] + +[[example]] +name = "da3_wgpu_loader" +path = "example/da3_wgpu_loader.rs" +required-features = ["backend_wgpu"] + [[bench]] name = "inference_benchmark" @@ -153,6 +174,11 @@ harness = false [[bin]] -name = "import" -path = "tool/import.rs" +name = "import_depth_pro" +path = "tool/import_depth_pro.rs" +required-features = ["import"] + +[[bin]] +name = "import_da3" +path = "tool/import_da3.rs" required-features = ["import"] diff --git a/README.md b/README.md index 04efc2f..8b54198 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,6 @@ burn [depth pro](https://github.com/apple/ml-depth-pro) model inference use burn::prelude::*; use burn_depth::{InferenceBackend, model::depth_pro::DepthPro}; -// NdArray backend (alternatively: burn::backend::Cuda, burn::backend::Cpu) let device = ::Device::default(); let model = DepthPro::::load(&device, "assets/model/depth_pro.mpk")?; @@ -31,9 +30,27 @@ let result = model.infer(input, None); // result.focallength_px: Tensor with shape [1] ``` +### switching between depth_pro and depth anything 3 + +```bash +cargo run --example inference -- \ + --model depth-pro \ + --checkpoint assets/model/depth_pro.mpk \ + --image assets/image/test.jpg + +cargo run --example inference -- \ + --model depth-anything3 \ + --checkpoint assets/model/da3_metric_large.mpk \ + --image assets/image/test.jpg +``` + ## setup - download [`depth_pro.pt`](https://github.com/apple/ml-depth-pro/blob/main/get_pretrained_models.sh) to `assets/model/` -- `cargo run --bin import --features import` -- `cargo run --example inference` +- `cargo run --bin import_depth_pro --features import` + +- download [`da3_metric_large.safetensors`](https://huggingface.co/depth-anything/Depth-Anything-V3) to `assets/model/` +- `cargo run --bin import_da3 --features import` + +- `cargo run --example inference -- --help` diff --git a/assets/model/da3_small.mpk b/assets/model/da3_small.mpk new file mode 100644 index 0000000..5fc0d2f Binary files /dev/null and b/assets/model/da3_small.mpk differ diff --git a/bench/inference.rs b/bench/inference.rs index 2eaf170..a7c7a43 100644 --- a/bench/inference.rs +++ b/bench/inference.rs @@ -3,7 +3,10 @@ use burn::prelude::*; use burn_depth::{ InferenceBackend, - model::depth_pro::{DepthPro, DepthProConfig}, + model::{ + depth_anything3::{DepthAnything3, DepthAnything3Config}, + depth_pro::{DepthPro, DepthProConfig}, + }, }; use criterion::{Criterion, Throughput, criterion_group, criterion_main}; use std::hint::black_box; @@ -17,16 +20,43 @@ criterion_main!(depth_pro_benchmarks); fn inference_benchmark(c: &mut Criterion) { let device = ::Device::default(); - let model = DepthPro::::new(&device, DepthProConfig::default()); - let image_size = model.img_size(); - let input: Tensor = Tensor::zeros([1, 3, image_size, image_size], &device); let bench_device = device.clone(); + let depth_pro = DepthPro::::new(&device, DepthProConfig::default()); + let pro_size = depth_pro.img_size(); + let pro_input = Tensor::::zeros([1, 3, pro_size, pro_size], &device); + + let depth_anything_large = + DepthAnything3::::new(&device, DepthAnything3Config::metric_large()); + let da3_large_size = depth_anything_large.img_size(); + let da3_large_input = + Tensor::::zeros([1, 3, da3_large_size, da3_large_size], &device); + + let depth_anything_small = + DepthAnything3::::new(&device, DepthAnything3Config::small()); + let da3_small_size = depth_anything_small.img_size(); + let da3_small_input = + Tensor::::zeros([1, 3, da3_small_size, da3_small_size], &device); + let mut group = c.benchmark_group("burn_depth_inference"); group.throughput(Throughput::Elements(1)); group.bench_function("depth_pro_infer", |b| { b.iter(|| { - let output = model.infer(input.clone()); + let output = depth_pro.infer(pro_input.clone()); + InferenceBackend::sync(&bench_device); + black_box(output); + }); + }); + group.bench_function("depth_anything3_metric_large_infer", |b| { + b.iter(|| { + let output = depth_anything_large.infer(da3_large_input.clone()); + InferenceBackend::sync(&bench_device); + black_box(output); + }); + }); + group.bench_function("depth_anything3_small_infer", |b| { + b.iter(|| { + let output = depth_anything_small.infer(da3_small_input.clone()); InferenceBackend::sync(&bench_device); black_box(output); }); diff --git a/crates/bevy_burn_depth/Cargo.toml b/crates/bevy_burn_depth/Cargo.toml index 17702da..281a8bf 100644 --- a/crates/bevy_burn_depth/Cargo.toml +++ b/crates/bevy_burn_depth/Cargo.toml @@ -31,7 +31,7 @@ perftest = [] [dependencies] bevy_args = "2.0" bevy_burn = "0.4" -burn_depth = { path = "../../", default-features = false, features = ["backend_wgpu"] } +burn_depth = { path = "../../", default-features = false } clap = { version = "4.5", features = ["derive"] } futures = { version = "0.3", optional = true } futures-intrusive = "0.5" @@ -75,7 +75,25 @@ features = [ # "fusion", "std", # "template", - "wgpu", + # "wgpu", +] + +[dependencies.burn-cubecl-fusion] +version = "0.19" +default-features = false +features = [ + "std", + # "std", +] + + +[dependencies.burn-wgpu] +version = "0.19" +default-features = false +features = [ + "fusion", + # "std", + # "template", ] diff --git a/crates/bevy_burn_depth/src/lib.rs b/crates/bevy_burn_depth/src/lib.rs index 5614fba..3102ddc 100644 --- a/crates/bevy_burn_depth/src/lib.rs +++ b/crates/bevy_burn_depth/src/lib.rs @@ -3,25 +3,27 @@ use std::sync::{Arc, Mutex}; use burn::prelude::*; use burn_depth::{ inference::infer_from_rgb, - model::depth_pro::DepthPro, + model::{depth_anything3::DepthAnything3, prepare_depth_anything3_image, PreparedModelImage}, }; -use image::RgbImage; +use image::{imageops, RgbImage}; pub mod platform; pub async fn process_frame( frame: RgbImage, - model: Arc>>, + model: Arc>>, device: B::Device, + patch_size: usize, + preferred_resolution: Option, + normalize_relative_depth: bool, ) -> Tensor { - let width = frame.width() as usize; - let height = frame.height() as usize; + let patch_size = patch_size.max(1); + let (frame, width, height) = prepare_input_frame(frame, patch_size, preferred_resolution); let pixels = frame.into_raw(); let inference = { let guard = model.lock().expect("depth model poisoned"); - infer_from_rgb(&*guard, &pixels, width, height, &device) - .expect("failed to run inference") + infer_from_rgb(&*guard, &pixels, width, height, &device).expect("failed to run inference") }; let depth_map: Tensor = inference.depth.squeeze_dim(0); @@ -29,31 +31,35 @@ pub async fn process_frame( let height = dims[0]; let width = dims[1]; - let min_depth = depth_map - .clone() - .min() - .into_scalar_async() - .await - .elem::(); - let max_depth = depth_map - .clone() - .max() - .into_scalar_async() - .await - .elem::(); - let range = (max_depth - min_depth).max(f32::EPSILON); + let display_tensor = if normalize_relative_depth { + let min_depth = depth_map + .clone() + .min() + .into_scalar_async() + .await + .elem::(); + let max_depth = depth_map + .clone() + .max() + .into_scalar_async() + .await + .elem::(); + let range = (max_depth - min_depth).max(f32::EPSILON); - let normalized = depth_map - .sub_scalar(min_depth) - .div_scalar(range) - .clamp(0.0, 1.0) - .reshape([height as i32, width as i32, 1]); + depth_map + .sub_scalar(min_depth) + .div_scalar(range) + .clamp(0.0, 1.0) + .reshape([height as i32, width as i32, 1]) + } else { + depth_map.clone().reshape([height as i32, width as i32, 1]) + }; let rgb = Tensor::::cat( vec![ - normalized.clone(), - normalized.clone(), - normalized.clone(), + display_tensor.clone(), + display_tensor.clone(), + display_tensor.clone(), ], 2, ); @@ -62,3 +68,61 @@ pub async fn process_frame( Tensor::::cat(vec![rgb, alpha], 2).reshape([height as i32, width as i32, 4]) } + +fn prepare_input_frame( + mut frame: RgbImage, + patch_size: usize, + preferred_resolution: Option, +) -> (RgbImage, usize, usize) { + if let Some(mut target) = preferred_resolution { + target = target.max(patch_size).max(1); + let PreparedModelImage { + rgb, width, height, .. + } = prepare_depth_anything3_image(&frame, target) + .expect("failed to prepare Depth Anything input frame"); + return (rgb, width, height); + } + + let mut width = frame.width() as usize; + let mut height = frame.height() as usize; + let alignment = patch_size * 4; + let align_down = |value: usize| -> usize { + if value < patch_size { + value + } else if value >= alignment { + let rem = value % alignment; + if rem == 0 { + value + } else { + value - rem + } + } else { + let rem = value % patch_size; + if rem == 0 { + value + } else { + value - rem + } + } + }; + + let crop_width = align_down(width).max(1); + let crop_height = align_down(height).max(1); + + if crop_width != width || crop_height != height { + let offset_x = (width - crop_width) / 2; + let offset_y = (height - crop_height) / 2; + frame = imageops::crop_imm( + &frame, + offset_x as u32, + offset_y as u32, + crop_width as u32, + crop_height as u32, + ) + .to_image(); + width = crop_width; + height = crop_height; + } + + (frame, width, height) +} diff --git a/crates/bevy_burn_depth/src/main.rs b/crates/bevy_burn_depth/src/main.rs index f565c8d..ca98f93 100644 --- a/crates/bevy_burn_depth/src/main.rs +++ b/crates/bevy_burn_depth/src/main.rs @@ -15,26 +15,22 @@ use bevy::{ ecs::world::CommandQueue, prelude::*, render::{ + RenderPlugin, render_resource::{Extent3d, TextureDimension, TextureFormat, TextureUsages}, settings::{RenderCreation, WgpuFeatures, WgpuSettings}, - RenderPlugin, }, - tasks::{block_on, futures_lite::future, AsyncComputeTaskPool, Task}, + tasks::{AsyncComputeTaskPool, Task, block_on, futures_lite::future}, ui::widget::ImageNode, - window::WindowResolution, }; -use bevy_args::{parse_args, Deserialize, Parser, Serialize}; -use bevy_burn::{BevyBurnBridgePlugin, BevyBurnHandle, BindingDirection, TransferKind}; +use bevy_args::{Deserialize, Parser, Serialize, parse_args}; +use bevy_burn::{BevyBurnBridgePlugin, BevyBurnHandle, BindingDirection, BurnDevice, TransferKind}; use bevy_burn_depth::{platform::camera::receive_image, process_frame}; -use burn::{ - backend::wgpu::graphics::AutoGraphicsApi, - backend::wgpu::{init_setup_async, Wgpu}, - prelude::*, -}; -use burn_depth::model::depth_pro::{DepthPro, DepthProConfig}; +use burn::prelude::*; +use burn_depth::model::depth_anything3::{DepthAnything3, DepthAnything3Config}; +use burn_wgpu::Wgpu; use image::RgbImage; -const DEFAULT_CHECKPOINT: &str = "assets/model/depth_pro.mpk"; +const DEFAULT_CHECKPOINT: &str = "assets/model/da3_small.mpk"; const MAX_IN_FLIGHT_TASKS: usize = 1; #[derive(Resource, Clone, Debug, Serialize, Deserialize, Parser, Reflect)] @@ -52,6 +48,9 @@ pub struct BevyBurnDepthConfig { #[arg(long)] pub image_path: Option, + + #[arg(long, default_value = "true")] + pub normalize_relative_depth: bool, } impl Default for BevyBurnDepthConfig { @@ -61,6 +60,7 @@ impl Default for BevyBurnDepthConfig { show_fps: true, checkpoint: PathBuf::from(DEFAULT_CHECKPOINT), image_path: None, + normalize_relative_depth: true, } } } @@ -69,16 +69,24 @@ impl Default for BevyBurnDepthConfig { mod io { use std::path::Path; - use burn::prelude::*; - use burn_depth::model::depth_pro::{DepthPro, DepthProConfig}; + use burn::{ + prelude::*, + record::{HalfPrecisionSettings, NamedMpkFileRecorder}, + }; + use burn_depth::model::depth_anything3::{ + DepthAnything3, DepthAnything3Config, with_model_load_stack, + }; pub async fn load_model( - config: DepthProConfig, + config: DepthAnything3Config, checkpoint: &Path, device: &B::Device, - ) -> DepthPro { - DepthPro::load_with_config(device, config, checkpoint) - .expect("failed to load DepthPro checkpoint") + ) -> DepthAnything3 { + let recorder = NamedMpkFileRecorder::::new(); + with_model_load_stack(|| { + DepthAnything3::new(device, config).load_file(checkpoint, &recorder, device) + }) + .expect("failed to load Depth Anything 3 checkpoint") } } @@ -88,18 +96,20 @@ mod io { prelude::*, record::{HalfPrecisionSettings, NamedMpkBytesRecorder, Recorder}, }; - use burn_depth::model::depth_pro::{DepthPro, DepthProConfig}; + use burn_depth::model::depth_anything3::{ + DepthAnything3, DepthAnything3Config, with_model_load_stack, + }; use js_sys::Uint8Array; use wasm_bindgen::JsCast; use wasm_bindgen_futures::JsFuture; - use web_sys::{window, Request, RequestInit, RequestMode, Response}; + use web_sys::{Request, RequestInit, RequestMode, Response, window}; pub async fn load_model( - config: DepthProConfig, + config: DepthAnything3Config, checkpoint: &str, device: &B::Device, - ) -> DepthPro { - let mut opts = RequestInit::new(); + ) -> DepthAnything3 { + let opts = RequestInit::new(); opts.set_method("GET"); opts.set_mode(RequestMode::Cors); @@ -125,18 +135,46 @@ mod io { bytes.copy_to(&mut data); let record = NamedMpkBytesRecorder::::default() - .load(data, &Default::default()) + .load(data, device) .expect("failed to decode checkpoint"); - let model = DepthPro::new(device, config); - model.load_record(record) + with_model_load_stack(|| { + let model = DepthAnything3::new(device, config); + model.load_record(record) + }) } } #[derive(Resource)] -struct DepthModel { - device: B::Device, - model: Arc>>, +struct DepthModelState { + checkpoint: PathBuf, + config: DepthAnything3Config, + preferred_resolution: Option, + model: Option>>>, + load_task: Option>, + normalize_relative_depth: bool, +} + +impl DepthModelState { + fn new( + checkpoint: PathBuf, + config: DepthAnything3Config, + normalize_relative_depth: bool, + ) -> Self { + Self { + checkpoint, + preferred_resolution: Some(config.image_size), + config, + model: None, + load_task: None, + normalize_relative_depth, + } + } +} + +struct DepthModelLoadResult { + model: DepthAnything3, + resolution: usize, } #[derive(Resource)] @@ -166,11 +204,16 @@ struct ProcessDepth(Task); fn process_frames( mut commands: Commands, - depth_model: Res>, + depth_model: Res, depth_texture: Res, static_frame: Res, active_tasks: Query<&ProcessDepth>, + burn_device: Option>, ) { + let Some(model) = depth_model.model.as_ref() else { + return; + }; + let Some(image_entity) = depth_texture.entity else { return; }; @@ -179,6 +222,18 @@ fn process_frames( return; } + let Some(burn_device) = burn_device else { + return; + }; + + if !burn_device.is_ready() { + return; + } + + let normalize_relative_depth = depth_model.normalize_relative_depth; + let device = burn_device.device().unwrap().clone(); + let model = model.clone(); + let frame_source = if let Some(frame) = static_frame.0.as_ref() { Some((**frame).clone()) } else { @@ -188,13 +243,21 @@ fn process_frames( if let Some(frame) = frame_source { let thread_pool = AsyncComputeTaskPool::get(); let task_entity = commands.spawn_empty().id(); - let device = depth_model.device.clone(); - let model = depth_model.model.clone(); + let patch_size = depth_model.config.patch_size; + let preferred_resolution = depth_model.preferred_resolution; let task = thread_pool.spawn({ let target = image_entity; async move { - let tensor = process_frame(frame, model.clone(), device.clone()).await; + let tensor = process_frame( + frame, + model.clone(), + device.clone(), + patch_size, + preferred_resolution, + normalize_relative_depth, + ) + .await; let [tensor_height, tensor_width, _] = tensor.dims(); let mut queue = CommandQueue::default(); @@ -260,6 +323,97 @@ fn process_frames( } } +fn begin_depth_model_load( + mut depth_model: ResMut, + burn_device: Option>, +) { + if depth_model.model.is_some() || depth_model.load_task.is_some() { + return; + } + + let Some(burn_device) = burn_device else { + return; + }; + + if !burn_device.is_ready() { + return; + } + + let checkpoint = depth_model.checkpoint.clone(); + let config = depth_model.config.clone(); + let device = burn_device.device().unwrap().clone(); + + log("loading depth model..."); + log(&format!("checkpoint: {}", checkpoint.display())); + + depth_model.load_task = Some(spawn_depth_model_load_task(config, checkpoint, device)); +} + +#[cfg(feature = "native")] +fn spawn_depth_model_load_task( + config: DepthAnything3Config, + checkpoint: PathBuf, + device: ::Device, +) -> Task { + AsyncComputeTaskPool::get().spawn(async move { + log("begin load_model task (native)..."); + let depth = io::load_model::(config, checkpoint.as_path(), &device).await; + log("load_model task finished."); + let resolution = depth.img_size(); + DepthModelLoadResult { + model: depth, + resolution, + } + }) +} + +#[cfg(feature = "web")] +fn spawn_depth_model_load_task( + config: DepthAnything3Config, + checkpoint: PathBuf, + device: ::Device, +) -> Task { + let checkpoint = normalize_web_checkpoint(&checkpoint); + AsyncComputeTaskPool::get().spawn(async move { + let depth = io::load_model::(config, &checkpoint, &device).await; + let resolution = depth.img_size(); + DepthModelLoadResult { + model: depth, + resolution, + } + }) +} + +#[cfg(feature = "web")] +fn normalize_web_checkpoint(path: &Path) -> String { + let normalized = path.to_string_lossy().replace('\\', "/"); + if normalized.starts_with("./") + || normalized.starts_with('/') + || normalized.starts_with("http://") + || normalized.starts_with("https://") + || normalized.starts_with("data:") + { + normalized + } else { + format!("./{normalized}") + } +} + +fn finish_depth_model_load(mut depth_model: ResMut) { + let Some(task) = depth_model.load_task.as_mut() else { + return; + }; + + if let Some(result) = block_on(future::poll_once(task)) { + log(&format!( + "depth model ready (inference resolution: {}px)", + result.resolution + )); + depth_model.model = Some(Arc::new(Mutex::new(result.model))); + depth_model.load_task = None; + } +} + fn handle_tasks( mut commands: Commands, mut diagnostics: Diagnostics, @@ -281,17 +435,6 @@ fn handle_tasks( } } -#[cfg(target_arch = "wasm32")] -fn depth_image_setup() -> (&'static [u8], TextureFormat, TransferKind, TextureUsages) { - ( - &[0u8; 4], - TextureFormat::Rgba8UnormSrgb, - TransferKind::Cpu, - TextureUsages::COPY_SRC | TextureUsages::COPY_DST | TextureUsages::TEXTURE_BINDING, - ) -} - -#[cfg(not(target_arch = "wasm32"))] fn depth_image_setup() -> (&'static [u8], TextureFormat, TransferKind, TextureUsages) { ( &[0u8; 16], @@ -306,10 +449,22 @@ fn depth_image_setup() -> (&'static [u8], TextureFormat, TransferKind, TextureUs fn setup_ui( mut commands: Commands, - depth: Res>, mut depth_texture: ResMut, mut images: ResMut>, + burn_device: Option>, ) { + if depth_texture.entity.is_some() { + return; + } + + let Some(burn_device) = burn_device else { + return; + }; + + if !burn_device.is_ready() { + return; + } + let size = Extent3d { width: depth_texture.width.max(1), height: depth_texture.height.max(1), @@ -349,7 +504,7 @@ fn setup_ui( depth_texture.width.max(1) as usize, 4, ], - &depth.device, + burn_device.device().unwrap(), ), upload: true, direction: BindingDirection::BurnToBevy, @@ -388,7 +543,7 @@ pub fn viewer_app(args: BevyBurnDepthConfig) -> App { let primary_window = Some(Window { mode: bevy::window::WindowMode::Windowed, prevent_default_event_handling: false, - resolution: WindowResolution::new(1024, 1024), + resolution: bevy::window::WindowResolution::new(1024, 1024), title, #[cfg(feature = "perftest")] present_mode: bevy::window::PresentMode::AutoNoVsync, @@ -482,31 +637,11 @@ fn fps_update_system( } } -async fn run_app(args: BevyBurnDepthConfig) { +fn run_app(args: BevyBurnDepthConfig) { log("running app..."); log(&format!("{args:?}")); - let device = Default::default(); - init_setup_async::(&device, Default::default()).await; - log("device created"); - - let config = DepthProConfig::default(); - - log("loading depth model..."); - - #[cfg(feature = "native")] - let depth = io::load_model::(config.clone(), args.checkpoint.as_path(), &device).await; - - #[cfg(feature = "web")] - let depth = io::load_model::( - config.clone(), - args.checkpoint.to_string_lossy().as_ref(), - &device, - ) - .await; - - let image_size = depth.img_size(); - log(&format!("depth model ready (inference resolution: {image_size}px)")); + let config = DepthAnything3Config::small(); let static_frame = args.image_path.as_ref().map(|path| { image::open(path) @@ -525,13 +660,22 @@ async fn run_app(args: BevyBurnDepthConfig) { app.insert_resource(depth_texture); app.insert_resource(StaticFrame(static_frame.clone())); - app.insert_resource(DepthModel { - device: device.clone(), - model: Arc::new(Mutex::new(depth)), - }); - - app.add_systems(Startup, setup_ui); - app.add_systems(Update, (handle_tasks, process_frames)); + app.insert_resource(DepthModelState::new( + args.checkpoint.clone(), + config, + args.normalize_relative_depth, + )); + app.add_systems( + Update, + ( + setup_ui, + begin_depth_model_load, + finish_depth_model_load, + handle_tasks, + process_frames, + ) + .chain(), + ); log("launching Bevy application..."); app.run(); @@ -542,17 +686,17 @@ async fn run_app(args: BevyBurnDepthConfig) { } } -pub fn log(message: &str) { +pub fn log(_message: &str) { #[cfg(debug_assertions)] #[cfg(target_arch = "wasm32")] { - web_sys::console::log_1(&message.into()); + web_sys::console::log_1(&_message.into()); } #[cfg(debug_assertions)] #[cfg(not(target_arch = "wasm32"))] { - println!("{message}"); + println!("{_message}"); } } @@ -563,7 +707,7 @@ fn main() { if args.image_path.is_none() { std::thread::spawn(bevy_burn_depth::platform::camera::native_camera_thread); } - futures::executor::block_on(run_app(args)); + run_app(args); } #[cfg(target_arch = "wasm32")] @@ -573,6 +717,6 @@ fn main() { #[cfg(debug_assertions)] console_error_panic_hook::set_once(); - wasm_bindgen_futures::spawn_local(run_app(args)); + run_app(args); } } diff --git a/crates/bevy_burn_depth/www/index.html b/crates/bevy_burn_depth/www/index.html index 6652545..dc6b379 100644 --- a/crates/bevy_burn_depth/www/index.html +++ b/crates/bevy_burn_depth/www/index.html @@ -1,7 +1,7 @@ - bevy_burn_dino + bevy_burn_depth