{"id":13445331,"url":"https://github.com/nihui/ncnn-webassembly-yolov5","last_synced_at":"2025-08-21T10:31:15.391Z","repository":{"id":39919331,"uuid":"314200091","full_name":"nihui/ncnn-webassembly-yolov5","owner":"nihui","description":"Deploy YOLOv5 in your web browser with ncnn and webassembly","archived":false,"fork":false,"pushed_at":"2023-02-27T03:42:58.000Z","size":8453,"stargazers_count":143,"open_issues_count":10,"forks_count":31,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-10T08:42:28.735Z","etag":null,"topics":["artificial-intelligence","chrome","cross-platform","edge","firefox","ncnn","neural-network","object-detection","webassembly","yolov5"],"latest_commit_sha":null,"homepage":"https://nihui.github.io/ncnn-webassembly-yolov5/","language":"C++","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/nihui.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}},"created_at":"2020-11-19T09:35:51.000Z","updated_at":"2024-12-10T03:33:36.000Z","dependencies_parsed_at":"2024-01-14T12:28:06.427Z","dependency_job_id":null,"html_url":"https://github.com/nihui/ncnn-webassembly-yolov5","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nihui%2Fncnn-webassembly-yolov5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nihui%2Fncnn-webassembly-yolov5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nihui%2Fncnn-webassembly-yolov5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nihui%2Fncnn-webassembly-yolov5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nihui","download_url":"https://codeload.github.com/nihui/ncnn-webassembly-yolov5/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230507051,"owners_count":18236944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["artificial-intelligence","chrome","cross-platform","edge","firefox","ncnn","neural-network","object-detection","webassembly","yolov5"],"created_at":"2024-07-31T05:00:31.001Z","updated_at":"2024-12-19T22:08:10.276Z","avatar_url":"https://github.com/nihui.png","language":"C++","funding_links":[],"categories":["Other Versions of YOLO","Application projects"],"sub_categories":["Wasm"],"readme":"# ncnn-webassembly-yolov5\n\nopen https://nihui.github.io/ncnn-webassembly-yolov5 and enjoy\n\n\n# build and deploy\n\nPrior to starting, make sure you have `cmake` installed.\n\n1. Clone the project - all other steps are to be performed inside the project directory.\n\n```\ngit clone https://github.com/nihui/ncnn-webassembly-yolov5.git\ncd ncnn-webassembly-yolov5\n\n```\n\n2. Install emscripten\n```shell\ngit clone https://github.com/emscripten-core/emsdk.git\ncd emsdk\n./emsdk install 3.1.28\n./emsdk activate 3.1.28\n\nsource emsdk_env.sh\n```\n\n3. Download and extract ncnn webassembly package\n```shell\ncd .. #Return to the root folder\nwget https://github.com/Tencent/ncnn/releases/download/20230223/ncnn-20230223-webassembly.zip\nunzip ncnn-20230223-webassembly.zip\n```\n\n4. Build four WASM feature variants\n```shell\n# The build folder is part of the bundle extracted in the previous step\ncd build \ncmake -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DWASM_FEATURE=basic ..\nmake -j4\ncmake -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DWASM_FEATURE=simd ..\nmake -j4\ncmake -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DWASM_FEATURE=threads ..\nmake -j4\ncmake -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DWASM_FEATURE=simd-threads ..\nmake -j4\n```\n\n5. Deploy the *.data *.js *.wasm and *.html files to your web server\n\nIf you want to run this locally, create a folder named `deploy` in the root project directory and copy the following assets into it:\n\n```\n# deploy files\ndeploy/\n├── index.html\n├── yolov5-basic.data\n├── yolov5-basic.js\n├── yolov5-basic.wasm\n├── yolov5-simd.data\n├── yolov5-simd.js\n├── yolov5-simd-threads.data\n├── yolov5-simd-threads.js\n├── yolov5-simd-threads.wasm\n├── yolov5-simd-threads.worker.js\n├── yolov5-simd.wasm\n├── yolov5-threads.data\n├── yolov5-threads.js\n├── yolov5-threads.wasm\n├── yolov5-threads.worker.js\n└── wasmFeatureDetect.js\n```\n6. Deploy local server(python3 as a example)\n```\npython3 -m http.server --directory deploy\n```\n\n7. Access local server(chrome as a example)\n```\n# launch chrome browser, enter following command to address bar and press ENTER: \nchrome://flags/#unsafely-treat-insecure-origin-as-secure\n\n# enter following keyword to \"Search flags\" and press ENTER:\n\"insecure origins\"\nyou will find \"Insecure origins treated as secure\" key\n\n#enter local server url and click right side dropdown list, select \"Enabled\"\nurl example: http://192.168.1.100:8000\n\n#relaunch chrome browser and access http://192.168.1.100:8000 (replace 192.168.1.100 with your local ip)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnihui%2Fncnn-webassembly-yolov5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnihui%2Fncnn-webassembly-yolov5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnihui%2Fncnn-webassembly-yolov5/lists"}