GithubHelp home page GithubHelp logo

talkuhulk / aidb-webassembly-demo Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 65.58 MB

ai.deploy.box webassembly demo

Home Page: https://www.hulk.show/aidb-webassembly-demo/

CSS 26.60% HTML 71.62% Python 1.77%
ncnn wasm webassembly yolov7 movenet pfld scrfd yolov8 yolox 3ddfa

aidb-webassembly-demo's Introduction

aidb-webassembly-demo

๐ŸถTry Demo

build and deploy

Prior to starting, make sure you have cmake installed.

    1. Clone ai.deploy.box
https://github.com/TalkUHulk/ai.deploy.box.git
cd ai.deploy.box
mkdir build && cd build
    1. Install emscripten
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest

source emsdk_env.sh
    1. Build
cmake .. -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DWASM_FEATURE=basic -DENGINE_NCNN_WASM=ON -DENGINE_MNN=OFF -DENGINE_ORT=OFF -DENGINE_NCNN=OFF -DENGINE_TNN=OFF -DENGINE_OPV=OFF -DENGINE_PPLite=OFF
make -j4

cmake .. -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DWASM_FEATURE=simd -DENGINE_NCNN_WASM=ON -DENGINE_MNN=OFF -DENGINE_ORT=OFF -DENGINE_NCNN=OFF -DENGINE_TNN=OFF -DENGINE_OPV=OFF -DENGINE_PPLite=OFF
make -j4

cmake .. -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DWASM_FEATURE=threads -DENGINE_NCNN_WASM=ON -DENGINE_MNN=OFF -DENGINE_ORT=OFF -DENGINE_NCNN=OFF -DENGINE_TNN=OFF -DENGINE_OPV=OFF -DENGINE_PPLite=OFF
make -j4

cmake .. -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DWASM_FEATURE=simd-threads -DENGINE_NCNN_WASM=ON -DENGINE_MNN=OFF -DENGINE_ORT=OFF -DENGINE_NCNN=OFF -DENGINE_TNN=OFF -DENGINE_OPV=OFF -DENGINE_PPLite=OFF
make -j4
    1. Deploy

Clone the project, create a folder named aidb in the root project directory and copy the following files into it:

# deploy files
aidb/
โ”œโ”€โ”€ aidb-wasm-basic.js
โ”œโ”€โ”€ aidb-wasm-basic.wasm
โ”œโ”€โ”€ aidb-wasm-simd.js
โ”œโ”€โ”€ aidb-wasm-simd-threads.js
โ”œโ”€โ”€ aidb-wasm-simd-threads.wasm
โ”œโ”€โ”€ aidb-wasm-simd-threads.worker.js
โ”œโ”€โ”€ aidb-wasm-simd.wasm
โ”œโ”€โ”€ aidb-wasm-threads.js
โ”œโ”€โ”€ aidb-wasm-threads.wasm
โ””โ”€โ”€ aidb-wasm-threads.worker.js

Run local server:

python3 server.py
    1. Access local server(chrome as a example)
# launch chrome browser, enter following command to address bar and press ENTER:
chrome://flags/#unsafely-treat-insecure-origin-as-secure

# enter following keyword to "Search flags" and press ENTER:
"insecure origins"
you will find "Insecure origins treated as secure" key

#enter local server url and click right side dropdown list, select "Enabled"
url example: http://localhost:12580

#relaunch chrome browser and access http://localhost:12580.

Reference

ๆ„Ÿ่ฐขnihuiๅคงไฝฌ๏ฝž

่ท‘ๅœจๆต่งˆๅ™จ้‡Œ็š„ncnnๅ’Œwebassembly

ncnn-webassembly-aidb-wasm

aidb-webassembly-demo's People

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.