{"id":50418772,"url":"https://github.com/developer0hye/yolo26-rust-wasm","last_synced_at":"2026-05-31T07:05:02.381Z","repository":{"id":344340675,"uuid":"1180696454","full_name":"developer0hye/yolo26-rust-wasm","owner":"developer0hye","description":"Browser-based YOLO26 object detection powered by Rust + candle + WebAssembly","archived":false,"fork":false,"pushed_at":"2026-03-14T16:23:33.000Z","size":8913,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-14T17:37:00.486Z","etag":null,"topics":["detection","object-detection","rust","wasm","yolo","yolo26"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/developer0hye.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-03-13T10:07:23.000Z","updated_at":"2026-03-14T16:23:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/developer0hye/yolo26-rust-wasm","commit_stats":null,"previous_names":["developer0hye/yolo26-rust-wasm"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/developer0hye/yolo26-rust-wasm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer0hye%2Fyolo26-rust-wasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer0hye%2Fyolo26-rust-wasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer0hye%2Fyolo26-rust-wasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer0hye%2Fyolo26-rust-wasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developer0hye","download_url":"https://codeload.github.com/developer0hye/yolo26-rust-wasm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer0hye%2Fyolo26-rust-wasm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33722189,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["detection","object-detection","rust","wasm","yolo","yolo26"],"created_at":"2026-05-31T07:05:01.718Z","updated_at":"2026-05-31T07:05:02.375Z","avatar_url":"https://github.com/developer0hye.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YOLO26 Rust WASM\n\nReal-time object detection running entirely in the browser — no server, no upload, no API calls. All YOLO26 model scales (n/s/m/l/x) are implemented natively in Rust using [candle](https://github.com/huggingface/candle) and compiled to WebAssembly.\n\n**[Live Demo on Hugging Face Spaces](https://huggingface.co/spaces/developer0hye/candle-yolo26)**\n\n![Demo](assets/demo.png)\n\n## Why This Exists\n\nMost browser-based ML demos rely on ONNX Runtime or TensorFlow.js. This project takes a different approach: the entire YOLO26 architecture is implemented from scratch in Rust and compiled to WASM. Every layer — convolutions, batch norm, attention, detect head — runs as native Rust code in the browser.\n\nThis means:\n\n- **Zero server dependency** — inference happens on the client. No data leaves the browser.\n- **No runtime framework** — no ONNX, no TF.js. Just Rust → WASM → Canvas.\n- **Portable** — one `.wasm` binary + SafeTensors weights. Works anywhere WebAssembly runs.\n\n## Features\n\n- All YOLO26 scales (n/s/m/l/x) natively implemented in Rust\n- In-browser model selector for switching between scales\n- FP16 SafeTensors weights (auto-converted to FP32 at load time — zero accuracy loss)\n- WASM SIMD128 acceleration for vectorized matrix operations\n- Web Worker inference (non-blocking UI)\n- EXIF-aware image handling for correct orientation\n- Confidence threshold slider (filters without re-running inference)\n- Click-to-zoom full resolution view\n- Responsive viewport-fit layout\n- 36 unit tests covering all building blocks and full pipeline\n\n## Architecture\n\n```\nBrowser (Next.js + Web Worker)\n  │ File → createImageBitmap (EXIF-normalized)\n  │ → Canvas → RGBA pixels\n  ▼\nRust WASM Module (candle)\n  ├── preprocess.rs    → Bilinear resize, letterbox 640×640, normalize, HWC→CHW\n  ├── model/\n  │   ├── config.rs    → ModelScale (n/s/m/l/x) channel/repeat scaling\n  │   ├── backbone.rs  → Conv, C3k2, SPPF, C2PSA (layers 0-10)\n  │   ├── neck.rs      → FPN-PAN feature fusion (layers 11-22)\n  │   └── head.rs      → Detect: end2end, topk-300, NMS-free (layer 23)\n  └── postprocess.rs   → [1,300,6] → coord transform → JSON\n  ▼\nCanvas 2D (bounding boxes + labels)\n```\n\n## Prerequisites\n\n- Rust (stable) with `wasm32-unknown-unknown` target\n- `wasm-pack`: `cargo install wasm-pack`\n- Node.js 18+ (for the web app)\n- Python 3 + `ultralytics` + `safetensors` (for model export only)\n\n## Quick Start\n\n### 1. Export Model Weights\n\n```bash\npip install ultralytics safetensors\npython scripts/export_all_sizes.py\n```\n\nExports all 5 scales as FP16 SafeTensors (~240 MB total):\n\n| Model | Params | Weights |\n|-------|--------|---------|\n| yolo26n | 2.6M | 5 MB |\n| yolo26s | 10.0M | 20 MB |\n| yolo26m | 21.9M | 44 MB |\n| yolo26l | 26.3M | 53 MB |\n| yolo26x | 59.0M | 118 MB |\n\n### 2. Build WASM\n\n```bash\nwasm-pack build --target web --out-dir web/public/wasm\n```\n\nSIMD is enabled automatically via `.cargo/config.toml`.\n\n### 3. Run Web App\n\n```bash\nmkdir -p web/public/weights\ncp yolo26*.safetensors web/public/weights/\ncd web\nnpm install \u0026\u0026 npm run dev\n```\n\nOpen http://localhost:3000.\n\n## WASM API\n\n```rust\n// Load SafeTensors model with scale identifier\ninit_model(weights: \u0026[u8], model_name: \u0026str) -\u003e Result\u003c(), JsValue\u003e\n// model_name: \"yolo26n\", \"yolo26s\", \"yolo26m\", \"yolo26l\", or \"yolo26x\"\n\n// Run detection on RGBA pixels\ndetect(pixels: \u0026[u8], width: u32, height: u32, confidence_threshold: f32) -\u003e Result\u003cString, JsValue\u003e\n```\n\n## Testing\n\n```bash\ncargo test\n```\n\n49 tests covering preprocessing, postprocessing, all building blocks (ConvBlock, Bottleneck, C3k2, C3k, SPPF, C2PSA, Attention), model scaling config, backbone, neck, detect head, and full pipeline across multiple scales.\n\n## Acknowledgments\n\nThe YOLO26 architecture is designed by [Ultralytics](https://github.com/ultralytics/ultralytics). Their consistent work on pushing real-time object detection forward — from YOLOv5 through YOLO26 — makes projects like this possible. Model weights are exported from the official Ultralytics package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloper0hye%2Fyolo26-rust-wasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeveloper0hye%2Fyolo26-rust-wasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloper0hye%2Fyolo26-rust-wasm/lists"}