Skip to content

Commit

Permalink
Support WebGPU (#110)
Browse files Browse the repository at this point in the history
Added support for using WebGPU via onnx-runtime.
  • Loading branch information
DanielHauschildt authored May 10, 2024
1 parent 4306d99 commit e1c2588
Show file tree
Hide file tree
Showing 77 changed files with 2,491 additions and 18,616 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [19.x, 20.x, 21.x]
node-version: [21.x]
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Install cargo and wasm-pack
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
export PATH="$HOME/.cargo/bin:$PATH"
cargo install wasm-pack clippy
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run lint:check --if-present
- run: npm run build --if-present
- run: npm test
- run: npm run test --if-present
- run: npm run package:pack --if-present
# - uses: actions/upload-artifact@v4
# with:
# name: my-artifact
# path: releases/
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run lint:fix
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.13.1
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
build
**/package-lock.json
.vscode/
**/public/
**/public/**
CHANGELOG.md
30 changes: 5 additions & 25 deletions TODOS.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,12 @@
# Todos

- [ ] Create release script
## Todo 2.0

- [ ] Update Version number
- [ ] Move changelog to this version folder
- [ ] Publish on npm
- [ ] Publish to cdn
- [ ] Replace aws cli was aws sdk

- [ ] Provide typescript bindings
- [x] Provide access to filesystem for nodejs version
- [ ] Update build script to external dependencies from `package.json`
- [ ] use logger callback instead of `console.log`
```
logger: (level, message: string, args...) => void
```
- [ ] use logger/telemetry callback instead of custom debug output
- [ ] use resolver callback instead of publicPath as such we can allow various
```
resolve: (path: string) => Response
```
- [ ] use decode callback to allow different types of image decoders
```
decode: (buffer: Uint8Array, mimetype: string) => Uint8Array
```
- [ ] use encode callback to allow differnt types of image encoders

```
encode: (buffer: Uint8Array, mimetype: string) => Uint8Array
```

- [ ] use zod to check each api endpoint and not just the config. This will allow checking the input and the output
- [ ] default to `gpu`
- [ ] remove image encode and decode
- [ ] removebg should get `ImageData` and return raw `ImageData`
3 changes: 3 additions & 0 deletions bundle/models/isnet
Git LFS file not shown
3 changes: 3 additions & 0 deletions bundle/models/isnet.json
Git LFS file not shown
3 changes: 3 additions & 0 deletions bundle/models/isnet_fp16
Git LFS file not shown
3 changes: 3 additions & 0 deletions bundle/models/isnet_quint8
Git LFS file not shown
3 changes: 0 additions & 3 deletions bundle/models/large

This file was deleted.

3 changes: 0 additions & 3 deletions bundle/models/medium

This file was deleted.

3 changes: 3 additions & 0 deletions bundle/models/modnet
Git LFS file not shown
3 changes: 3 additions & 0 deletions bundle/models/modnet_fp16
Git LFS file not shown
3 changes: 0 additions & 3 deletions bundle/models/small

This file was deleted.

3 changes: 3 additions & 0 deletions bundle/models/vitmatte_s
Git LFS file not shown
Loading

0 comments on commit e1c2588

Please sign in to comment.