.gitignore
+1
-0
diff --git a/.gitignore b/.gitignore
index ea8c4bf..6150586 100644
@@ -1 +1,2 @@
/target
face_detection_yunet_2026may.onnx
Cargo.lock
+831
-45
diff --git a/Cargo.lock b/Cargo.lock
index a25dc2d..6ecec46 100644
@@ -105,7 +105,7 @@ version = "0.8.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75"
dependencies = [
"cfg-if",
"cfg-if 1.0.5",
"getrandom 0.3.4",
"once_cell",
"version_check",
@@ -135,7 +135,7 @@ checksum = "812947049edcd670a82cd5c73c3661d2e58468577ba8489de58e1a73c04cbd5d"
dependencies = [
"alsa-sys",
"bitflags 2.13.2",
"cfg-if",
"cfg-if 1.0.5",
"libc",
]
@@ -236,7 +236,7 @@ version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
dependencies = [
"windows-sys 0.60.2",
"windows-sys 0.61.2",
]
[[package]]
@@ -247,7 +247,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
dependencies = [
"anstyle",
"once_cell_polyfill",
"windows-sys 0.60.2",
"windows-sys 0.61.2",
]
[[package]]
@@ -380,7 +380,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc"
dependencies = [
"autocfg",
"cfg-if",
"cfg-if 1.0.5",
"concurrent-queue",
"futures-io",
"futures-lite",
@@ -443,6 +443,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5"
[[package]]
name = "base64ct"
version = "1.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06"
[[package]]
name = "bevy"
version = "0.20.0-rc.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1420,11 +1426,11 @@ dependencies = [
"portable-atomic",
"portable-atomic-util",
"serde",
"spin",
"spin 0.12.3",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-time",
"windows-sys 0.60.2",
"windows-sys 0.61.2",
]
[[package]]
@@ -2000,6 +2006,29 @@ dependencies = [
]
[[package]]
name = "bindgen"
version = "0.65.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5"
dependencies = [
"bitflags 1.3.2",
"cexpr",
"clang-sys",
"lazy_static",
"lazycell",
"log",
"peeking_take_while",
"prettyplease",
"proc-macro2",
"quote",
"regex",
"rustc-hash 1.1.0",
"shlex 1.3.0",
"syn 2.0.119",
"which",
]
[[package]]
name = "bit-set"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2059,12 +2088,18 @@ checksum = "6d9e454fc11f76977dc803893aff6304ed33d6a26efae8696573bea74baa27ae"
dependencies = [
"arrayvec",
"cc",
"cfg-if",
"cfg-if 1.0.5",
"constant_time_eq",
"cpufeatures 0.3.1",
]
[[package]]
name = "block"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
[[package]]
name = "block-buffer"
version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2183,7 +2218,7 @@ dependencies = [
"find-msvc-tools",
"jobserver",
"libc",
"shlex",
"shlex 2.0.1",
]
[[package]]
@@ -2193,6 +2228,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c"
[[package]]
name = "cexpr"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
dependencies = [
"nom 7.1.3",
]
[[package]]
name = "cfg-if"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]]
name = "cfg-if"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2205,6 +2255,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527"
[[package]]
name = "clang-sys"
version = "1.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "157a8ba7b480713b56f4c09fd13fc3e0a22a5dfab8097ba61cbc5feef950788a"
dependencies = [
"glob",
"libc",
"libloading",
]
[[package]]
name = "clipboard-win"
version = "5.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2214,6 +2275,34 @@ dependencies = [
]
[[package]]
name = "cocoa"
version = "0.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c49e86fc36d5704151f5996b7b3795385f50ce09e3be0f47a0cfde869681cf8"
dependencies = [
"bitflags 1.3.2",
"block",
"core-foundation 0.7.0",
"core-graphics 0.19.2",
"foreign-types 0.3.2",
"libc",
"objc",
]
[[package]]
name = "cocoa-foundation"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81411967c50ee9a1fc11365f8c585f863a22a9697c89239c452292c40ba79b0d"
dependencies = [
"bitflags 2.13.2",
"block",
"core-foundation 0.10.1",
"core-graphics-types 0.2.0",
"objc",
]
[[package]]
name = "codespan-reporting"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2254,7 +2343,7 @@ version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc"
dependencies = [
"cfg-if",
"cfg-if 1.0.5",
"wasm-bindgen",
]
@@ -2305,30 +2394,68 @@ dependencies = [
[[package]]
name = "core-foundation"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171"
dependencies = [
"core-foundation-sys 0.7.0",
"libc",
]
[[package]]
name = "core-foundation"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
dependencies = [
"core-foundation-sys",
"core-foundation-sys 0.8.7",
"libc",
]
[[package]]
name = "core-foundation"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6"
dependencies = [
"core-foundation-sys 0.8.7",
"libc",
]
[[package]]
name = "core-foundation-sys"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac"
[[package]]
name = "core-foundation-sys"
version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]]
name = "core-graphics"
version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923"
dependencies = [
"bitflags 1.3.2",
"core-foundation 0.7.0",
"foreign-types 0.3.2",
"libc",
]
[[package]]
name = "core-graphics"
version = "0.23.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081"
dependencies = [
"bitflags 1.3.2",
"core-foundation",
"core-graphics-types",
"foreign-types",
"core-foundation 0.9.4",
"core-graphics-types 0.1.3",
"foreign-types 0.5.0",
"libc",
]
@@ -2339,11 +2466,47 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf"
dependencies = [
"bitflags 1.3.2",
"core-foundation",
"core-foundation 0.9.4",
"libc",
]
[[package]]
name = "core-graphics-types"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb"
dependencies = [
"bitflags 2.13.2",
"core-foundation 0.10.1",
"libc",
]
[[package]]
name = "core-media-sys"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "273bf3fc5bf51fd06a7766a84788c1540b6527130a0bce39e00567d6ab9f31f1"
dependencies = [
"cfg-if 0.1.10",
"core-foundation-sys 0.7.0",
"libc",
]
[[package]]
name = "core-video-sys"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828"
dependencies = [
"cfg-if 0.1.10",
"core-foundation-sys 0.7.0",
"core-graphics 0.19.2",
"libc",
"metal",
"objc",
]
[[package]]
name = "coreaudio-rs"
version = "0.14.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2411,7 +2574,7 @@ version = "1.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01a7799fd6b852db0e61728dde9a204c423b44d689dbd432522543614b490e78"
dependencies = [
"cfg-if",
"cfg-if 1.0.5",
]
[[package]]
@@ -2484,6 +2647,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c87e182de0887fd5361989c677c4e8f5000cd9491d6d563161a8f3a5519fc7f"
[[package]]
name = "der"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a878c850e9e421b20262e9b41f9c860e4785fa07541c266b62ff9d1ef998a80a"
dependencies = [
"pem-rfc7468",
"zeroize",
]
[[package]]
name = "derive_more"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2588,6 +2761,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76"
[[package]]
name = "dunce"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
[[package]]
name = "either"
version = "1.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2657,7 +2836,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [
"libc",
"windows-sys 0.60.2",
"windows-sys 0.61.2",
]
[[package]]
@@ -2734,6 +2913,18 @@ dependencies = [
]
[[package]]
name = "flume"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095"
dependencies = [
"futures-core",
"futures-sink",
"nanorand",
"spin 0.9.9",
]
[[package]]
name = "fnv"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2776,12 +2967,21 @@ dependencies = [
[[package]]
name = "foreign-types"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
dependencies = [
"foreign-types-shared 0.1.1",
]
[[package]]
name = "foreign-types"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965"
dependencies = [
"foreign-types-macros",
"foreign-types-shared",
"foreign-types-shared 0.3.1",
]
[[package]]
@@ -2797,6 +2997,12 @@ dependencies = [
[[package]]
name = "foreign-types-shared"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
[[package]]
name = "foreign-types-shared"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"
@@ -2853,6 +3059,12 @@ dependencies = [
]
[[package]]
name = "futures-sink"
version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d"
[[package]]
name = "futures-task"
version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2893,11 +3105,24 @@ dependencies = [
[[package]]
name = "getrandom"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
dependencies = [
"cfg-if 1.0.5",
"js-sys",
"libc",
"wasi",
"wasm-bindgen",
]
[[package]]
name = "getrandom"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
dependencies = [
"cfg-if",
"cfg-if 1.0.5",
"libc",
"r-efi 5.3.0",
"wasip2",
@@ -2909,7 +3134,7 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"
dependencies = [
"cfg-if",
"cfg-if 1.0.5",
"libc",
"r-efi 6.0.0",
]
@@ -2974,6 +3199,12 @@ dependencies = [
]
[[package]]
name = "glob"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b"
[[package]]
name = "glow"
version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3060,7 +3291,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b"
dependencies = [
"bytemuck",
"cfg-if",
"cfg-if 1.0.5",
"crunchy",
"num-traits",
"serde",
@@ -3148,6 +3379,37 @@ dependencies = [
]
[[package]]
name = "hmac-sha256"
version = "1.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ad320b3b96fb2a455a0726d16efe0a5afdbd34b71dea5bc53b05ea057714d4e"
[[package]]
name = "home"
version = "0.5.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d"
dependencies = [
"windows-sys 0.61.2",
]
[[package]]
name = "http"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0"
dependencies = [
"bytes",
"itoa",
]
[[package]]
name = "httparse"
version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
[[package]]
name = "icu_collections"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3372,7 +3634,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97"
dependencies = [
"cesu8",
"cfg-if",
"cfg-if 1.0.5",
"combine",
"jni-sys 0.3.1",
"log",
@@ -3387,7 +3649,7 @@ version = "0.22.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498"
dependencies = [
"cfg-if",
"cfg-if 1.0.5",
"combine",
"jni-macros",
"jni-sys 0.4.1",
@@ -3455,7 +3717,7 @@ version = "0.3.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7883d941dae510fb2d978fc3fe018c71c9e2892fd38854de3e8b92c2e5ad9cc5"
dependencies = [
"cfg-if",
"cfg-if 1.0.5",
"futures-util",
"wasm-bindgen",
]
@@ -3532,6 +3794,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20870f649af7073d53e38067b2a84312175d56ea15217e1b15bc83506ec50afb"
[[package]]
name = "lazycell"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "lewton"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3620,7 +3888,7 @@ version = "0.8.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55"
dependencies = [
"cfg-if",
"cfg-if 1.0.5",
"windows-link",
]
@@ -3730,6 +3998,12 @@ dependencies = [
]
[[package]]
name = "lzma-rust2"
version = "0.15.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e20f57f9918e5bd7bc58c22cdd70a6afc7375d4dd9683af5f2b34bd3d2bba619"
[[package]]
name = "mach2"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3739,6 +4013,15 @@ dependencies = [
]
[[package]]
name = "malloc_buf"
version = "0.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb"
dependencies = [
"libc",
]
[[package]]
name = "matchers"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3748,6 +4031,16 @@ dependencies = [
]
[[package]]
name = "matrixmultiply"
version = "0.3.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f607c237553f086e7043417a51df26b2eb899d3caff94e6a67592ff992fedc7"
dependencies = [
"autocfg",
"rawpointer",
]
[[package]]
name = "memchr"
version = "2.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3763,6 +4056,27 @@ dependencies = [
]
[[package]]
name = "metal"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e198a0ee42bdbe9ef2c09d0b9426f3b2b47d90d93a4a9b0395c4cea605e92dc0"
dependencies = [
"bitflags 1.3.2",
"block",
"cocoa",
"core-graphics 0.19.2",
"foreign-types 0.3.2",
"log",
"objc",
]
[[package]]
name = "minimal-lexical"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]]
name = "miniz_oxide"
version = "0.8.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3793,6 +4107,31 @@ dependencies = [
]
[[package]]
name = "mozjpeg"
version = "0.10.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7891b80aaa86097d38d276eb98b3805d6280708c4e0a1e6f6aed9380c51fec9"
dependencies = [
"arrayvec",
"bytemuck",
"libc",
"mozjpeg-sys",
"rgb",
]
[[package]]
name = "mozjpeg-sys"
version = "2.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f0dc668bf9bf888c88e2fb1ab16a406d2c380f1d082b20d51dd540ab2aa70c1"
dependencies = [
"cc",
"dunce",
"libc",
"nasm-rs",
]
[[package]]
name = "mutants"
version = "0.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3807,7 +4146,7 @@ dependencies = [
"arrayvec",
"bit-set 0.10.0",
"bitflags 2.13.2",
"cfg-if",
"cfg-if 1.0.5",
"cfg_aliases",
"codespan-reporting",
"half",
@@ -3838,6 +4177,57 @@ dependencies = [
]
[[package]]
name = "nanorand"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3"
dependencies = [
"getrandom 0.2.17",
]
[[package]]
name = "nasm-rs"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "706bf8a5e8c8ddb99128c3291d31bd21f4bcde17f0f4c20ec678d85c74faa149"
dependencies = [
"jobserver",
"log",
]
[[package]]
name = "native-tls"
version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2"
dependencies = [
"libc",
"log",
"openssl",
"openssl-probe",
"openssl-sys",
"schannel",
"security-framework",
"security-framework-sys",
"tempfile",
]
[[package]]
name = "ndarray"
version = "0.17.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "520080814a7a6b4a6e9070823bb24b4531daac8c4627e08ba5de8c5ef2f2752d"
dependencies = [
"matrixmultiply",
"num-complex",
"num-integer",
"num-traits",
"portable-atomic",
"portable-atomic-util",
"rawpointer",
]
[[package]]
name = "ndk"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3880,12 +4270,89 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d"
dependencies = [
"bitflags 2.13.2",
"cfg-if",
"cfg-if 1.0.5",
"cfg_aliases",
"libc",
]
[[package]]
name = "nokhwa"
version = "0.10.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d63f10b450319a0ace7aa8e0e25477d1fdb345313a97e220e886175539a1dbb"
dependencies = [
"flume",
"image",
"nokhwa-bindings-linux",
"nokhwa-bindings-macos",
"nokhwa-bindings-windows",
"nokhwa-core",
"paste",
"thiserror 2.0.21",
]
[[package]]
name = "nokhwa-bindings-linux"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb67e22201a53322291740ca064b20eaaade7222ef0349f312d9b37b004e1984"
dependencies = [
"libc",
"nokhwa-core",
"v4l",
]
[[package]]
name = "nokhwa-bindings-macos"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f70d3908ea68324e44a6b3a0f885aa59e433fb1f6678839d09e0df7d226fb42d"
dependencies = [
"block",
"cocoa-foundation",
"core-foundation 0.10.1",
"core-media-sys",
"core-video-sys",
"flume",
"nokhwa-core",
"objc",
"once_cell",
]
[[package]]
name = "nokhwa-bindings-windows"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5be28886bad8abcec3655c1f24b965b4cb596a72b23164c910c54439ce55d2a4"
dependencies = [
"nokhwa-core",
"once_cell",
"windows",
]
[[package]]
name = "nokhwa-core"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1cba20bebd3bd9ae22f9273ade5bbe49da3e047c8512b53fbaf8b4b9c80d496"
dependencies = [
"bytes",
"image",
"mozjpeg",
"thiserror 2.0.21",
]
[[package]]
name = "nom"
version = "7.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
dependencies = [
"memchr",
"minimal-lexical",
]
[[package]]
name = "nom"
version = "8.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3915,7 +4382,7 @@ version = "0.50.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
dependencies = [
"windows-sys 0.60.2",
"windows-sys 0.61.2",
]
[[package]]
@@ -3929,6 +4396,15 @@ dependencies = [
]
[[package]]
name = "num-complex"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
dependencies = [
"num-traits",
]
[[package]]
name = "num-derive"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3992,6 +4468,16 @@ dependencies = [
]
[[package]]
name = "objc"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1"
dependencies = [
"malloc_buf",
"objc_exception",
]
[[package]]
name = "objc-sys"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -4351,6 +4837,15 @@ dependencies = [
]
[[package]]
name = "objc_exception"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4"
dependencies = [
"cc",
]
[[package]]
name = "offset-allocator"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -4382,6 +4877,49 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
[[package]]
name = "openssl"
version = "0.10.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77823a27f0babb03091cb9ed9ef80af3b39dbc82f97e8fa530374b7dafd87a45"
dependencies = [
"bitflags 2.13.2",
"cfg-if 1.0.5",
"foreign-types 0.3.2",
"libc",
"openssl-macros",
"openssl-sys",
]
[[package]]
name = "openssl-macros"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.119",
]
[[package]]
name = "openssl-probe"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe"
[[package]]
name = "openssl-sys"
version = "0.9.117"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b47e7e6bb2c38cd930d25a23b40fa52e068c10e85f3e03a7f5ba5aaca5713695"
dependencies = [
"cc",
"libc",
"pkg-config",
"vcpkg",
]
[[package]]
name = "orbclient"
version = "0.3.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -4401,13 +4939,37 @@ dependencies = [
]
[[package]]
name = "ort"
version = "2.0.0-rc.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4336a1e2b38848325241c72889086886004e589b7c74f335e60a8e8db5138a0b"
dependencies = [
"ndarray",
"ort-sys",
"smallvec",
"tracing",
"ureq",
]
[[package]]
name = "ort-sys"
version = "2.0.0-rc.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf211e3776eea6aec988552fa118dd746d70e1b1e5e244058d1c98015f3e5872"
dependencies = [
"hmac-sha256",
"lzma-rust2",
"ureq",
]
[[package]]
name = "os_pipe"
version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967"
dependencies = [
"libc",
"windows-sys 0.45.0",
"windows-sys 0.61.2",
]
[[package]]
@@ -4441,7 +5003,7 @@ version = "0.9.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"
dependencies = [
"cfg-if",
"cfg-if 1.0.5",
"libc",
"redox_syscall 0.5.18",
"smallvec",
@@ -4482,6 +5044,27 @@ dependencies = [
]
[[package]]
name = "paste"
version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
[[package]]
name = "peeking_take_while"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
[[package]]
name = "pem-rfc7468"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a6305423e0e7738146434843d1694d621cce767262b2a86910beab705e4493d9"
dependencies = [
"base64ct",
]
[[package]]
name = "percent-encoding"
version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -4577,7 +5160,7 @@ version = "3.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218"
dependencies = [
"cfg-if",
"cfg-if 1.0.5",
"concurrent-queue",
"hermit-abi",
"pin-project-lite",
@@ -4624,6 +5207,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa"
[[package]]
name = "prettyplease"
version = "0.2.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
dependencies = [
"proc-macro2",
"syn 2.0.119",
]
[[package]]
name = "proc-macro-crate"
version = "3.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -4746,6 +5339,12 @@ dependencies = [
]
[[package]]
name = "rawpointer"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
[[package]]
name = "read-fonts"
version = "0.41.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -4825,6 +5424,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832"
[[package]]
name = "rgb"
version = "0.8.53"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47b34b781b31e5d73e9fbc8689c70551fd1ade9a19e3e28cfec8580a79290cc4"
dependencies = [
"bytemuck",
]
[[package]]
name = "rodio"
version = "0.22.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -4896,7 +5504,16 @@ dependencies = [
"errno",
"libc",
"linux-raw-sys 0.12.1",
"windows-sys 0.60.2",
"windows-sys 0.61.2",
]
[[package]]
name = "rustls-pki-types"
version = "1.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96"
dependencies = [
"zeroize",
]
[[package]]
@@ -4924,6 +5541,15 @@ dependencies = [
]
[[package]]
name = "schannel"
version = "0.1.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939"
dependencies = [
"windows-sys 0.61.2",
]
[[package]]
name = "scoped-tls"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -4949,6 +5575,29 @@ dependencies = [
]
[[package]]
name = "security-framework"
version = "3.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d"
dependencies = [
"bitflags 2.13.2",
"core-foundation 0.10.1",
"core-foundation-sys 0.8.7",
"libc",
"security-framework-sys",
]
[[package]]
name = "security-framework-sys"
version = "2.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3"
dependencies = [
"core-foundation-sys 0.8.7",
"libc",
]
[[package]]
name = "semver"
version = "1.0.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5024,6 +5673,12 @@ dependencies = [
[[package]]
name = "shlex"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]]
name = "shlex"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
@@ -5122,6 +5777,26 @@ dependencies = [
]
[[package]]
name = "socks"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0c3dbbd9ae980613c6dd8e28a9407b50509d3803b57624d5dfe8315218cd58b"
dependencies = [
"byteorder",
"libc",
"winapi",
]
[[package]]
name = "spin"
version = "0.9.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3763264f6b73151db08c50ff20d7d8a0b8796e021cdea7ceedad07b80155fa0e"
dependencies = [
"lock_api",
]
[[package]]
name = "spin"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5264,12 +5939,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
[[package]]
name = "tempfile"
version = "3.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
dependencies = [
"fastrand",
"getrandom 0.4.3",
"once_cell",
"rustix 1.1.5",
"windows-sys 0.61.2",
]
[[package]]
name = "term"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8c27177b12a6399ffc08b98f76f7c9a1f4fe9fc967c784c5a071fa8d93cf7e1"
dependencies = [
"windows-sys 0.60.2",
"windows-sys 0.61.2",
]
[[package]]
@@ -5318,7 +6006,7 @@ version = "1.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ad99c4c6d32803332c548b1af0540b357b3f5fc0be8f6c6bfe8b2e6ae784070"
dependencies = [
"cfg-if",
"cfg-if 1.0.5",
]
[[package]]
@@ -5330,7 +6018,7 @@ dependencies = [
"arrayref",
"arrayvec",
"bytemuck",
"cfg-if",
"cfg-if 1.0.5",
"log",
"tiny-skia-path",
]
@@ -5452,7 +6140,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d76902d2a8d5f9f55a81155c08971734071968c90f2d9bfe645fe700579b2950"
dependencies = [
"cc",
"cfg-if",
"cfg-if 1.0.5",
"tracing-core",
"tracing-subscriber",
]
@@ -5493,7 +6181,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8765b90061cba6c22b5831f675da109ae5561588290f9fa2317adab2714d5a6"
dependencies = [
"memchr",
"nom",
"nom 8.0.0",
"petgraph",
]
@@ -5563,6 +6251,42 @@ dependencies = [
]
[[package]]
name = "ureq"
version = "3.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a7ac20be9b7726e0bbdbf974c059676d9acb1cd414961f570a4e8231cacd7fc"
dependencies = [
"base64",
"der",
"log",
"native-tls",
"percent-encoding",
"rustls-pki-types",
"socks",
"ureq-proto",
"utf8-zero",
"webpki-root-certs",
]
[[package]]
name = "ureq-proto"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f86fd172ccca569e458f61b6bdd6220965a9ef36e672a6852953b51a0e1583be"
dependencies = [
"base64",
"http",
"httparse",
"log",
]
[[package]]
name = "utf8-zero"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8c0a043c9540bae7c578c88f91dda8bd82e59ae27c21baca69c8b191aaf5a6e"
[[package]]
name = "utf8_iter"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5587,6 +6311,26 @@ dependencies = [
]
[[package]]
name = "v4l"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8fbfea44a46799d62c55323f3c55d06df722fbe577851d848d328a1041c3403"
dependencies = [
"bitflags 1.3.2",
"libc",
"v4l2-sys-mit",
]
[[package]]
name = "v4l2-sys-mit"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6779878362b9bacadc7893eac76abe69612e8837ef746573c4a5239daf11990b"
dependencies = [
"bindgen",
]
[[package]]
name = "valuable"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5603,6 +6347,12 @@ dependencies = [
]
[[package]]
name = "vcpkg"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]]
name = "vec_map"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5625,6 +6375,12 @@ dependencies = [
]
[[package]]
name = "wasi"
version = "0.11.1+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
[[package]]
name = "wasip2"
version = "1.0.4+wasi-0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5639,7 +6395,7 @@ version = "0.2.129"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9bb54f33acc68fd454578d9820b0bde1a1a3d17aa17bb7b6595806d02886d409"
dependencies = [
"cfg-if",
"cfg-if 1.0.5",
"once_cell",
"rustversion",
"wasm-bindgen-macro",
@@ -5804,7 +6560,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5eba2ec791141b0bf4db542f6b038a8f9310cee33e076cb181245780b09a24ff"
dependencies = [
"cfg-if",
"cfg-if 1.0.5",
"hashbrown 0.16.1",
]
@@ -5825,7 +6581,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1cdc136a53ccd64a1211f107ccc34404769fbcc0f165f1afa065f5d88ab93538"
dependencies = [
"async-task",
"cfg-if",
"cfg-if 1.0.5",
"js-sys",
"wasm-bindgen",
]
@@ -5841,6 +6597,15 @@ dependencies = [
]
[[package]]
name = "webpki-root-certs"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b96554aa2acc8ccdb7e1c9a58a7a68dd5d13bccc69cd124cb09406db612a1c9b"
dependencies = [
"rustls-pki-types",
]
[[package]]
name = "wesl"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5879,7 +6644,7 @@ dependencies = [
"arrayvec",
"bitflags 2.13.2",
"bytemuck",
"cfg-if",
"cfg-if 1.0.5",
"cfg_aliases",
"document-features",
"hashbrown 0.17.1",
@@ -5971,7 +6736,7 @@ dependencies = [
"bitflags 2.13.2",
"block2 0.6.2",
"bytemuck",
"cfg-if",
"cfg-if 1.0.5",
"cfg_aliases",
"glow",
"glutin_wgl_sys",
@@ -6070,6 +6835,18 @@ dependencies = [
]
[[package]]
name = "which"
version = "4.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7"
dependencies = [
"either",
"home",
"once_cell",
"rustix 0.38.44",
]
[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -6091,7 +6868,7 @@ version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
dependencies = [
"windows-sys 0.60.2",
"windows-sys 0.61.2",
]
[[package]]
@@ -6104,8 +6881,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
name = "window"
version = "0.1.0"
dependencies = [
"async-channel",
"bevy",
"dpi",
"nokhwa",
"ort",
"windows",
]
@@ -6465,8 +7245,8 @@ dependencies = [
"calloop",
"cfg_aliases",
"concurrent-queue",
"core-foundation",
"core-graphics",
"core-foundation 0.9.4",
"core-graphics 0.23.2",
"cursor-icon",
"dpi",
"js-sys",
@@ -6690,6 +7470,12 @@ dependencies = [
]
[[package]]
name = "zeroize"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e"
[[package]]
name = "zerotrie"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
Cargo.toml
+4
-1
diff --git a/Cargo.toml b/Cargo.toml
index e187631..97a5c40 100644
@@ -4,8 +4,11 @@ version = "0.1.0"
edition = "2024"
[dependencies]
bevy = { version = "0.20.0-rc.1", features = ["debug", "dynamic_linking", "gamepad"] }
async-channel = "2.5.0"
bevy = { version = "0.20.0-rc.1", features = ["debug", "dynamic_linking"] }
dpi = "0.1.2"
nokhwa = { version = "0.10.11", features = ["input-native", "camera-sync-impl"] }
ort = "2.0.0-rc.13"
[target.'cfg(windows)'.dependencies]
windows = { version = "0.62.2", features = ["Devices_Display"] }
src/camera_controller.rs
+13
-61
diff --git a/src/camera_controller.rs b/src/camera_controller.rs
index 73d9daa..f377eab 100644
@@ -1,84 +1,36 @@
use bevy::{
app::{App, Plugin, Update},
camera::Camera,
ecs::{
query::With,
schedule::IntoScheduleConfigs,
system::{If, Res, Single},
},
input::{
ButtonInput,
gamepad::{Gamepad, GamepadAxis, GamepadButton},
keyboard::KeyCode,
},
ecs::{message::MessageReader, query::With, system::Single},
math::Vec3,
transform::components::Transform,
};
use crate::virtual_window::VirtualWindow;
use crate::{face_detection::FaceMoved, virtual_window::VirtualWindow};
pub struct CameraControllerPlugin;
impl Plugin for CameraControllerPlugin {
fn build(&self, app: &mut App) {
app.add_systems(
Update,
(move_camera_with_keyboard, move_camera_with_controller).chain(),
);
app.add_systems(Update, move_camera_with_face);
}
}
fn move_camera_with_controller(
fn move_camera_with_face(
camera: Single<(&mut Transform, &VirtualWindow), With<Camera>>,
gamepad: If<Single<&Gamepad>>,
mut face_moved: MessageReader<FaceMoved>,
) {
let (mut camera, window) = camera.into_inner();
let mut origin = window.camera_position() + window.camera_normal().as_vec3();
camera.translation = origin;
camera.look_at(window.center(), Vec3::Y);
let Some(face) = face_moved.read().last() else {
return;
};
origin += camera.local_z().as_vec3()
* (gamepad
.get(GamepadButton::LeftTrigger2)
.and_then(|r| gamepad.get(GamepadButton::RightTrigger2).map(|l| r - l)))
.unwrap_or_default();
origin += camera.local_x().as_vec3() * gamepad.get(GamepadAxis::LeftStickX).unwrap_or_default();
origin += camera.local_y().as_vec3() * gamepad.get(GamepadAxis::LeftStickY).unwrap_or_default();
camera.translation = origin;
camera.look_at(window.center(), Vec3::Y);
}
fn move_camera_with_keyboard(
camera: Single<(&mut Transform, &VirtualWindow), With<Camera>>,
input: Res<ButtonInput<KeyCode>>,
) {
let (mut camera, window) = camera.into_inner();
let mut origin = window.camera_position() + window.camera_normal().as_vec3();
camera.translation = origin;
camera.look_at(window.center(), Vec3::Y);
if input.pressed(KeyCode::KeyS) {
origin += camera.local_z().as_vec3();
}
if input.pressed(KeyCode::KeyW) {
origin -= camera.local_z().as_vec3();
}
if input.pressed(KeyCode::KeyD) {
origin += camera.local_x().as_vec3();
}
if input.pressed(KeyCode::KeyA) {
origin -= camera.local_x().as_vec3();
}
if input.pressed(KeyCode::KeyE) {
origin += camera.local_y().as_vec3();
}
if input.pressed(KeyCode::KeyQ) {
origin -= camera.local_y().as_vec3();
}
let relative_face = Transform::IDENTITY
.looking_to(window.camera_normal(), Vec3::Y)
.rotation
* face.0;
camera.translation = origin;
camera.translation = window.camera_position() + relative_face;
camera.look_at(window.center(), Vec3::Y);
}
src/face_detection.rs
+282
-0
diff --git a/src/face_detection.rs b/src/face_detection.rs
new file mode 100644
index 0000000..dff117c
@@ -0,0 +1,282 @@
use async_channel::{Receiver, RecvError, Sender, TryRecvError};
use bevy::{
app::{App, Plugin, PreUpdate, Startup},
ecs::{
message::Message,
resource::Resource,
system::{Commands, ResMut},
},
log,
math::Vec3,
tasks::ComputeTaskPool,
};
use nokhwa::{
Buffer, Camera, nokhwa_initialize,
pixel_format::RgbFormat,
utils::{CameraIndex, RequestedFormat, RequestedFormatType, Resolution},
};
use ort::{
inputs,
session::{Session, SessionOutputs},
value::Tensor,
};
pub struct FaceDetectionPlugin;
impl Plugin for FaceDetectionPlugin {
fn build(&self, app: &mut App) {
app.add_message::<FaceMoved>()
.add_systems(Startup, setup_face_detection)
.add_systems(PreUpdate, publish_face_moved);
}
}
#[derive(Message)]
pub struct FaceMoved(pub Vec3);
#[derive(Resource)]
struct FaceDetectionReader(Receiver<Vec3>);
fn setup_face_detection(mut commands: Commands) {
let (frame_sender, frame_receiver) = async_channel::unbounded();
let (face_sender, face_receiver) = async_channel::unbounded();
ComputeTaskPool::get()
.spawn(camera_loop(frame_sender))
.detach();
ComputeTaskPool::get()
.spawn(detection_loop(frame_receiver, face_sender))
.detach();
commands.insert_resource(FaceDetectionReader(face_receiver));
}
async fn camera_loop(sender: Sender<Buffer>) {
{
let (init_sender, init_receiver) = async_channel::unbounded();
nokhwa_initialize(move |success| {
if let Err(err) = init_sender.send_blocking(success) {
log::error!("Could not send nokhwa initialization ({success}): {err}");
}
});
match init_receiver.recv().await {
Ok(true) => {}
Ok(false) => {
log::error!("nokhwa failed to initialize");
return;
}
Err(err) => {
log::error!("nokhwa failed to initialize: {err}");
return;
}
}
}
let format = RequestedFormat::new::<RgbFormat>(RequestedFormatType::None);
let mut camera = match Camera::new(CameraIndex::Index(1), format) {
Ok(camera) => camera,
Err(err) => {
log::error!("Failed to create camera: {err}");
return;
}
};
if let Err(err) = camera.open_stream() {
log::error!("Failed to open camera stream: {err}");
return;
}
loop {
let frame = match camera.frame() {
Ok(frame) => frame,
Err(err) => {
log::error!("Could not get frame: {err}");
return;
}
};
if let Err(err) = sender.send(frame).await {
log::error!("Could not send frame to face thread: {err}");
return;
}
}
}
async fn detection_loop(mut receiver: Receiver<Buffer>, sender: Sender<Vec3>) {
let mut model = match Session::builder().and_then(|mut b| {
b.commit_from_file("face_detection_yunet_2026may.onnx")
}) {
Ok(session) => session,
Err(err) => {
log::error!("Could not build ONNX session: {err}");
return;
}
};
loop {
let frame = match recv_latest(&mut receiver).await {
Ok(frame) => frame,
Err(err) => {
log::error!("Could not get frame from camera thread: {err}");
return;
}
};
let resolution = frame.resolution();
let resolution = Resolution::new(
resolution.width().div_ceil(32) * 32,
resolution.height().div_ceil(32) * 32,
);
let image = match frame.decode_image::<RgbFormat>() {
Ok(image) => image,
Err(err) => {
log::error!("Could not decode image: {err}");
return;
}
};
let mut tensor = match Tensor::from_array((
[
1,
3,
resolution.height() as usize,
resolution.width() as usize,
],
vec![0.0_f32; 1 * 3 * (resolution.height() * resolution.width()) as usize],
)) {
Ok(tensor) => tensor,
Err(err) => {
log::warn!("Could not create tensor: {err}");
continue;
}
};
for (y, row) in image.rows().enumerate() {
for (x, pixel) in row.enumerate() {
tensor[[0, 2, y as i64, x as i64]] = pixel[0] as f32;
tensor[[0, 1, y as i64, x as i64]] = pixel[1] as f32;
tensor[[0, 0, y as i64, x as i64]] = pixel[2] as f32;
}
}
let outputs = match model.run(inputs!["input" => &tensor]) {
Ok(output) => output,
Err(err) => {
log::error!("Model did not run to completion: {err}");
return;
}
};
let Some(face) = get_face_position(&outputs, &resolution, 32)
.or_else(|| get_face_position(&outputs, &resolution, 16))
.or_else(|| get_face_position(&outputs, &resolution, 8))
else {
log::info!("No face detected in frame");
continue;
};
if let Err(err) = sender.send(face).await {
log::warn!("Could not send face position: {err}");
}
}
}
const THRESHOLD: f32 = 0.75;
fn get_face_position(
outputs: &SessionOutputs,
resolution: &Resolution,
stride: usize,
) -> Option<Vec3> {
let cls = outputs.get(format!("cls_{stride}"))?;
let obj = outputs.get(format!("obj_{stride}"))?;
let (cls_shape, cls) = match cls.try_extract_tensor::<f32>() {
Ok(cls) => cls,
Err(err) => {
log::warn!("cls data is not a float tensor: {err}");
return None;
}
};
let (obj_shape, obj) = match obj.try_extract_tensor::<f32>() {
Ok(obj) => obj,
Err(err) => {
log::warn!("obj data is not a float tensor: {err}");
return None;
}
};
if cls_shape.len() != 3 || obj_shape.len() != 3 || cls_shape[1] != obj_shape[1] {
log::warn!("Result cls and obj is on wrong format: {cls_shape} and {obj_shape}");
return None;
}
let (max_i, max_score) = cls
.iter()
.zip(obj.iter())
.enumerate()
.map(|(i, (cls, obj))| (i, (cls.clamp(0.0, 1.0) * obj.clamp(0.0, 1.0)).sqrt()))
.filter(|(_, s)| s.is_finite())
.max_by(|(_, a), (_, b)| a.total_cmp(b))?;
if max_score < THRESHOLD {
log::info!("No face above threshold");
return None;
}
let bbox = outputs.get(format!("bbox_{stride}"))?;
let (bbox_shape, bbox) = match bbox.try_extract_tensor::<f32>() {
Ok(bbox) => bbox,
Err(err) => {
log::warn!("bbox is not a float tensor: {err}");
return None;
}
};
if bbox_shape.len() != 3 || bbox_shape[1] <= max_i as i64 || bbox_shape[2] != 4 {
log::warn!("Result bbox is on the wrong format: {bbox_shape}");
return None;
}
let s = stride as f32;
let cols = (resolution.width().div_ceil(32) * 32) as usize / stride;
let (col, row) = ((max_i % cols) as f32, (max_i / cols) as f32);
let x_pixels = (col + bbox[max_i * 4 + 0]) * s;
let y_pixels = (row + bbox[max_i * 4 + 1]) * s;
let width_pixels = bbox[max_i * 4 + 2].exp() * s;
const HFOV_DEG: f32 = 60.0;
const FACE_WIDTH_METERS: f32 = 0.2;
let (w, h) = (resolution.width() as f32, resolution.height() as f32);
let f = (w / 2.0) / (HFOV_DEG.to_radians() / 2.0).tan();
let z = f * FACE_WIDTH_METERS / width_pixels;
let pos = Vec3::new(
(x_pixels - w / 2.0) * z / f,
-(y_pixels - h / 2.0) * z / f,
-z,
);
Some(pos)
}
fn publish_face_moved(
mut commands: Commands,
mut face_detection_reader: ResMut<FaceDetectionReader>,
) {
let Ok(face) = try_recv_latest(&mut face_detection_reader.0) else {
return;
};
commands.write_message(FaceMoved(face));
}
async fn recv_latest<T>(receiver: &mut Receiver<T>) -> Result<T, RecvError> {
match try_recv_latest(receiver) {
Ok(msg) => Ok(msg),
Err(TryRecvError::Closed) => Err(RecvError),
Err(TryRecvError::Empty) => receiver.recv().await,
}
}
fn try_recv_latest<T>(receiver: &mut Receiver<T>) -> Result<T, TryRecvError> {
receiver.try_recv().map(|mut msg| {
while let Ok(next) = receiver.try_recv() {
msg = next;
}
msg
})
}
src/main.rs
+8
-1
diff --git a/src/main.rs b/src/main.rs
index 7115793..3c51eec 100644
@@ -1,4 +1,5 @@
mod camera_controller;
mod face_detection;
mod physical_monitor;
mod virtual_window;
@@ -25,12 +26,18 @@ use bevy::{
use crate::{
camera_controller::CameraControllerPlugin,
face_detection::FaceDetectionPlugin,
virtual_window::{VirtualWindow, VirtualWindowPlugin},
};
fn main() {
App::new()
.add_plugins((DefaultPlugins, CameraControllerPlugin, VirtualWindowPlugin))
.add_plugins((
DefaultPlugins,
CameraControllerPlugin,
VirtualWindowPlugin,
FaceDetectionPlugin,
))
.add_systems(Startup, setup)
.add_systems(Update, load_skybox)
.run();
src/virtual_window.rs
+0
-9
diff --git a/src/virtual_window.rs b/src/virtual_window.rs
index c7b5a8d..2b94e9a 100644
@@ -138,14 +138,5 @@ fn update_window(
virtual_window.center = virtual_window.camera_position + window_offset_in_meters;
virtual_window.previous_cache_key = cache_key;
log::info!(
"Camera: {}; Window: {}; posY: {}; sizeH: {:?}; offsetY: {}; pixels/meter: {}",
virtual_window.camera_position,
virtual_window.center,
position_in_pixels.y,
(size_in_pixels.height, monitor_size_in_pixels.y),
window_offset_in_meters.y,
meters_per_pixel,
);
}
}