Repository: PaddlePaddle/Paddle.js (language: python)

Issue:
chore(examples): update clas game wx mini program



Discussion / hints:

Fix patch:
diff --git a/packages/paddlejs-backend-webgl/package-lock.json b/packages/paddlejs-backend-webgl/package-lock.json
index b417c2c9..0deb85d7 100644
--- a/packages/paddlejs-backend-webgl/package-lock.json
+++ b/packages/paddlejs-backend-webgl/package-lock.json
@@ -1,6 +1,6 @@
 {
   "name": "paddlejs-backend-webgl",
-  "version": "1.1.19",
+  "version": "1.2.0",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
diff --git a/packages/paddlejs-backend-webgl/package.json b/packages/paddlejs-backend-webgl/package.json
index 9102ee73..80723b3a 100644
--- a/packages/paddlejs-backend-webgl/package.json
+++ b/packages/paddlejs-backend-webgl/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@paddlejs/paddlejs-backend-webgl",
-  "version": "1.1.19",
+  "version": "1.2.0",
   "description": "",
   "main": "lib/index",
   "scripts": {
diff --git a/packages/paddlejs-backend-webgl/src/ops/shader/custom/imgFeed.ts b/packages/paddlejs-backend-webgl/src/ops/shader/custom/imgFeed.ts
index c73a9e61..800e2fa6 100644
--- a/packages/paddlejs-backend-webgl/src/ops/shader/custom/imgFeed.ts
+++ b/packages/paddlejs-backend-webgl/src/ops/shader/custom/imgFeed.ts
@@ -5,19 +5,29 @@
 function mainFunc() {
     return `
     uniform vec2 u_scale;
+    uniform float u_keep_ratio;
+
     void main(void) {
         vec2 outCoord = vCoord.xy;
-        vec2 newPos = vCoord / u_scale;
-        vec2 startPos = (1.0 / u_scale - 1.0) / 2.0;
-        bool exceedX = u_scale.y == 1.0 && (newPos.x < startPos.x || newPos.x > (1.0 + startPos.x));
-        bool exceedY = u_scale.x == 1.0 && (newPos.y < startPos.y || newPos.y > (1.0 + startPos.y));
-        if (exceedX || exceedY) {
-            setPackedOutput(vec4(1.0, 1.0, 1.0, 1.0));
+        // 支持模型不按比例拉伸
+        if (float(u_keep_ratio) == 0.0) {
+            vec4 origin = TEXTURE2D(texture_origin, outCoord);
+            setPackedOutput(origin);
             return;
         }
-        newPos = newPos - startPos;
-        vec4 counter = TEXTURE2D(texture_origin, newPos);
-        setPackedOutput(counter);
+        float startX = (1.0 - u_scale.x) / 2.0;
+        float endX = startX + u_scale.x;
+        float startY = (1.0 - u_scale.y) / 2.0;
+        float endY = startY + u_scale.y;
+
+        if (outCoord.x >= startX && outCoord.x <= endX && outCoord.y >= startY && outCoord.y <= endY) {
+            vec2 newPos = (outCoord - vec2(startX, startY)) / u_scale;
+            vec4 origin = TEXTURE2D(texture_origin, newPos);
+            setPackedOutput(origin);
+        }
+        else {
+            setPackedOutput(vec4(1.0, 1.0, 1.0, 1.0));
+        }
     }
     `;
 }
diff --git a/packages/paddlejs-backend-webgl/src/webgl/WebGLUtils.ts b/packages/paddlejs-backend-webgl/src/webgl/WebGLUtils.ts
index fd8bbc8c..35c86eb8 100644
--- a/packages/paddlejs-backend-webgl/src/webgl/WebGLUtils.ts
+++ b/packages/paddlejs-backend-webgl/src/webgl/WebGLUtils.ts
@@ -407,6 +407,12 @@ export class GLHelper {
         const {
             shape = []
         } = tensor;
+
+        const [n, c, h, w] = shape;
+        if (n * h <= GL_TEXTURE_MAX_SIZE && c * w <=  GL_TEXTURE_MAX_SIZE) {
+            tensor.shape_texture = [n * h, c * w];
+            return;
+        }
         const [smallest, sec, third, biggest] = [...shape].sort((prev, cur) => prev - cur);
         let texW = smallest * biggest;
         let texH = sec * third;
diff --git a/packages/paddlejs-core/package.json b/packages/paddlejs-core/package.json
index c51c65f3..8aee45f6 100644
--- a/packages/paddlejs-core/package.json
+++ b/packages/paddlejs-core/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@paddlejs/paddlejs-core",
-  "version": "2.1.17",
+  "version": "2.1.18",
   "description": "",
   "main": "lib/index",
   "scripts": {
diff --git a/packages/paddlejs-core/src/runner.ts b/packages/paddlejs-core/src/runner.ts
index 5ae9b2a0..d8b8365a 100644
--- a/packages/paddlejs-core/src/runner.ts
+++ b/packages/paddlejs-core/src/runner.ts
@@ -142,7 +142,6 @@ export default class Runner {
         if (this.isPaused || !this.mediaProcessor) {
             return;
         }
-
         let inputFeed = [];
         if (this.runnerConfig.webglFeedProcess) {
             inputFeed = [media];
@@ -280,8 +279,11 @@ export default class Runner {
         );
         imageInputTensor.data = feed.data;
 
-        // todo
-        if (this.runnerConfig.webglFeedProcess || env.get('webgl_gpu_pipeline')) {
+        const {
+            webglFeedProcess = false,
+            keepRatio = false
+        } = this.runnerConfig;
+        if (webglFeedProcess || env.get('webgl_gpu_pipeline')) {
             // support imageDataLike feed which has unit8ClampedArray data and width + height or shape
             // support ImageElementLike feed which is HTMLImageElement or HTMLVideoElement or HTMLCanvasElement
             let shape = feed.shape || [1, 1, feed.height, feed.width];
@@ -305,6 +307,7 @@ export default class Runner {
             const [dh, dw] = imageOpData.outputTensors[0].shape.slice(-2);
             const scale = this.mediaProcessor.cover(w, h, dw, dh);
             imageOp.uniform.u_scale.value = scale;
+            imageOp.uniform.u_keep_ratio.value = +keepRatio;
         }
 
     }
diff --git a/packages/paddlejs-core/src/transform/feedProcess.ts b/packages/paddlejs-core/src/transform/feedProcess.ts
index 9e6a5c9c..9ba0ab2a 100644
--- a/packages/paddlejs-core/src/transform/feedProcess.ts
+++ b/packages/paddlejs-core/src/transform/feedProcess.ts
@@ -95,6 +95,10 @@ export default class WebglFeedProcess extends Transformer {
                 u_pos: {
                     type: UniformType.uniform2fv,
                     value: [0, 0]
+                },
+                u_keep_ratio: {
+                    type: UniformType.uniform1f,
+                    value: 0
                 }
             },
             isPacked: true
diff --git a/packages/paddlejs-examples/clasGame/config.js b/packages/paddlejs-examples/clasGame/config.js
index fceb54cf..abab0506 100644
--- a/packages/paddlejs-examples/clasGame/config.js
+++ b/packages/paddlejs-examples/clasGame/config.js
@@ -1,8 +1,7 @@
 export const CONFIG = {
     config: {
         modelInfo: {
-            path: 'https://mms-voice-fe.cdn.bcebos.com/pdmodel/clas/common/v4_2_0915',
-            fileCount: 1,
+            path: 'https://mms-voice-fe.cdn.bcebos.com/pdmodel/clas/fuse/v4_03082014',
             mean: [
                 0.485,
                 0.456,
diff --git a/packages/paddlejs-examples/clasGame/package-lock.json b/packages/paddlejs-examples/clasGame/package-lock.json
new file mode 100644
index 00000000..d3cfc85d
--- /dev/null
+++ b/packages/paddlejs-examples/clasGame/package-lock.json
@@ -0,0 +1,18 @@
+{
+  "name": "clas",
+  "version": "1.0.0",
+  "lockfileVersion": 1,
+  "requires": true,
+  "dependencies": {
+    "@paddlejs/paddlejs-backend-webgl": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/@paddlejs/paddlejs-backend-webgl/-/paddlejs-backend-webgl-1.2.0.tgz",
+      "integrity": "sha512-bKJKJkGldC3NPOuJyk+372z0XW1dd1D9lR0f9OHqWQboY0Mkah+gX+8tkerrNg+QjYz88IW0iJaRKB0jm+6d9g=="
+    },
+    "@paddlejs/paddlejs-core": {
+      "version": "2.1.18",
+      "resolved": "https://registry.npmjs.org/@paddlejs/paddlejs-core/-/paddlejs-core-2.1.18.tgz",
+      "integrity": "sha512-QrXxwaHm4llp1sxbUq/oCCqlYx4ciXanBn/Lfq09UqR4zkYi5SptacQlIxgJ70HOO6RWIxjWN4liQckMwa2TkA=="
+    }
+  }
+}
diff --git a/packages/paddlejs-examples/clasGame/package.json b/packages/paddlejs-examples/clasGame/package.json
index 8eb6d200..2877e3de 100644
--- a/packages/paddlejs-examples/clasGame/package.json
+++ b/packages/paddlejs-examples/clasGame/package.json
@@ -12,7 +12,7 @@
   "author": "",
   "license": "ISC",
   "dependencies": {
-    "@paddlejs/paddlejs-backend-webgl": "^1.0.7",
-    "@paddlejs/paddlejs-core": "^2.0.7"
+    "@paddlejs/paddlejs-backend-webgl": "^1.2.0",
+    "@paddlejs/paddlejs-core": "^2.1.18"
   }
 }
diff --git a/packages/paddlejs-examples/clasGame/project.config.json b/packages/paddlejs-examples/clasGame/project.config.json
index 3b64f84b..22869a9b 100644
--- a/packages/paddlejs-examples/clasGame/project.config.json
+++ b/packages/paddlejs-examples/clasGame/project.config.json
@@ -1,83 +1,86 @@
 {
-    "description": "项目配置文件",
-    "packOptions": {
-        "ignore": []
+  "description": "项目配置文件",
+  "packOptions": {
+    "ignore": []
+  },
+  "setting": {
+    "urlCheck": true,
+    "es6": true,
+    "enhance": true,
+    "postcss": true,
+    "preloadBackgroundData": false,
+    "minified": true,
+    "newFeature": false,
+    "coverView": true,
+    "nodeModules": true,
+    "autoAudits": false,
+    "showShadowRootInWxmlPanel": true,
+    "scopeDataCheck": false,
+    "uglifyFileName": false,
+    "checkInvalidKey": true,
+    "checkSiteMap": true,
+    "uploadWithSourceMap": true,
+    "compileHotReLoad": false,
+    "lazyloadPlaceholderEnable": false,
+    "useMultiFrameRuntime": true,
+    "useApiHook": true,
+    "useApiHostProcess": true,
+    "babelSetting": {
+      "ignore": [],
+      "disablePlugins": [],
+      "outputPath": ""
     },
-    "setting": {
-        "urlCheck": true,
-        "es6": true,
-        "enhance": true,
-        "postcss": true,
-        "preloadBackgroundData": false,
-        "minified": true,
-        "newFeature": false,
-        "coverView": true,
-        "nodeModules": true,
-        "autoAudits": false,
-        "showShadowRootInWxmlPanel": true,
-        "scopeDataCheck": false,
-        "uglifyFileName": false,
-        "checkInvalidKey": true,
-        "checkSiteMap": true,
-        "uploadWithSourceMap": true,
-        "compileHotReLoad": false,
-        "lazyloadPlaceholderEnable": false,
-        "useMultiFrameRuntime": false,
-        "useApiHook": false,
-        "useApiHostProcess": false,
-        "babelSetting": {
-            "ignore": [],
-            "disablePlugins": [],
-            "outputPath": ""
-        },
-        "enableEngineNative": false,
-        "useIsolateContext": true,
-        "userConfirmedBundleSwitch": false,
-        "packNpmManually": true,
-        "packNpmRelationList": [
-            {
-                "packageJsonPath": "./package.json",
-                "miniprogramNpmDistDir": "./"
-            }
-        ],
-        "minifyWXSS": true,
-        "showES6CompileOption": false
+    "useIsolateContext": false,
+    "userConfirmedBundleSwitch": false,
+    "packNpmManually": true,
+    "packNpmRelationList": [
+      {
+        "packageJsonPath": "./package.json",
+        "miniprogramNpmDistDir": "./"
+      }
+    ],
+    "minifyWXSS": true,
+    "disableUseStrict": false,
+    "showES6CompileOption": false,
+    "useCompilerPlugins": false,
+    "ignoreUploadUnusedFiles": true,
+    "minifyWXML": true
+  },
+  "compileType": "miniprogram",
+  "libVersion": "2.19.2",
+  "appid": "wx8c972fc52d89fb8b",
+  "projectname": "%E8%AF%86%E7%89%A9%E5%B0%8F%E7%A8%8B%E5%BA%8F",
+  "debugOptions": {
+    "hidedInDevtools": []
+  },
+  "scripts": {},
+  "staticServerOptions": {
+    "baseURL": "",
+    "servePath": ""
+  },
+  "isGameTourist": false,
+  "cloudfunctionRoot": "cloudfunctions/",
+  "cloudfunctionTemplateRoot": "cloudfunctionTemplate",
+  "simulatorType": "wechat",
+  "simulatorPluginLibVersion": {},
+  "condition": {
+    "search": {
+      "list": []
     },
-    "compileType": "miniprogram",
-    "libVersion": "2.19.2",
-    "appid": "wx7138a7bb793608c3",
-    "projectname": "%E8%AF%86%E7%89%A9%E5%B0%8F%E7%A8%8B%E5%BA%8F",
-    "debugOptions": {
-        "hidedInDevtools": []
+    "conversation": {
+      "list": []
     },
-    "scripts": {},
-    "staticServerOptions": {
-        "baseURL": "",
-        "servePath": ""
+    "game": {
+      "list": []
     },
-    "isGameTourist": false,
-    "cloudfunctionRoot": "cloudfunctions/",
-    "cloudfunctionTemplateRoot": "cloudfunctionTemplate",
-    "simulatorType": "wechat",
-    "simulatorPluginLibVersion": {},
-    "condition": {
-        "search": {
-            "list": []
-        },
-        "conversation": {
-            "list": []
-        },
-        "game": {
-            "list": []
-        },
-        "plugin": {
-            "list": []
-        },
-        "gamePlugin": {
-            "list": []
-        },
-        "miniprogram": {
-            "list": []
-        }
+    "plugin": {
+      "list": []
+    },
+    "gamePlugin": {
+      "list": []
+    },
+    "miniprogram": {
+      "list": []
     }
+  }
 }
\ No newline at end of file
diff --git a/packages/paddlejs-examples/clasGame/tool/paddleRegister.js b/packages/paddlejs-examples/clasGame/tool/paddleRegister.js
index 0ea190c3..0c1eaa09 100644
--- a/packages/paddlejs-examples/clasGame/tool/paddleRegister.js
+++ b/packages/paddlejs-examples/clasGame/tool/paddleRegister.js
@@ -1,21 +1,14 @@
 import * as paddlejs from '@paddlejs/paddlejs-core'; // 引入 paddlejs-core
-import {CONFIG} from '../config.js';
+import { CONFIG } from '../config.js';
 import '@paddlejs/paddlejs-backend-webgl'; // 引入 backend-webgl
-const plugin = requirePlugin("paddlejs-plugin"); // 引入小程序插件
+// eslint-disable-next-line no-undef
+const plugin = requirePlugin('paddlejs-plugin'); // 引入小程序插件
+// eslint-disable-next-line no-undef
 plugin.register(paddlejs, wx); // 注入微信全局环境变量
 
 export const PaddleJS = new paddlejs.Runner({
-    modelPath: CONFIG.config.modelInfo.path || 'https://mms-voice-fe.cdn.bcebos.com/pdmodel/clas/common/v4_2_0915',
-    feedShape: {
-        fw: 224,
-        fh: 224
-    },
-    fill: '#fff',
-    targetSize: {
-        height: 224,
-        width: 224
-    },
+    modelPath: CONFIG.config.modelInfo.path || 'https://mms-voice-fe.cdn.bcebos.com/pdmodel/clas/fuse/v4_03082014',
     mean: CONFIG.config.modelInfo.mean || [0.485, 0.456, 0.406],
     std: CONFIG.config.modelInfo.std || [0.229, 0.224, 0.225],
-    needPreheat: true
+    webglFeedProcess: true
 });
diff --git a/packages/paddlejs-examples/ocrdetectXcx/package-lock.json b/packages/paddlejs-examples/ocrdetectXcx/package-lock.json
index f6cd5fb4..326b3a9c 100644
--- a/packages/paddlejs-examples/ocrdetectXcx/package-lock.json
+++ b/packages/paddlejs-examples/ocrdetectXcx/package-lock.json
@@ -1,18 +1,18 @@
 {
   "name": "paddlejs-demo",
-  "version": "0.0.3",
+  "version": "0.0.1",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
     "@paddlejs/paddlejs-backend-webgl": {
-      "version": "1.1.19",
-      "resolved": "https://registry.npmjs.org/@paddlejs/paddlejs-backend-webgl/-/paddlejs-backend-webgl-1.1.19.tgz",
-      "integrity": "sha512-m4akW0EZJOYFO181Q2C22Zs2olEn5H+J/gqzBDHPcuE87M3e9q2OtHpIduor31z0xnUii+6gn2zk3BvASU8CuA=="
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/@paddlejs/paddlejs-backend-webgl/-/paddlejs-backend-webgl-1.2.0.tgz",
+      "integrity": "sha512-bKJKJkGldC3NPOuJyk+372z0XW1dd1D9lR0f9OHqWQboY0Mkah+gX+8tkerrNg+QjYz88IW0iJaRKB0jm+6d9g=="
     },
     "@paddlejs/paddlejs-core": {
-      "version": "2.1.17",
-      "resolved": "https://registry.npmjs.org/@paddlejs/paddlejs-core/-/paddlejs-core-2.1.17.tgz",
-      "integrity": "sha512-L4+y6X9VMoiWQm5JbvLT85SZcW7wD4Ieq7k1m1yXeJK+q56Ra6Gc5n0MDV+RyIWwqP35FxIk1oBvmcH/QpU/2g=="
+      "version": "2.1.18",
+      "resolved": "https://registry.npmjs.org/@paddlejs/paddlejs-core/-/paddlejs-core-2.1.18.tgz",
+      "integrity": "sha512-QrXxwaHm4llp1sxbUq/oCCqlYx4ciXanBn/Lfq09UqR4zkYi5SptacQlIxgJ70HOO6RWIxjWN4liQckMwa2TkA=="
     },
     "d3-polygon": {
       "version": "2.0.0",
diff --git a/packages/paddlejs-examples/ocrdetectXcx/package.json b/packages/paddlejs-examples/ocrdetectXcx/package.json
index d7e78757..4e40298a 100644
--- a/packages/paddlejs-examples/ocrdetectXcx/package.json
+++ b/packages/paddlejs-examples/ocrdetectXcx/package.json
@@ -4,8 +4,8 @@
   "description": "",
   "main": "app.js",
   "dependencies": {
-    "@paddlejs/paddlejs-backend-webgl": "^1.1.19",
-    "@paddlejs/paddlejs-core": "^2.1.17",
+    "@paddlejs/paddlejs-backend-webgl": "^1.2.0",
+    "@paddlejs/paddlejs-core": "^2.1.18",
     "d3-polygon": "2.0.0",
     "js-clipper": "1.0.1",
     "number-precision": "1.5.2"
diff --git a/packages/paddlejs-examples/ocrdetectXcx/pages/index/index.js b/packages/paddlejs-examples/ocrdetectXcx/pages/index/index.js
index 09c1cd10..b370f2f2 100644
--- a/packages/paddlejs-examples/ocrdetectXcx/pages/index/index.js
+++ b/packages/paddlejs-examples/ocrdetectXcx/pages/index/index.js
@@ -230,11 +230,6 @@ Page({
         const me = this;
         detectRunner = new paddlejs.Runner({
             modelPath: 'https://paddlejs.bj.bcebos.com/models/fuse/ocr/ch_PP-OCRv2_det_fuse_activation',
-            feedShape: {
-                fw: 960,
-                fh: 960
-            },
-            fill: '#fff',
             mean: [0.485, 0.456, 0.406],
             std: [0.229, 0.224, 0.225],
             bgr: true,
diff --git a/packages/paddlejs-models/detect/package-lock.json b/packages/paddlejs-models/detect/package-lock.json
index 444da6da..9b7d992f 100644
--- a/packages/paddlejs-models/detect/package-lock.json
+++ b/packages/paddlejs-models/detect/package-lock.json
@@ -1,6 +1,6 @@
 {
   "name": "@paddlejs-models/detect",
-  "version": "1.1.1",
+  "version": "1.1.2",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
@@ -11,14 +11,14 @@
       "dev": true
     },
     "@paddlejs/paddlejs-backend-webgl": {
-      "version": "1.1.19",
-      "resolved": "https://registry.npmjs.org/@paddlejs/paddlejs-backend-webgl/-/paddlejs-backend-webgl-1.1.19.tgz",
-      "integrity": "sha512-m4akW0EZJOYFO181Q2C22Zs2olEn5H+J/gqzBDHPcuE87M3e9q2OtHpIduor31z0xnUii+6gn2zk3BvASU8CuA=="
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/@paddlejs/paddlejs-backend-webgl/-/paddlejs-backend-webgl-1.2.0.tgz",
+      "integrity": "sha512-bKJKJkGldC3NPOuJyk+372z0XW1dd1D9lR0f9OHqWQboY0Mkah+gX+8tkerrNg+QjYz88IW0iJaRKB0jm+6d9g=="
     },
     "@paddlejs/paddlejs-core": {
-      "version": "2.1.17",
-      "resolved": "https://registry.npmjs.org/@paddlejs/paddlejs-core/-/paddlejs-core-2.1.17.tgz",
-      "integrity": "sha512-L4+y6X9VMoiWQm5JbvLT85SZcW7wD4Ieq7k1m1yXeJK+q56Ra6Gc5n0MDV+RyIWwqP35FxIk1oBvmcH/QpU/2g=="
+      "version": "2.1.18",
+      "resolved": "https://registry.npmjs.org/@paddlejs/paddlejs-core/-/paddlejs-core-2.1.18.tgz",
+      "integrity": "sha512-QrXxwaHm4llp1sxbUq/oCCqlYx4ciXanBn/Lfq09UqR4zkYi5SptacQlIxgJ70HOO6RWIxjWN4liQckMwa2TkA=="
     },
     "@types/eslint": {
       "version": "8.4.1",
diff --git a/packages/paddlejs-models/detect/package.json b/packages/paddlejs-models/detect/package.json
index d399999c..66573d74 100644
--- a/packages/paddlejs-models/detect/package.json
+++ b/packages/paddlejs-models/detect/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@paddlejs-models/detect",
-  "version": "1.1.1",
+  "version": "1.1.2",
   "description": "",
   "main": "lib/index",
   "scripts": {
@@ -10,8 +10,8 @@
   "author": "",
   "license": "ISC",
   "dependencies": {
-    "@paddlejs/paddlejs-backend-webgl": "^1.1.19",
-    "@paddlejs/paddlejs-core": "^2.1.17"
+    "@paddlejs/paddlejs-backend-webgl": "^1.2.0",
+    "@paddlejs/paddlejs-core": "^2.1.18"
   },
   "devDependencies": {
     "html-webpack-plugin": "^5.5.0",
diff --git a/packages/paddlejs-models/detect/src/index.ts b/packages/paddlejs-models/detect/src/index.ts
index e0d3f3cf..9374d7c1 100644
--- a/packages/paddlejs-models/detect/src/index.ts
+++ b/packages/paddlejs-models/detect/src/index.ts
@@ -14,7 +14,8 @@ export async function init() {
         mean: [0.5, 0.5, 0.5],
         std: [0.5, 0.5, 0.5],
         bgr: true,
-        keepRatio: false
+        keepRatio: false,
+        webglFeedProcess: true
     });
     await detectRunner.init();
 }


Test patch:
diff --git a/e2e/dist/assets/imgs/human.jpg b/e2e/dist/assets/imgs/human.jpg
index a0ab266a..d620d9f7 100644
Binary files a/e2e/dist/assets/imgs/human.jpg and b/e2e/dist/assets/imgs/human.jpg differ
diff --git a/e2e/dist/assets/imgs/seg.png b/e2e/dist/assets/imgs/seg.png
deleted file mode 100644
index 6c4b726c..00000000
Binary files a/e2e/dist/assets/imgs/seg.png and /dev/null differ
diff --git a/e2e/dist/assets/imgs/seg_398x224.png b/e2e/dist/assets/imgs/seg_398x224.png
new file mode 100644
index 00000000..6f79ebbd
Binary files /dev/null and b/e2e/dist/assets/imgs/seg_398x224.png differ
diff --git a/e2e/dist/index.html b/e2e/dist/index.html
index 107cfbcf..e505fbc1 100644
--- a/e2e/dist/index.html
+++ b/e2e/dist/index.html
@@ -7,16 +7,22 @@
         <title>paddlejs e2e test</title>
         <style>
             body img {
-                width: 300px;
+                height: 249px;
                 border: 2px black solid;
             }
-            canvas {
-                border: 2px pink solid;
-            }
             #ocr {
                 width: 640px;
                 height: 640px;
             }
+            #seg_canvas, #back_canvas {
+                width: 398px;
+                height: 224px;
+                border: 2px black solid;
+            }
+            #human, #seg {
+                width: 398px;
+                height: 224px;
+            }
         </style>
 
     </head>
@@ -25,10 +31,10 @@
         <img id="banana" src="./assets/imgs/banana.jpeg"/>
         <img id="ok" src="./assets/imgs/ok.jpeg"/>
         <img id="human" src="./assets/imgs/human.jpg"/>
-        <img id="seg" src="./assets/imgs/seg.png"/>
+        <img id="seg" src="./assets/imgs/seg_398x224.png"/>
         <img id="ocr" src="./assets/imgs/ocr.jpg"/>
         <img id="detect" src="./assets/imgs/detect.jpeg"/>
-        <canvas id="back_canvas"></canvas>
+        <canvas id="back_canvas" ></canvas>
         <canvas id="seg_canvas"></canvas>
     </body>
     <script src="./core_bundle.js"></script>
diff --git a/e2e/tests/humanseg.test.ts b/e2e/tests/humanseg.test.ts
index be265f98..20c2248a 100644
--- a/e2e/tests/humanseg.test.ts
+++ b/e2e/tests/humanseg.test.ts
@@ -29,7 +29,6 @@ describe('e2e test humanseg model', () => {
 
             const backImageData = back_ctx.getImageData(0, 0, back_canvas.width, back_canvas.height).data;
             const segImageData = seg_ctx.getImageData(0, 0, seg_canvas.width, seg_canvas.height).data;
-
             let diffPixelsNum = 0;
             const MAX_TOLERANCE = 10;
             for (let index = 0; index < backImageData.length; index++) {
@@ -40,7 +39,9 @@ describe('e2e test humanseg model', () => {
             return diffPixelsNum / backImageData.length;
         });
 
-        const expectedMAP = 0.06;
+
+        const expectedMAP = 0.05;
         await expect(mAP).toBeLessThanOrEqual(expectedMAP);
+
     });
 });
\ No newline at end of file