Skip to content

Commit 7e9f102

Browse files
committed
update 1.1.3
1 parent f6bfa64 commit 7e9f102

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

dist/webai.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webai-js",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"description": "A simple Web AI model deployment tool using JavaScript",
55
"main": "./src/webai.js",
66
"unpkg": "./dist/webai.min.js",

src/webai.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ class Seg extends CV {
277277
for (let j = 0; j < C; j++) {
278278
tmp.push(pixelArrs[j][i])
279279
}
280-
index = WebAI.gray(tmp)
280+
index = WebAI.argmax(tmp)
281281
gray.push(index)
282282
colorRGBA.push(...this.colorMap[index].color)
283283
}
@@ -303,7 +303,7 @@ class Seg extends CV {
303303
}
304304

305305
class WebAI {
306-
static gray(arr) {
306+
static argmax(arr) {
307307
let max = Math.max.apply(null, arr);
308308
let index = arr.findIndex(
309309
function (value) {
@@ -464,8 +464,8 @@ class WebAI {
464464

465465
static waitForOpenCV() {
466466
return new Promise(resolve => {
467-
if (typeof cv.onRuntimeInitialized == 'undefined'){
468-
resolve(cv.onRuntimeInitialized)
467+
if (typeof cv.onRuntimeInitialized == 'undefined') {
468+
resolve(cv.onRuntimeInitialized)
469469
}
470470
else {
471471
resolve(true)

0 commit comments

Comments
 (0)