lsc hace 2 años
padre
commit
2817abd677

+ 577 - 12
package-lock.json

@@ -11,6 +11,8 @@
       "dependencies": {
         "@mediapipe/hands": "^0.4.1646424915",
         "@tensorflow-models/hand-pose-detection": "^2.0.0",
+        "@tensorflow-models/mobilenet": "^2.1.0",
+        "@tensorflow/tfjs": "^3.18.0",
         "@tensorflow/tfjs-backend-webgl": "^3.14.0",
         "@tensorflow/tfjs-converter": "^3.14.0",
         "@tensorflow/tfjs-core": "^3.14.0",
@@ -100,6 +102,36 @@
         "rimraf": "bin.js"
       }
     },
+    "node_modules/@tensorflow-models/mobilenet": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmmirror.com/@tensorflow-models/mobilenet/-/mobilenet-2.1.0.tgz",
+      "integrity": "sha512-JjqT9ijHDFA2FEpUGWg7H2lQ0GrMuE2VmiCRBYmUew6b4JKht8LXDjG5HxZh95YH6c/25sZWTpGeHbquloH+hw==",
+      "peerDependencies": {
+        "@tensorflow/tfjs-converter": "^3.1.0",
+        "@tensorflow/tfjs-core": "^3.1.0"
+      }
+    },
+    "node_modules/@tensorflow/tfjs": {
+      "version": "3.18.0",
+      "resolved": "https://registry.npmmirror.com/@tensorflow/tfjs/-/tfjs-3.18.0.tgz",
+      "integrity": "sha512-mOzz4jJdgIpqFS7EHndVuxrQnLUDVIKGyTqOPTYps89fZwcOFfTVxi4BHemDNQpqlVE8IaGh9UUxVXpjgPY5+Q==",
+      "dependencies": {
+        "@tensorflow/tfjs-backend-cpu": "3.18.0",
+        "@tensorflow/tfjs-backend-webgl": "3.18.0",
+        "@tensorflow/tfjs-converter": "3.18.0",
+        "@tensorflow/tfjs-core": "3.18.0",
+        "@tensorflow/tfjs-data": "3.18.0",
+        "@tensorflow/tfjs-layers": "3.18.0",
+        "argparse": "^1.0.10",
+        "chalk": "^4.1.0",
+        "core-js": "3",
+        "regenerator-runtime": "^0.13.5",
+        "yargs": "^16.0.3"
+      },
+      "bin": {
+        "tfjs-custom-module": "dist/tools/custom_module/cli.js"
+      }
+    },
     "node_modules/@tensorflow/tfjs-backend-cpu": {
       "version": "3.14.0",
       "resolved": "https://registry.npmmirror.com/@tensorflow/tfjs-backend-cpu/-/tfjs-backend-cpu-3.14.0.tgz",
@@ -159,11 +191,292 @@
         "yarn": ">= 1.3.2"
       }
     },
+    "node_modules/@tensorflow/tfjs/node_modules/@tensorflow/tfjs-backend-cpu": {
+      "version": "3.18.0",
+      "resolved": "https://registry.npmmirror.com/@tensorflow/tfjs-backend-cpu/-/tfjs-backend-cpu-3.18.0.tgz",
+      "integrity": "sha512-LcSqlylzGtpgngcMFIL3q9Q3eVaPRJ7ITZt7ivhzkCj4R5ZsnPa9qM3DCVihkQ77heAwSw4hPTo2jp5C4mJ4Cg==",
+      "dependencies": {
+        "@types/seedrandom": "2.4.27",
+        "seedrandom": "2.4.3"
+      },
+      "engines": {
+        "yarn": ">= 1.3.2"
+      },
+      "peerDependencies": {
+        "@tensorflow/tfjs-core": "3.18.0"
+      }
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/@tensorflow/tfjs-backend-webgl": {
+      "version": "3.18.0",
+      "resolved": "https://registry.npmmirror.com/@tensorflow/tfjs-backend-webgl/-/tfjs-backend-webgl-3.18.0.tgz",
+      "integrity": "sha512-3NknSzS1oX2BEBOrpjPMZl823S12RgshQthmIbG6QADHb4bCJA8aM4UjWpw+3bNQnRKbRDQdFbuvj10Un79s2A==",
+      "dependencies": {
+        "@tensorflow/tfjs-backend-cpu": "3.18.0",
+        "@types/offscreencanvas": "~2019.3.0",
+        "@types/seedrandom": "2.4.27",
+        "@types/webgl-ext": "0.0.30",
+        "@types/webgl2": "0.0.6",
+        "seedrandom": "2.4.3"
+      },
+      "engines": {
+        "yarn": ">= 1.3.2"
+      },
+      "peerDependencies": {
+        "@tensorflow/tfjs-core": "3.18.0"
+      }
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/@tensorflow/tfjs-converter": {
+      "version": "3.18.0",
+      "resolved": "https://registry.npmmirror.com/@tensorflow/tfjs-converter/-/tfjs-converter-3.18.0.tgz",
+      "integrity": "sha512-hpChA+zVNQOVwRnCfqDb1WI9jbEAKA6DuEm4m75Zb3dIlE6VVooDmAaHBhlc++z2q2G1sBzF9A4Bv48SUpN6vA==",
+      "peerDependencies": {
+        "@tensorflow/tfjs-core": "3.18.0"
+      }
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/@tensorflow/tfjs-core": {
+      "version": "3.18.0",
+      "resolved": "https://registry.npmmirror.com/@tensorflow/tfjs-core/-/tfjs-core-3.18.0.tgz",
+      "integrity": "sha512-gMxisZozqsr5sCKlphF/eVBLg91MjlBiN60tjX8hJAu0WlSn6Gi5k65GNIL+Pq6hrxpvImcfdCmTH/2XJVZ0Mg==",
+      "dependencies": {
+        "@types/long": "^4.0.1",
+        "@types/offscreencanvas": "~2019.3.0",
+        "@types/seedrandom": "2.4.27",
+        "@types/webgl-ext": "0.0.30",
+        "@webgpu/types": "^0.1.16",
+        "long": "4.0.0",
+        "node-fetch": "~2.6.1",
+        "seedrandom": "2.4.3"
+      },
+      "engines": {
+        "yarn": ">= 1.3.2"
+      }
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/@tensorflow/tfjs-data": {
+      "version": "3.18.0",
+      "resolved": "https://registry.npmmirror.com/@tensorflow/tfjs-data/-/tfjs-data-3.18.0.tgz",
+      "integrity": "sha512-s43vISJh8K/UN2E2zGRhtj/Kyn8dr4ll8EQkapwzm7fGO9afXCnMsTp6rkZq3fFXouCYA2k1B/j7JssIDr50+w==",
+      "dependencies": {
+        "@types/node-fetch": "^2.1.2",
+        "node-fetch": "~2.6.1"
+      },
+      "peerDependencies": {
+        "@tensorflow/tfjs-core": "3.18.0",
+        "seedrandom": "~2.4.3"
+      }
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/@tensorflow/tfjs-layers": {
+      "version": "3.18.0",
+      "resolved": "https://registry.npmmirror.com/@tensorflow/tfjs-layers/-/tfjs-layers-3.18.0.tgz",
+      "integrity": "sha512-AV7yDnPlH+RCcq8VPqkX1iyEchObE+e66m0XmJvLj+ncfKHYLa+39ZNroUA+OgB2/cMG6jgq77R4EhZbT6hwJA==",
+      "peerDependencies": {
+        "@tensorflow/tfjs-core": "3.18.0"
+      }
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/ansi-regex": {
+      "version": "5.0.1",
+      "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz",
+      "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/ansi-styles": {
+      "version": "4.3.0",
+      "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
+      "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+      "dependencies": {
+        "color-convert": "^2.0.1"
+      },
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/chalk": {
+      "version": "4.1.2",
+      "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
+      "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+      "dependencies": {
+        "ansi-styles": "^4.1.0",
+        "supports-color": "^7.1.0"
+      },
+      "engines": {
+        "node": ">=10"
+      }
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/cliui": {
+      "version": "7.0.4",
+      "resolved": "https://registry.npmmirror.com/cliui/-/cliui-7.0.4.tgz",
+      "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
+      "dependencies": {
+        "string-width": "^4.2.0",
+        "strip-ansi": "^6.0.0",
+        "wrap-ansi": "^7.0.0"
+      }
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/color-convert": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
+      "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+      "dependencies": {
+        "color-name": "~1.1.4"
+      },
+      "engines": {
+        "node": ">=7.0.0"
+      }
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/color-name": {
+      "version": "1.1.4",
+      "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
+      "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/core-js": {
+      "version": "3.23.3",
+      "resolved": "https://registry.npmmirror.com/core-js/-/core-js-3.23.3.tgz",
+      "integrity": "sha512-oAKwkj9xcWNBAvGbT//WiCdOMpb9XQG92/Fe3ABFM/R16BsHgePG00mFOgKf7IsCtfj8tA1kHtf/VwErhriz5Q==",
+      "hasInstallScript": true
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/get-caller-file": {
+      "version": "2.0.5",
+      "resolved": "https://registry.npmmirror.com/get-caller-file/-/get-caller-file-2.0.5.tgz",
+      "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
+      "engines": {
+        "node": "6.* || 8.* || >= 10.*"
+      }
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/has-flag": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
+      "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/is-fullwidth-code-point": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+      "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/regenerator-runtime": {
+      "version": "0.13.9",
+      "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
+      "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA=="
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/string-width": {
+      "version": "4.2.3",
+      "resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz",
+      "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+      "dependencies": {
+        "emoji-regex": "^8.0.0",
+        "is-fullwidth-code-point": "^3.0.0",
+        "strip-ansi": "^6.0.1"
+      },
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/strip-ansi": {
+      "version": "6.0.1",
+      "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz",
+      "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+      "dependencies": {
+        "ansi-regex": "^5.0.1"
+      },
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/supports-color": {
+      "version": "7.2.0",
+      "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
+      "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+      "dependencies": {
+        "has-flag": "^4.0.0"
+      },
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/wrap-ansi": {
+      "version": "7.0.0",
+      "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+      "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
+      "dependencies": {
+        "ansi-styles": "^4.0.0",
+        "string-width": "^4.1.0",
+        "strip-ansi": "^6.0.0"
+      },
+      "engines": {
+        "node": ">=10"
+      }
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/y18n": {
+      "version": "5.0.8",
+      "resolved": "https://registry.npmmirror.com/y18n/-/y18n-5.0.8.tgz",
+      "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
+      "engines": {
+        "node": ">=10"
+      }
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/yargs": {
+      "version": "16.2.0",
+      "resolved": "https://registry.npmmirror.com/yargs/-/yargs-16.2.0.tgz",
+      "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
+      "dependencies": {
+        "cliui": "^7.0.2",
+        "escalade": "^3.1.1",
+        "get-caller-file": "^2.0.5",
+        "require-directory": "^2.1.1",
+        "string-width": "^4.2.0",
+        "y18n": "^5.0.5",
+        "yargs-parser": "^20.2.2"
+      },
+      "engines": {
+        "node": ">=10"
+      }
+    },
+    "node_modules/@tensorflow/tfjs/node_modules/yargs-parser": {
+      "version": "20.2.9",
+      "resolved": "https://registry.npmmirror.com/yargs-parser/-/yargs-parser-20.2.9.tgz",
+      "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==",
+      "engines": {
+        "node": ">=10"
+      }
+    },
     "node_modules/@types/long": {
       "version": "4.0.1",
       "resolved": "https://registry.npmmirror.com/@types/long/-/long-4.0.1.tgz",
       "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w=="
     },
+    "node_modules/@types/node": {
+      "version": "18.0.0",
+      "resolved": "https://registry.npmmirror.com/@types/node/-/node-18.0.0.tgz",
+      "integrity": "sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA=="
+    },
+    "node_modules/@types/node-fetch": {
+      "version": "2.6.2",
+      "resolved": "https://registry.npmmirror.com/@types/node-fetch/-/node-fetch-2.6.2.tgz",
+      "integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==",
+      "dependencies": {
+        "@types/node": "*",
+        "form-data": "^3.0.0"
+      }
+    },
+    "node_modules/@types/node-fetch/node_modules/form-data": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmmirror.com/form-data/-/form-data-3.0.1.tgz",
+      "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==",
+      "dependencies": {
+        "asynckit": "^0.4.0",
+        "combined-stream": "^1.0.8",
+        "mime-types": "^2.1.12"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
     "node_modules/@types/offscreencanvas": {
       "version": "2019.3.0",
       "resolved": "https://registry.npmmirror.com/@types/offscreencanvas/-/offscreencanvas-2019.3.0.tgz",
@@ -190,6 +503,11 @@
       "resolved": "https://registry.npmmirror.com/@types/webgl2/-/webgl2-0.0.6.tgz",
       "integrity": "sha512-50GQhDVTq/herLMiqSQkdtRu+d5q/cWHn4VvKJtrj4DJAjo1MNkWYa2MA41BaBO1q1HgsUjuQvEOk0QHvlnAaQ=="
     },
+    "node_modules/@webgpu/types": {
+      "version": "0.1.20",
+      "resolved": "https://registry.npmmirror.com/@webgpu/types/-/types-0.1.20.tgz",
+      "integrity": "sha512-MFb5oyxX+A7PWQNjcY3kSCSG2FAHaBo7IJBWtxWFgsS20FtY3D9UY7lYqLZ6avS8fSkdSylIS4qiHzFlQUdXag=="
+    },
     "node_modules/abab": {
       "version": "2.0.5",
       "resolved": "https://registry.npm.taobao.org/abab/download/abab-2.0.5.tgz",
@@ -366,7 +684,6 @@
       "version": "1.0.10",
       "resolved": "https://registry.nlark.com/argparse/download/argparse-1.0.10.tgz",
       "integrity": "sha1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE=",
-      "dev": true,
       "dependencies": {
         "sprintf-js": "~1.0.2"
       }
@@ -4463,6 +4780,11 @@
       "integrity": "sha1-d1s/J477uXGO7HNh9IP7Nvu/6og=",
       "dev": true
     },
+    "node_modules/emoji-regex": {
+      "version": "8.0.0",
+      "resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz",
+      "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
+    },
     "node_modules/emojis-list": {
       "version": "3.0.0",
       "resolved": "https://registry.npm.taobao.org/emojis-list/download/emojis-list-3.0.0.tgz",
@@ -4667,7 +4989,6 @@
       "version": "3.1.1",
       "resolved": "https://registry.nlark.com/escalade/download/escalade-3.1.1.tgz",
       "integrity": "sha1-2M/ccACWXFoBdLSoLqpcBVJ0LkA=",
-      "dev": true,
       "engines": {
         "node": ">=6"
       }
@@ -11898,7 +12219,6 @@
       "version": "2.1.1",
       "resolved": "https://registry.nlark.com/require-directory/download/require-directory-2.1.1.tgz",
       "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
-      "dev": true,
       "engines": {
         "node": ">=0.10.0"
       }
@@ -12779,8 +13099,7 @@
     "node_modules/sprintf-js": {
       "version": "1.0.3",
       "resolved": "https://registry.nlark.com/sprintf-js/download/sprintf-js-1.0.3.tgz?cache=0&sync_timestamp=1618847174560&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsprintf-js%2Fdownload%2Fsprintf-js-1.0.3.tgz",
-      "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
-      "dev": true
+      "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
     },
     "node_modules/sshpk": {
       "version": "1.16.1",
@@ -15114,6 +15433,220 @@
         }
       }
     },
+    "@tensorflow-models/mobilenet": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmmirror.com/@tensorflow-models/mobilenet/-/mobilenet-2.1.0.tgz",
+      "integrity": "sha512-JjqT9ijHDFA2FEpUGWg7H2lQ0GrMuE2VmiCRBYmUew6b4JKht8LXDjG5HxZh95YH6c/25sZWTpGeHbquloH+hw==",
+      "requires": {}
+    },
+    "@tensorflow/tfjs": {
+      "version": "3.18.0",
+      "resolved": "https://registry.npmmirror.com/@tensorflow/tfjs/-/tfjs-3.18.0.tgz",
+      "integrity": "sha512-mOzz4jJdgIpqFS7EHndVuxrQnLUDVIKGyTqOPTYps89fZwcOFfTVxi4BHemDNQpqlVE8IaGh9UUxVXpjgPY5+Q==",
+      "requires": {
+        "@tensorflow/tfjs-backend-cpu": "3.18.0",
+        "@tensorflow/tfjs-backend-webgl": "3.18.0",
+        "@tensorflow/tfjs-converter": "3.18.0",
+        "@tensorflow/tfjs-core": "3.18.0",
+        "@tensorflow/tfjs-data": "3.18.0",
+        "@tensorflow/tfjs-layers": "3.18.0",
+        "argparse": "^1.0.10",
+        "chalk": "^4.1.0",
+        "core-js": "3",
+        "regenerator-runtime": "^0.13.5",
+        "yargs": "^16.0.3"
+      },
+      "dependencies": {
+        "@tensorflow/tfjs-backend-cpu": {
+          "version": "3.18.0",
+          "resolved": "https://registry.npmmirror.com/@tensorflow/tfjs-backend-cpu/-/tfjs-backend-cpu-3.18.0.tgz",
+          "integrity": "sha512-LcSqlylzGtpgngcMFIL3q9Q3eVaPRJ7ITZt7ivhzkCj4R5ZsnPa9qM3DCVihkQ77heAwSw4hPTo2jp5C4mJ4Cg==",
+          "requires": {
+            "@types/seedrandom": "2.4.27",
+            "seedrandom": "2.4.3"
+          }
+        },
+        "@tensorflow/tfjs-backend-webgl": {
+          "version": "3.18.0",
+          "resolved": "https://registry.npmmirror.com/@tensorflow/tfjs-backend-webgl/-/tfjs-backend-webgl-3.18.0.tgz",
+          "integrity": "sha512-3NknSzS1oX2BEBOrpjPMZl823S12RgshQthmIbG6QADHb4bCJA8aM4UjWpw+3bNQnRKbRDQdFbuvj10Un79s2A==",
+          "requires": {
+            "@tensorflow/tfjs-backend-cpu": "3.18.0",
+            "@types/offscreencanvas": "~2019.3.0",
+            "@types/seedrandom": "2.4.27",
+            "@types/webgl-ext": "0.0.30",
+            "@types/webgl2": "0.0.6",
+            "seedrandom": "2.4.3"
+          }
+        },
+        "@tensorflow/tfjs-converter": {
+          "version": "3.18.0",
+          "resolved": "https://registry.npmmirror.com/@tensorflow/tfjs-converter/-/tfjs-converter-3.18.0.tgz",
+          "integrity": "sha512-hpChA+zVNQOVwRnCfqDb1WI9jbEAKA6DuEm4m75Zb3dIlE6VVooDmAaHBhlc++z2q2G1sBzF9A4Bv48SUpN6vA==",
+          "requires": {}
+        },
+        "@tensorflow/tfjs-core": {
+          "version": "3.18.0",
+          "resolved": "https://registry.npmmirror.com/@tensorflow/tfjs-core/-/tfjs-core-3.18.0.tgz",
+          "integrity": "sha512-gMxisZozqsr5sCKlphF/eVBLg91MjlBiN60tjX8hJAu0WlSn6Gi5k65GNIL+Pq6hrxpvImcfdCmTH/2XJVZ0Mg==",
+          "requires": {
+            "@types/long": "^4.0.1",
+            "@types/offscreencanvas": "~2019.3.0",
+            "@types/seedrandom": "2.4.27",
+            "@types/webgl-ext": "0.0.30",
+            "@webgpu/types": "^0.1.16",
+            "long": "4.0.0",
+            "node-fetch": "~2.6.1",
+            "seedrandom": "2.4.3"
+          }
+        },
+        "@tensorflow/tfjs-data": {
+          "version": "3.18.0",
+          "resolved": "https://registry.npmmirror.com/@tensorflow/tfjs-data/-/tfjs-data-3.18.0.tgz",
+          "integrity": "sha512-s43vISJh8K/UN2E2zGRhtj/Kyn8dr4ll8EQkapwzm7fGO9afXCnMsTp6rkZq3fFXouCYA2k1B/j7JssIDr50+w==",
+          "requires": {
+            "@types/node-fetch": "^2.1.2",
+            "node-fetch": "~2.6.1"
+          }
+        },
+        "@tensorflow/tfjs-layers": {
+          "version": "3.18.0",
+          "resolved": "https://registry.npmmirror.com/@tensorflow/tfjs-layers/-/tfjs-layers-3.18.0.tgz",
+          "integrity": "sha512-AV7yDnPlH+RCcq8VPqkX1iyEchObE+e66m0XmJvLj+ncfKHYLa+39ZNroUA+OgB2/cMG6jgq77R4EhZbT6hwJA==",
+          "requires": {}
+        },
+        "ansi-regex": {
+          "version": "5.0.1",
+          "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz",
+          "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="
+        },
+        "ansi-styles": {
+          "version": "4.3.0",
+          "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
+          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+          "requires": {
+            "color-convert": "^2.0.1"
+          }
+        },
+        "chalk": {
+          "version": "4.1.2",
+          "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+          "requires": {
+            "ansi-styles": "^4.1.0",
+            "supports-color": "^7.1.0"
+          }
+        },
+        "cliui": {
+          "version": "7.0.4",
+          "resolved": "https://registry.npmmirror.com/cliui/-/cliui-7.0.4.tgz",
+          "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
+          "requires": {
+            "string-width": "^4.2.0",
+            "strip-ansi": "^6.0.0",
+            "wrap-ansi": "^7.0.0"
+          }
+        },
+        "color-convert": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
+          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+          "requires": {
+            "color-name": "~1.1.4"
+          }
+        },
+        "color-name": {
+          "version": "1.1.4",
+          "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
+          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
+        },
+        "core-js": {
+          "version": "3.23.3",
+          "resolved": "https://registry.npmmirror.com/core-js/-/core-js-3.23.3.tgz",
+          "integrity": "sha512-oAKwkj9xcWNBAvGbT//WiCdOMpb9XQG92/Fe3ABFM/R16BsHgePG00mFOgKf7IsCtfj8tA1kHtf/VwErhriz5Q=="
+        },
+        "get-caller-file": {
+          "version": "2.0.5",
+          "resolved": "https://registry.npmmirror.com/get-caller-file/-/get-caller-file-2.0.5.tgz",
+          "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="
+        },
+        "has-flag": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
+          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
+        },
+        "is-fullwidth-code-point": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+          "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
+        },
+        "regenerator-runtime": {
+          "version": "0.13.9",
+          "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
+          "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA=="
+        },
+        "string-width": {
+          "version": "4.2.3",
+          "resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz",
+          "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+          "requires": {
+            "emoji-regex": "^8.0.0",
+            "is-fullwidth-code-point": "^3.0.0",
+            "strip-ansi": "^6.0.1"
+          }
+        },
+        "strip-ansi": {
+          "version": "6.0.1",
+          "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz",
+          "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+          "requires": {
+            "ansi-regex": "^5.0.1"
+          }
+        },
+        "supports-color": {
+          "version": "7.2.0",
+          "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
+          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+          "requires": {
+            "has-flag": "^4.0.0"
+          }
+        },
+        "wrap-ansi": {
+          "version": "7.0.0",
+          "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+          "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
+          "requires": {
+            "ansi-styles": "^4.0.0",
+            "string-width": "^4.1.0",
+            "strip-ansi": "^6.0.0"
+          }
+        },
+        "y18n": {
+          "version": "5.0.8",
+          "resolved": "https://registry.npmmirror.com/y18n/-/y18n-5.0.8.tgz",
+          "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="
+        },
+        "yargs": {
+          "version": "16.2.0",
+          "resolved": "https://registry.npmmirror.com/yargs/-/yargs-16.2.0.tgz",
+          "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
+          "requires": {
+            "cliui": "^7.0.2",
+            "escalade": "^3.1.1",
+            "get-caller-file": "^2.0.5",
+            "require-directory": "^2.1.1",
+            "string-width": "^4.2.0",
+            "y18n": "^5.0.5",
+            "yargs-parser": "^20.2.2"
+          }
+        },
+        "yargs-parser": {
+          "version": "20.2.9",
+          "resolved": "https://registry.npmmirror.com/yargs-parser/-/yargs-parser-20.2.9.tgz",
+          "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w=="
+        }
+      }
+    },
     "@tensorflow/tfjs-backend-cpu": {
       "version": "3.14.0",
       "resolved": "https://registry.npmmirror.com/@tensorflow/tfjs-backend-cpu/-/tfjs-backend-cpu-3.14.0.tgz",
@@ -15161,6 +15694,32 @@
       "resolved": "https://registry.npmmirror.com/@types/long/-/long-4.0.1.tgz",
       "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w=="
     },
+    "@types/node": {
+      "version": "18.0.0",
+      "resolved": "https://registry.npmmirror.com/@types/node/-/node-18.0.0.tgz",
+      "integrity": "sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA=="
+    },
+    "@types/node-fetch": {
+      "version": "2.6.2",
+      "resolved": "https://registry.npmmirror.com/@types/node-fetch/-/node-fetch-2.6.2.tgz",
+      "integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==",
+      "requires": {
+        "@types/node": "*",
+        "form-data": "^3.0.0"
+      },
+      "dependencies": {
+        "form-data": {
+          "version": "3.0.1",
+          "resolved": "https://registry.npmmirror.com/form-data/-/form-data-3.0.1.tgz",
+          "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==",
+          "requires": {
+            "asynckit": "^0.4.0",
+            "combined-stream": "^1.0.8",
+            "mime-types": "^2.1.12"
+          }
+        }
+      }
+    },
     "@types/offscreencanvas": {
       "version": "2019.3.0",
       "resolved": "https://registry.npmmirror.com/@types/offscreencanvas/-/offscreencanvas-2019.3.0.tgz",
@@ -15187,6 +15746,11 @@
       "resolved": "https://registry.npmmirror.com/@types/webgl2/-/webgl2-0.0.6.tgz",
       "integrity": "sha512-50GQhDVTq/herLMiqSQkdtRu+d5q/cWHn4VvKJtrj4DJAjo1MNkWYa2MA41BaBO1q1HgsUjuQvEOk0QHvlnAaQ=="
     },
+    "@webgpu/types": {
+      "version": "0.1.20",
+      "resolved": "https://registry.npmmirror.com/@webgpu/types/-/types-0.1.20.tgz",
+      "integrity": "sha512-MFb5oyxX+A7PWQNjcY3kSCSG2FAHaBo7IJBWtxWFgsS20FtY3D9UY7lYqLZ6avS8fSkdSylIS4qiHzFlQUdXag=="
+    },
     "abab": {
       "version": "2.0.5",
       "resolved": "https://registry.npm.taobao.org/abab/download/abab-2.0.5.tgz",
@@ -15323,7 +15887,6 @@
       "version": "1.0.10",
       "resolved": "https://registry.nlark.com/argparse/download/argparse-1.0.10.tgz",
       "integrity": "sha1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE=",
-      "dev": true,
       "requires": {
         "sprintf-js": "~1.0.2"
       }
@@ -18954,6 +19517,11 @@
         }
       }
     },
+    "emoji-regex": {
+      "version": "8.0.0",
+      "resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz",
+      "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
+    },
     "emojis-list": {
       "version": "3.0.0",
       "resolved": "https://registry.npm.taobao.org/emojis-list/download/emojis-list-3.0.0.tgz",
@@ -19141,8 +19709,7 @@
     "escalade": {
       "version": "3.1.1",
       "resolved": "https://registry.nlark.com/escalade/download/escalade-3.1.1.tgz",
-      "integrity": "sha1-2M/ccACWXFoBdLSoLqpcBVJ0LkA=",
-      "dev": true
+      "integrity": "sha1-2M/ccACWXFoBdLSoLqpcBVJ0LkA="
     },
     "escape-html": {
       "version": "1.0.3",
@@ -25052,8 +25619,7 @@
     "require-directory": {
       "version": "2.1.1",
       "resolved": "https://registry.nlark.com/require-directory/download/require-directory-2.1.1.tgz",
-      "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
-      "dev": true
+      "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I="
     },
     "require-from-string": {
       "version": "1.2.1",
@@ -25819,8 +26385,7 @@
     "sprintf-js": {
       "version": "1.0.3",
       "resolved": "https://registry.nlark.com/sprintf-js/download/sprintf-js-1.0.3.tgz?cache=0&sync_timestamp=1618847174560&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsprintf-js%2Fdownload%2Fsprintf-js-1.0.3.tgz",
-      "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
-      "dev": true
+      "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
     },
     "sshpk": {
       "version": "1.16.1",

+ 2 - 0
package.json

@@ -12,6 +12,8 @@
   "dependencies": {
     "@mediapipe/hands": "^0.4.1646424915",
     "@tensorflow-models/hand-pose-detection": "^2.0.0",
+    "@tensorflow-models/mobilenet": "^2.1.0",
+    "@tensorflow/tfjs": "^3.18.0",
     "@tensorflow/tfjs-backend-webgl": "^3.14.0",
     "@tensorflow/tfjs-converter": "^3.14.0",
     "@tensorflow/tfjs-core": "^3.14.0",

+ 196 - 2
src/components/blockly.vue

@@ -27,16 +27,34 @@
       <sep></sep>
       <category id="cat" name="人脸识别" colour="#ee783a">
         <block type="iot_lcd_faceinit"></block>
+        <block type="iot_lcd_objectinit"></block>
       </category>
       <sep></sep>
-      <category id="police" name="电子警察组件" colour="#1b5873">
+      <category id="police" name="识别组件" colour="#1b5873">
         <block type="iot_lcd_policeinit"></block>
+        <block type="police_objectinit"></block>
       </category>
       <sep></sep>
-      <category id="police" name="AI组件" colour="#935ba5">
+      <category id="voice" name="语音组件" colour="#9200ff">
+        <block type="voice_voiceinit"></block>
+        <block type="voice_talk"></block>
+        <block type="voice_open"></block>
+      </category>
+      <sep></sep>
+      <category id="ai" name="AI组件" colour="#935ba5">
         <block type="ai_gesture"></block>
         <block type="ai_motor"></block>
       </category>
+      <sep></sep>
+      <category id="light" name="灯光" colour="#3a8ee6">
+        <block type="light_open"></block>
+        <block type="light_close"></block>
+      </category>
+      <sep></sep>
+      <category id="curtain" name="窗帘" colour="#26DDFF">
+        <block type="curtain_open"></block>
+        <block type="curtain_close"></block>
+      </category>
     </xml>
   </div>
 </template>
@@ -131,6 +149,8 @@ export default {
         this.$router.push("Flight");
       } else if (this.type == "curtain") {
         this.$router.push("Fcurtain");
+      } else if (this.type == "shop") {
+        this.$router.push("Fshop");
       } else {
         this.$router.push("function");
       }
@@ -226,6 +246,30 @@ export default {
       return _code;
     };
 
+    Blockly.Blocks["police_objectinit"] = {
+      init: function () {
+        this.appendDummyInput().appendField(
+          new Blockly.FieldImage(
+            require("../assets/img/screen_init_header.png"),
+            45,
+            45
+          )
+        );
+        this.appendDummyInput().appendField("物体识别对比组件");
+        this.setInputsInline(false);
+        this.setPreviousStatement(true);
+        this.setNextStatement(true);
+        this.setColour("#1b5873");
+        this.setTooltip("");
+        this.setHelpUrl("");
+      },
+    };
+
+    Blockly.JavaScript.police_objectinit = function (block) {
+      var _code = "pObject=1;";
+      return _code;
+    };
+
     Blockly.Blocks["logic_loop"] = {
       init: function () {
         this.appendStatementInput("NAME")
@@ -329,6 +373,156 @@ export default {
       // TODO: Change ORDER_NONE to the correct strength.
       return code;
     };
+
+    Blockly.Blocks["iot_lcd_objectinit"] = {
+      init: function () {
+        this.appendDummyInput().appendField(
+          new Blockly.FieldImage(
+            require("../assets/img/face_recognition_header.png"),
+            45,
+            45
+          )
+        );
+        this.appendDummyInput().appendField("物体辨识");
+        this.setInputsInline(false);
+        this.setPreviousStatement(true);
+        this.setNextStatement(true);
+        this.setColour("#ee783a");
+        this.setTooltip("");
+        this.setHelpUrl("");
+      },
+    };
+
+    Blockly.JavaScript.iot_lcd_objectinit = function (block) {
+      var _code = "object=1";
+      return _code;
+    };
+
+    Blockly.Blocks["voice_voiceinit"] = {
+      init: function () {
+        this.appendDummyInput().appendField(
+          new Blockly.FieldImage(
+            require("../assets/img/screen_init_header.png"),
+            45,
+            45
+          )
+        );
+        this.appendDummyInput().appendField("语音识别");
+        this.setInputsInline(false);
+        this.setPreviousStatement(true);
+        this.setNextStatement(true);
+        this.setColour("#9200ff");
+        this.setTooltip("");
+        this.setHelpUrl("");
+      },
+    };
+
+    Blockly.JavaScript.voice_voiceinit = function (block) {
+      var _code = "voice=1;";
+      return _code;
+    };
+
+    Blockly.Blocks["voice_open"] = {
+      init: function () {
+        this.appendDummyInput().appendField(
+          new Blockly.FieldImage(
+            require("../assets/img/screen_init_header.png"),
+            45,
+            45
+          )
+        );
+        this.appendDummyInput().appendField("打开音频");
+        this.setInputsInline(false);
+        this.setPreviousStatement(true);
+        this.setNextStatement(true);
+        this.setColour("#9200ff");
+        this.setTooltip("");
+        this.setHelpUrl("");
+      },
+    };
+
+    Blockly.JavaScript.voice_open = function (block) {
+      var _code = "voiceOpen=1;";
+      return _code;
+    };
+
+    Blockly.Blocks["voice_talk"] = {
+      init: function () {
+        this.appendDummyInput()
+          .appendField("说出")
+          .appendField(new Blockly.FieldTextInput(""), "say");
+        this.setOutput(true, null);
+        this.setColour("#9200ff");
+        this.setTooltip("");
+        this.setHelpUrl("");
+      },
+    };
+    Blockly.JavaScript["voice_talk"] = function (block) {
+      var text_say = block.getFieldValue("say");
+      var code = "say="+text_say;
+      // return code;
+      return [code, Blockly.JavaScript.ORDER_NONE];
+    };
+    Blockly.Blocks["light_open"] = {
+      init: function () {
+        this.appendDummyInput().appendField("打开灯光");
+        this.setPreviousStatement(true, null);
+        this.setNextStatement(true, null);
+        this.setColour("#3a8ee6");
+        this.setTooltip("");
+        this.setHelpUrl("");
+      },
+    };
+    Blockly.JavaScript["light_open"] = function (block) {
+      // TODO: Assemble JavaScript into code variable.
+      var code = "light=1";
+      return code;
+    };
+    Blockly.Blocks["light_close"] = {
+      init: function () {
+        this.appendDummyInput().appendField("关闭灯光");
+        this.setPreviousStatement(true, null);
+        this.setNextStatement(true, null);
+        this.setColour("#3a8ee6");
+        this.setTooltip("");
+        this.setHelpUrl("");
+      },
+    };
+    Blockly.JavaScript["light_close"] = function (block) {
+      // TODO: Assemble JavaScript into code variable.
+      var code = "light=0";
+      return code;
+    };
+    Blockly.Blocks["curtain_open"] = {
+      init: function () {
+        this.appendDummyInput().appendField("打开窗帘");
+        this.setPreviousStatement(true, null);
+        this.setNextStatement(true, null);
+        this.setColour("#26DDFF");
+        this.setTooltip("");
+        this.setHelpUrl("");
+      },
+    };
+    Blockly.JavaScript["curtain_open"] = function (block) {
+      // TODO: Assemble JavaScript into code variable.
+      var code = "curtain=1";
+      return code;
+    };
+    Blockly.Blocks["curtain_close"] = {
+      init: function () {
+        this.appendDummyInput().appendField("关闭窗帘");
+        this.setPreviousStatement(true, null);
+        this.setNextStatement(true, null);
+        this.setColour("#26DDFF");
+        this.setTooltip("");
+        this.setHelpUrl("");
+      },
+    };
+    Blockly.JavaScript["curtain_close"] = function (block) {
+      // TODO: Assemble JavaScript into code variable.
+      var code = "curtain=0";
+      return code;
+    };
   },
 };
 </script>

+ 13 - 0
src/components/curtain.vue

@@ -865,6 +865,7 @@
 							_C5One.style.left = c2L + 22 + "px";
 							_C5One.style.top = c2T - 202 + "px";
 							binding.value.setC5One(1);
+							playMusic();
 						} else if (type == "C5One") {
 							binding.value.setC5One(0);
 						}
@@ -879,6 +880,7 @@
 							_C5Two.style.left = c2L + 315 + "px";
 							_C5Two.style.top = c2T - 202 + "px";
 							binding.value.setC5Two(1);
+							playMusic();
 						} else if (type == "C5Two") {
 							binding.value.setC5Two(0);
 						}
@@ -893,6 +895,7 @@
 							_pj.style.left = c4L + 26 + "px";
 							_pj.style.top = c4T + 60 + "px";
 							binding.value.setPj(1);
+							playMusic();
 						} else if (type == "pj") {
 							binding.value.setPj(0);
 						}
@@ -907,6 +910,7 @@
 							_C6.style.left = c3L + 260 + "px";
 							_C6.style.top = c3T + 109 + "px";
 							binding.value.setC6(1);
+							playMusic();
 						} else if (type == "C6") {
 							binding.value.setC6(0);
 						}
@@ -921,6 +925,7 @@
 							_duobi.style.left = c1L + 22 + "px";
 							_duobi.style.top = c1T - 38 + "px";
 							binding.value.setduoBi(1);
+							playMusic();
 						} else if (type == "duobi") {
 							binding.value.setduoBi(0);
 						}
@@ -935,6 +940,7 @@
 							_bottom.style.left = c1L + 82 + "px";
 							_bottom.style.top = c1T + 11 + "px";
 							binding.value.setButtom(1);
+							playMusic();
 						} else if (type == "bottom") {
 							binding.value.setButtom(0);
 						}
@@ -949,6 +955,7 @@
 							_ai.style.left = c1L + 80 + "px";
 							_ai.style.top = c1T + 11 + "px";
 							binding.value.setAi(1);
+							playMusic();
 						} else if (type == "ai") {
 							binding.value.setAi(0);
 						}
@@ -963,6 +970,7 @@
 							_screan.style.left = c1L + 84 + "px";
 							_screan.style.top = c1T + 12 + "px";
 							binding.value.setScrean(1);
+							playMusic();
 						} else if (type == "screan") {
 							binding.value.setScrean(0);
 						}
@@ -983,6 +991,7 @@
 								_pj.style.top = c1T - 123 + 60 + "px";
 							}
 							binding.value.setC4(1);
+							playMusic();
 						} else if (type == "C4") {
 							binding.value.setC4(0);
 						}
@@ -1003,6 +1012,7 @@
 								_C6.style.top = c4T + 7 + 109 + "px";
 							}
 							binding.value.setC3(1);
+							playMusic();
 						} else if (type == "C3") {
 							binding.value.setC3(0);
 						}
@@ -1057,6 +1067,7 @@
 								}
 							}
 							binding.value.setC1(1);
+							playMusic();
 						} else if (type == "C1") {
 							binding.value.setC1(0);
 						}
@@ -1072,6 +1083,7 @@
 							_curtains.style.left = c2L + 13 + "px";
 							_curtains.style.top = c2T - 187 + "px";
 							binding.value.setCurtains(1);
+							playMusic();
 						} else if (type == "curtains") {
 							binding.value.setCurtains(0);
 						}
@@ -1087,6 +1099,7 @@
 							_line.style.left = curtainL - 84 + "px";
 							_line.style.top = curtainT - 183 + "px";
 							binding.value.setLine(1);
+							playMusic();
 						} else if (type == "curtains") {
 							binding.value.setLine(0);
 						}

+ 50 - 7
src/components/functionCurtain.vue

@@ -57,21 +57,64 @@ export default {
       if (this.voiceText == "") {
         return;
       }
-      if (this.voiceText == "打开窗帘") {
-        this.is = true;
-        this.iatRecorder.stop();
-      } else if (this.voiceText == "关闭窗帘") {
-        this.is = false;
-        this.iatRecorder.stop();
+      var a = this.$store.state.function
+        .replace(/\ +/g, "")
+        .replace(/[\r\n]/g, "")
+        .replace("voiceOpen=1;", "")
+        .replace("voice=1;", "");
+      var _arr = a.split("if");
+      for (var i = 0; i < _arr.length; i++) {
+        if (_arr[i].indexOf(this.voiceText) != -1) {
+          if (_arr[i].indexOf("curtain=1") != -1) {
+            this.is = true;
+            this.iatRecorder.stop();
+            break;
+          } else if (_arr[i].indexOf("curtain=0") != -1) {
+            this.is = false;
+            this.iatRecorder.stop();
+            break;
+          }
+        }
       }
+      // if (this.voiceText == "打开窗帘") {
+      //   this.is = true;
+      //   this.iatRecorder.stop();
+      // } else if (this.voiceText == "关闭窗帘") {
+      //   this.is = false;
+      //   this.iatRecorder.stop();
+      // }
       console.log(this.voiceText);
     },
     cancel() {
       this.vS = true;
     },
+    openVoice() {
+      var _this = this;
+      navigator.getUserMedia(
+        { audio: true },
+        function onSuccess(stream) {
+          console.log("已点击允许,开启成功");
+        },
+        function onError(error) {
+          _this.$message.error("请允许使用麦克风权限");
+          console.log("错误:", error);
+        }
+      );
+    },
   },
   mounted() {
-    this.iatRecorder = new IatRecorder("zh_cn", "mandarin", "5ff2d877"); //小语种-中文方言-appId
+    console.log(this.$store.state.function);
+    if (this.$store.state.function.indexOf("voiceOpen=1;") != -1) {
+      this.openVoice();
+    }
+    var a = this.$store.state.function
+      .replace(/\ +/g, "")
+      .replace(/[\r\n]/g, "")
+      .replace("voiceOpen=1;", "");
+    console.log(a);
+    if (a.indexOf("voice=1;") != -1) {
+      this.iatRecorder = new IatRecorder("zh_cn", "mandarin", "5ff2d877"); //小语种-中文方言-appId
+    }
   },
 };
 </script>

+ 54 - 7
src/components/functionLight.vue

@@ -64,6 +64,10 @@ export default {
   },
   methods: {
     translationStart() {
+      if (!this.iatRecorder) {
+        this.$message.error("没有添加语音识别插件");
+        return;
+      }
       this.voiceText = "";
       this.vS = false;
       this.iatRecorder.start(this.cancel, this.getVoiceText);
@@ -84,21 +88,64 @@ export default {
       if (this.voiceText == "") {
         return;
       }
-      if (this.voiceText == "开灯") {
-        this.isLight = true;
-        this.iatRecorder.stop();
-      } else if (this.voiceText == "关灯") {
-        this.isLight = false;
-        this.iatRecorder.stop();
+      var a = this.$store.state.function
+        .replace(/\ +/g, "")
+        .replace(/[\r\n]/g, "")
+        .replace("voiceOpen=1;", "")
+        .replace("voice=1;", "");
+      var _arr = a.split("if");
+      for (var i = 0; i < _arr.length; i++) {
+        if (_arr[i].indexOf(this.voiceText) != -1) {
+          if (_arr[i].indexOf("light=1") != -1) {
+            this.isLight = true;
+            this.iatRecorder.stop();
+            break;
+          } else if (_arr[i].indexOf("light=0") != -1) {
+            this.isLight = false;
+            this.iatRecorder.stop();
+            break;
+          }
+        }
       }
+      // if (this.voiceText == "开灯") {
+      //   this.isLight = true;
+      //   this.iatRecorder.stop();
+      // } else if (this.voiceText == "关灯") {
+      //   this.isLight = false;
+      //   this.iatRecorder.stop();
+      // }
       console.log(this.voiceText);
     },
     cancel() {
       this.vS = true;
     },
+    openVoice() {
+      var _this = this;
+      navigator.getUserMedia(
+        { audio: true },
+        function onSuccess(stream) {
+          console.log("已点击允许,开启成功");
+        },
+        function onError(error) {
+          _this.$message.error("请允许使用麦克风权限");
+          console.log("错误:", error);
+        }
+      );
+    },
   },
   mounted() {
-    this.iatRecorder = new IatRecorder("zh_cn", "mandarin", "5ff2d877"); //小语种-中文方言-appId
+    console.log(this.$store.state.function);
+    if (this.$store.state.function.indexOf("voiceOpen=1;") != -1) {
+      this.openVoice();
+    }
+    var a = this.$store.state.function
+      .replace(/\ +/g, "")
+      .replace(/[\r\n]/g, "")
+      .replace("voiceOpen=1;", "");
+    console.log(a);
+    if (a.indexOf("voice=1;") != -1) {
+      this.iatRecorder = new IatRecorder("zh_cn", "mandarin", "5ff2d877"); //小语种-中文方言-appId
+    }
   },
 };
 </script>

+ 679 - 0
src/components/functionShop.vue

@@ -0,0 +1,679 @@
+<template>
+  <!-- height: calc(100% - 67.5px) -->
+  <div style="width: 100%; height: 100%; background: #fff">
+    <div class="img">
+      <div class="left" style="width: 380px">
+        <div class="pFace">
+          <img :src="shibieImg" class="changeImg" alt />
+        </div>
+        <div class="nav">{{ isdetected }}</div>
+      </div>
+      <div class="controlZ">
+        <div id="screan" ref="dv">
+          <!--图片展示-->
+          <video
+            ref="video"
+            id="video_cam"
+            width="195"
+            height="156"
+            class="face"
+            autoplay
+            v-show="isCamera"
+          ></video>
+          <canvas
+            ref="canvasDOM"
+            width="195"
+            height="156"
+            class="kuang"
+            v-show="isCamera"
+          ></canvas>
+        </div>
+        <div class="shop">
+          <img src="../assets/img/shop/shop.png" alt="" />
+        </div>
+      </div>
+
+      <div class="cameraZ">
+        <!--开启摄像头-->
+        <div class="cameraBtn">
+          <div class="open" @click="callCamera" v-if="!isCamera">
+            <img src="../assets/img/open.png" alt />
+          </div>
+          <div class="close" @click="closeCamera" v-else>
+            <img src="../assets/img/close.png" alt />
+          </div>
+          <!-- @click="photograph"  -->
+          <div class="save" @click="check2" v-if="isCamera">
+            <img src="../assets/img/shibie.png" alt />
+          </div>
+        </div>
+        <!--确认-->
+        <div v-show="false" class="isPhoto">
+          <!--canvas截取流-->
+          <canvas ref="canvas" width="300" height="240" v-show="false"></canvas>
+        </div>
+      </div>
+    </div>
+    <div v-if="isCamera" class="isPhoto">
+      <!--canvas截取流-->
+      <span>截取的图片</span>
+      <div
+        style="width: 98%; overflow: auto; display: flex; margin: 20px 0 0 10px"
+      >
+        <div v-for="(res, index) in sampleArr" :key="index" class="gdt">
+          <img
+            :src="res.img[0]"
+            alt=""
+            style="margin-right: 10px; width: 195px; height: 156px"
+          />
+          <div class="spotNumber">{{ res.name }}</div>
+        </div>
+      </div>
+    </div>
+    <el-dialog
+      title="设置价格"
+      :visible.sync="updateMessage"
+      :append-to-body="true"
+      width="300px"
+      :before-close="handleClose"
+      class="dialog_diy"
+    >
+      <el-form class="over1">
+        <el-form-item
+          label="名称"
+          :label-width="formLabelWidth"
+          style="font-size: 16px !important"
+        >
+          <!-- {{ this.gameInfo.name }} -->
+          <el-input
+            clearable
+            type="primary"
+            v-model="upName"
+            style="width: 150px"
+            class="inputStyle"
+            placeholder="请输入商品名称"
+          ></el-input>
+        </el-form-item>
+        <el-form-item
+          label="价格"
+          :label-width="formLabelWidth"
+          style="font-size: 16px !important"
+        >
+          <!-- {{ this.gameInfo.name }} -->
+          <el-input-number
+            type="primary"
+            v-model="upPrice"
+            style="width: 150px"
+            class="inputStyle"
+            :controls="false"
+            placeholder="请输入商品价格"
+          ></el-input-number>
+        </el-form-item>
+      </el-form>
+      <!--  -->
+      <el-button class="update" @click="update">添加</el-button>
+      <el-button @click="cancel" style="font-size: 16px !important"
+        >取消</el-button
+      >
+    </el-dialog>
+    <!-- <el-dialog
+      title="识别"
+      :visible.sync="closeUpdateMessage"
+      :append-to-body="true"
+      width="300px"
+      :before-close="handleClose"
+      class="dialog_diy"
+    >
+      <div style="text-align: center; font-size: 16px !important">
+        已识别到"{{ this.resultImg.name }}"的图片
+      </div>
+      <el-button
+        @click="closeUpdateMessage = false"
+        style="margin: 20px 0 0 35%; font-size: 16px !important"
+        >确认</el-button
+      >
+    </el-dialog> -->
+  </div>
+</template>
+<script>
+import tracking from "@/assets/js/tracking-min.js";
+import "@/assets/js/face-min.js";
+import * as faceapi from "face-api.js";
+import "@tensorflow/tfjs";
+import * as mobilenet from "@tensorflow-models/mobilenet";
+import { log } from '@tensorflow/tfjs-core';
+
+export default {
+  data() {
+    return {
+      that: this,
+      img: [
+        require("../assets/img/light/screan.png"),
+        require("../assets/img/ai.png"),
+        require("../assets/img/tou1.png"),
+        require("../assets/img/policeNew.png"),
+      ],
+      shibieImg: require("../assets/img/face.png"),
+      isCamera: false,
+      count: 0,
+      change: 0,
+      closeUpdateMessage: false,
+      updateMessage: false,
+      upName: "",
+      upPrice: 0,
+      number: 0,
+      isdetected: "请放置需要识别的物品",
+      videoEl: {},
+      canvasEL: {},
+      formLabelWidth: "100px",
+      resultImg: {
+        img: [],
+        name: "",
+      },
+      // 预设样本图,支持本地,网络,beas64
+      sampleArr: [
+        // {
+        // name: "编号1",
+        // price: "0",
+        // img: []
+        // }
+      ],
+      sampleArr2: [
+        // {
+        // name: "编号1",
+        // price: "0",
+        // img: []
+        // }
+      ],
+      // 匹配图,支持本地,网络,beas64
+      detArr: [
+        //"" 图片1
+      ],
+      numberOne: 0,
+      // 匹配结果
+      resultArr: [],
+      // 人脸匹配矩阵数组对象转码结果
+      faceMatcher: null,
+    };
+  },
+  methods: {
+    cancel() {
+      this.updateMessage = false;
+      this.sampleArr[this.sampleArr.length - 1].name = "编号:" + this.number;
+      if (this.sampleArr.length > 0) {
+        // var a = document.getElementsByClassName("spot");
+        // a[0].style.display = "block";
+        this.fnsample();
+      }
+    },
+    update() {
+      if (this.upName == "") {
+        this.$message.error("请填写商品名称");
+        return;
+      } else if (this.upPrice == "") {
+        this.$message.error("请填写商品价格");
+        return;
+      }
+      this.change = 1;
+      this.number = this.number + 1;
+      if (this.change == 1) {
+        // if (this.sampleArr2.length > 0) {
+        //   this.sampleArr2[this.sampleArr2.length - 1].name = this.upName;
+        //   this.sampleArr2[this.sampleArr2.length - 1].price = this.upPrice;
+        //   this.isdetected =
+        //     "已识别到" + this.resultImg.name + "价格为:" + this.resultImg.price;
+        // }
+        this.sampleArr2.name = this.upName;
+        this.sampleArr2.price = this.upPrice;
+        this.sampleArr.push(this.sampleArr2);
+      }
+      if (this.sampleArr.length > 0) {
+        this.fnsample();
+      }
+      this.updateMessage = false;
+    },
+    // 调用摄像头
+    callCamera() {
+      let _this = this;
+      // H5调用电脑摄像头API
+      navigator.mediaDevices
+        .getUserMedia({
+          video: true,
+        })
+        .then((success) => {
+          _this.isCamera = true;
+          // 摄像头开启成功
+          _this.$refs["video"].srcObject = success;
+          // 实时拍照效果
+          _this.$refs["video"].play();
+
+          if (_this.$store.state.function.indexOf("object=1") != -1) {
+            // this.$message.error("摄像头开启失败,请检查摄像头是否可用!");
+
+            const video = this.videoEl;
+            const canvas = this.canvasEL;
+            const canvasContext = canvas.getContext("2d");
+            let tracker = new window.tracking.ObjectTracker("face");
+
+            // video.pause();
+            // video.src = "";
+            tracker.setInitialScale(4);
+            tracker.setStepSize(2);
+            tracker.setEdgesDensity(0.1);
+            window.tracking.track("#video_cam", tracker, { camera: true });
+            tracker.on("track", function (event) {
+              const { autoCaptureTrackTraking } = _this;
+              // canvasContext.clearRect(0, 0, canvas.width, canvas.height);
+              // event.data.forEach(function ({ x, y, width, height }) {
+              //   canvasContext.strokeStyle = "#FFFF";
+              //   canvasContext.strokeRect(x + 10, y - 30, width - 20, height);
+              //   canvasContext.font = "11px Helvetica";
+              //   canvasContext.fillStyle = "#fff";
+              // });
+              if (_this.sampleArr.length > 0) {
+                // _this.fnRun();
+                if (_this.$store.state.function.indexOf("pObject=1;") != -1) {
+                  _this.fnRun();
+                }
+              }
+              //   if (!(event.data.length == 0) && _this.count <= 10) {
+              //     if (_this.count < 0) _this.count = 0;
+              //     _this.count += 1;
+              //     if (_this.count > 10) {
+              //       if (_this.sampleArr.length == 0) {
+              //         _this.isdetected = "已检测到人脸";
+              //       }
+              //       // _this.isdetected = "已检测到人脸";
+              //     //   if (
+              //     //     _this.sampleArr.length > 0 &&
+              //     //     _this.$store.state.function.indexOf("police=1;") != -1
+              //     //   ) {
+              //         _this.fnRun();
+              //     //   }
+              //     }
+              //   } else {
+              //     _this.count -= 1;
+              //     if (_this.count < 0)
+              //       _this.isdetected = "请您保持脸部在画面中央";
+              //   }
+            });
+          }
+        })
+        .catch((error) => {
+          // console.error("摄像头开启失败,请检查摄像头是否可用!");
+          _this.$message.error("摄像头开启失败,请检查摄像头是否可用!");
+        });
+    },
+    // 拍照
+    photograph() {
+      let ctx = this.$refs["canvas"].getContext("2d");
+      // 把当前视频帧内容渲染到canvas上
+      ctx.drawImage(this.$refs["video"], 0, 0, 300, 240);
+      // 转base64格式、图片格式转换、图片质量压缩
+      let imgBase64 = this.$refs["canvas"].toDataURL("image/jpeg", 0.7); // 由字节转换为KB 判断大小
+
+      let str = imgBase64.replace("data:image/jpeg;base64,", "");
+      let strLength = str.length;
+      let fileLength = parseInt(strLength - (strLength / 8) * 2); // 图片尺寸  用于判断
+      let size = (fileLength / 1024).toFixed(2);
+      console.log(size); // 上传拍照信息  调用接口上传图片 .........
+
+      // this.detArr.push(imgBase64);3
+      this.sampleArr2 = {};
+      var json = { name: "", img: [] };
+      this.number = this.number + 1;
+      this.upName = "";
+      this.upPrice = "";
+      json.img.push(imgBase64);
+      // this.sampleArr.push(json);
+      this.sampleArr2 = json;
+      this.updateMessage = true;
+
+      //this.fnInit()
+      // this.resultArr.push(imgBase64);
+    },
+    // 关闭摄像头
+    closeCamera() {
+      if (!this.$refs["video"].srcObject) {
+        this.isCamera = false;
+        return;
+      }
+      let stream = this.$refs["video"].srcObject;
+      let tracks = stream.getTracks();
+      tracks.forEach((track) => {
+        track.stop();
+      });
+      this.$refs["video"].srcObject = null;
+      this.isCamera = false;
+    },
+
+    // 初始化模型加载,匹配矩阵
+    async fnInit() {
+      // 加载模型
+      await faceapi.loadFaceRecognitionModel("/static/models");
+      // 生成人脸匹配矩阵数组对象,样本图片同步转码
+    },
+    async fnsample() {
+      const labeledFaceDescriptors = await Promise.all(
+        this.sampleArr.map(async (item) => {
+          // 临时图片转码数据,将图片对象转数据矩阵对象
+          let descriptors = [];
+          for (let image of item.img) {
+            const imageEl = await faceapi.fetchImage(image);
+            descriptors.push(await faceapi.computeFaceDescriptor(imageEl));
+          }
+          // 返回图片用户和图片转码数组
+          return new faceapi.LabeledFaceDescriptors(item.name, descriptors);
+        })
+      );
+      // 人脸匹配矩阵数组对象转码结果
+      this.faceMatcher = new faceapi.FaceMatcher(labeledFaceDescriptors);
+    },
+    // 执行遍历识别匹配图片,数值误差越小越精确
+    fnRun() {
+      let ctx = this.$refs["canvas"].getContext("2d");
+      // 把当前视频帧内容渲染到canvas上
+      ctx.drawImage(this.$refs["video"], 0, 0, 300, 240);
+      // 转base64格式、图片格式转换、图片质量压缩
+      let imgBase64 = this.$refs["canvas"].toDataURL("image/jpeg", 0.7); // 由字节转换为KB 判断大小
+      this.detArr = [];
+      this.detArr.push(imgBase64);
+      this.detArr.forEach(async (img) => {
+        let ts = Date.now();
+        // 将图片对象转数据矩阵对象,进行匹配
+        const inputEl = await faceapi.fetchImage(img);
+        const inputDescriptor = await faceapi.computeFaceDescriptor(inputEl);
+        const bestMatch = await this.faceMatcher.findBestMatch(inputDescriptor);
+        // 结果
+        this.resultArr = [];
+        this.resultArr.push({
+          target: img,
+          result: bestMatch.toString(),
+          time: Date.now() - ts + "ms",
+          fps: Math.round(1000 / (Date.now() - ts)),
+        });
+        console.log(this.resultArr);
+        var a = document.getElementsByClassName("pFace");
+        for (var i = 0; i < this.sampleArr.length; i++) {
+          if (this.sampleArr[i].name == bestMatch.label) {
+            // this.closeUpdateMessage = true;
+            // if (this.change == 1) {
+            //   this.resultImg.name = this.upName;
+            // } else {
+            //   this.resultImg.name = this.sampleArr[i].name;
+            // }
+            this.isdetected =
+              "已识别到" +
+              this.sampleArr[i].name +
+              ",价格为" +
+              this.sampleArr[i].price +
+              "元";
+            this.shibieImg = this.sampleArr[i].img[0];
+            if (this.shibieImg.length > 0) {
+              a[0].style.width = "300px";
+            }
+            this.resultImg.img[0] = this.sampleArr[i].img[0];
+          }
+        }
+      });
+    },
+    handleClose(done) {
+      done();
+    },
+
+    // 更换匹配图
+    async fnChange(e) {
+      if (!e.target.files.length) return;
+      this.detArr = [];
+      this.resultArr = [];
+      // 将文件显示为图像并识别
+      e.target.files.forEach(async (file) => {
+        let ts = Date.now();
+        let img = await faceapi.bufferToImage(file);
+        const inputDescriptor = await faceapi.computeFaceDescriptor(img);
+        const bestMatch = await this.faceMatcher.findBestMatch(inputDescriptor);
+        // 结果
+        this.detArr.push(img.src);
+        this.resultArr.push({
+          target: file.name,
+          result: bestMatch.toString(),
+          time: Date.now() - ts + "ms",
+          fps: Math.round(1000 / (Date.now() - ts)),
+        });
+      });
+    },
+    async check() {
+      const webcamElement = document.getElementsByTagName("video")[0];
+      this.model = await mobilenet.load();
+      this.webcam = await tf.data.webcam(webcamElement);
+      console.log(this.model,this.webcam);
+    },
+    async check2() {
+      const img = await this.webcam.capture();
+      const predictions = await this.model.classify(img);
+      img.dispose();
+      return predictions;
+    },
+  },
+
+  mounted() {
+    // console.log(this.$store.state.function);
+    this.$nextTick(() => {
+      this.fnInit();
+      // this.fnInit().then(() => this.fnRun());
+    });
+
+    if (this.$store.state.function.indexOf("screen=1;") != -1) {
+      // this.$message.error("摄像头开启失败,请检查摄像头是否可用!");
+      this.callCamera();
+      this.check();
+    }
+    this.videoEl = this.$refs.video;
+    this.canvasEL = this.$refs.canvasDOM;
+  },
+};
+</script>
+
+<style scoped>
+html,
+body {
+  margin: 0;
+  padding: 0;
+  width: 100%;
+}
+
+.dialog_diy >>> .el-form-item__label {
+  width: 50px !important;
+  margin-left: 35px !important;
+}
+
+.dialog_diy >>> .el-form-item__content {
+  margin-left: 0 !important;
+}
+
+.update {
+  margin-left: 20%;
+  font-size: 16px !important;
+}
+
+.tip {
+  margin: 25px 0 30px 20px;
+}
+
+#screan > img,
+.shop > img {
+  width: 100%;
+  height: 100%;
+  user-select: none;
+}
+
+.img {
+  display: flex;
+  flex-direction: row;
+  justify-content: flex-start;
+  justify-content: center;
+  width: 100%;
+  height: 500px;
+  position: relative;
+}
+#screan {
+  width: 185px;
+  position: absolute;
+  z-index: 5;
+  top: 210px;
+  left: 130px;
+}
+.shop {
+  width: 470px;
+  position: absolute;
+  top: 100px;
+}
+
+.button {
+  color: #fff;
+  background: #8ca1de;
+  width: 550px;
+  height: 55px;
+  font-size: 20px;
+  text-align: center;
+  line-height: 55px;
+  position: absolute;
+  bottom: 10%;
+  left: 50%;
+  transform: translateX(-50%);
+  user-select: none;
+}
+
+.right {
+  width: 40px;
+  position: absolute;
+  left: 55%;
+  top: 70%;
+  display: none;
+}
+
+.dark {
+  background: #5b79d0;
+  cursor: pointer;
+}
+
+.controlZ {
+  width: 490px;
+  height: 900px;
+  /* margin-left: calc(50% - (490px / 2)); */
+  position: relative;
+}
+
+.cameraZ {
+  display: flex;
+  height: 340px;
+  flex-direction: column;
+  flex-wrap: nowrap;
+  width: 300px;
+}
+
+.cameraBtn {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+
+.cameraBtn button {
+  margin: 0 0 10px 0;
+}
+
+.face {
+  position: absolute;
+  z-index: 1;
+  padding: 5px 0px;
+}
+
+.kuang {
+  padding: 26.5px 0;
+  position: absolute;
+  z-index: 2;
+}
+
+.pFace {
+  /* width: 300px; */
+  /* height: 240px; */
+  width: 150px;
+  margin: 0 auto;
+  margin-top: 220px;
+}
+
+.close > img,
+.save > img,
+.pFace > img,
+.open > img,
+.spotPhoto > img {
+  width: 100%;
+  height: 100%;
+}
+
+.cameraBtn {
+  margin-top: 80px;
+}
+
+.close {
+  margin-bottom: 25px;
+}
+
+.isPhoto {
+  height: 410px;
+  padding: 80px 0 0 0;
+  box-sizing: border-box;
+  background: #fff;
+}
+
+.isPhoto > span {
+  font-size: 25px;
+  color: #ccc;
+  margin-left: 10px;
+}
+
+.nav {
+  text-align: center;
+  font-size: 32px;
+  color: #ccc;
+}
+
+.spot {
+  background: #64ff64;
+  color: #fff;
+  width: 140px;
+  height: 40px;
+  text-align: center;
+  line-height: 40px;
+  border-radius: 20px;
+  margin-top: 25px;
+  cursor: pointer;
+  display: none;
+}
+
+.spotNumber {
+  text-align: center;
+  margin: 0 auto;
+  font-size: 20px;
+  color: #8c8c8c;
+}
+
+.spotPhoto {
+  width: 300px;
+  height: 245px;
+}
+
+.spotPhoto {
+  margin-top: 20px;
+  font-size: 20px;
+}
+
+.gdt {
+  display: flex;
+  flex-direction: column;
+}
+
+.inputStyle >>> .el-input__inner {
+  text-align: left;
+}
+</style>

+ 1 - 1
src/components/shop.vue

@@ -436,7 +436,7 @@ export default {
   },
   methods: {
     go() {
-      this.$router.push("/blockly");
+      this.$router.push("/blockly?typeN=shop");
     },
     setPan(value) {
       this.panThing = value;

+ 6 - 0
src/router/index.js

@@ -26,6 +26,7 @@ import functionFan2 from '@/components/functionFan3';
 import functionLight from '@/components/functionLight';
 import voice from '@/components/voiceDemo';
 import functionCurtain from '@/components/functionCurtain';
+import functionShop from '@/components/functionShop';
 
 Vue.use(Router).use(ElementUI).use(SlideVerify);
 
@@ -86,6 +87,11 @@ export default new Router({
         name: 'shop',
         component: shop
     },
+    {
+        path: '/Fshop',
+        name: 'Fshop',
+        component: functionShop
+    },
     {
         path: '/demo',
         name: 'demo',

+ 232 - 5
yarn.lock

@@ -14,6 +14,11 @@
   dependencies:
     "rimraf" "^3.0.2"
 
+"@tensorflow-models/mobilenet@^2.1.0":
+  "integrity" "sha512-JjqT9ijHDFA2FEpUGWg7H2lQ0GrMuE2VmiCRBYmUew6b4JKht8LXDjG5HxZh95YH6c/25sZWTpGeHbquloH+hw=="
+  "resolved" "https://registry.npmmirror.com/@tensorflow-models/mobilenet/-/mobilenet-2.1.0.tgz"
+  "version" "2.1.0"
+
 "@tensorflow/tfjs-backend-cpu@3.14.0":
   "integrity" "sha512-Sk0B8p1QUqxEVsOmBNxxX2BUgeR8mfXVc6JZM5lWKP79bYy8YGzuiitrSrcxAhEFAANgmDVvM9FTTVR25a0CWg=="
   "resolved" "https://registry.npmmirror.com/@tensorflow/tfjs-backend-cpu/-/tfjs-backend-cpu-3.14.0.tgz"
@@ -22,6 +27,14 @@
     "@types/seedrandom" "2.4.27"
     "seedrandom" "2.4.3"
 
+"@tensorflow/tfjs-backend-cpu@3.18.0":
+  "integrity" "sha512-LcSqlylzGtpgngcMFIL3q9Q3eVaPRJ7ITZt7ivhzkCj4R5ZsnPa9qM3DCVihkQ77heAwSw4hPTo2jp5C4mJ4Cg=="
+  "resolved" "https://registry.npmmirror.com/@tensorflow/tfjs-backend-cpu/-/tfjs-backend-cpu-3.18.0.tgz"
+  "version" "3.18.0"
+  dependencies:
+    "@types/seedrandom" "2.4.27"
+    "seedrandom" "2.4.3"
+
 "@tensorflow/tfjs-backend-webgl@^3.14.0", "@tensorflow/tfjs-backend-webgl@^3.9.0":
   "integrity" "sha512-P3qB9LmC69+9ut9cC76mGUS4tLIFk95qmWUaUP1Zk4R3iLkiRnLE4xmBxGnm3rNckoWS77Ujpel58i4QK1BmCw=="
   "resolved" "https://registry.npmmirror.com/@tensorflow/tfjs-backend-webgl/-/tfjs-backend-webgl-3.14.0.tgz"
@@ -34,12 +47,29 @@
     "@types/webgl2" "0.0.6"
     "seedrandom" "2.4.3"
 
-"@tensorflow/tfjs-converter@^3.14.0", "@tensorflow/tfjs-converter@^3.9.0":
+"@tensorflow/tfjs-backend-webgl@3.18.0":
+  "integrity" "sha512-3NknSzS1oX2BEBOrpjPMZl823S12RgshQthmIbG6QADHb4bCJA8aM4UjWpw+3bNQnRKbRDQdFbuvj10Un79s2A=="
+  "resolved" "https://registry.npmmirror.com/@tensorflow/tfjs-backend-webgl/-/tfjs-backend-webgl-3.18.0.tgz"
+  "version" "3.18.0"
+  dependencies:
+    "@tensorflow/tfjs-backend-cpu" "3.18.0"
+    "@types/offscreencanvas" "~2019.3.0"
+    "@types/seedrandom" "2.4.27"
+    "@types/webgl-ext" "0.0.30"
+    "@types/webgl2" "0.0.6"
+    "seedrandom" "2.4.3"
+
+"@tensorflow/tfjs-converter@^3.1.0", "@tensorflow/tfjs-converter@^3.14.0", "@tensorflow/tfjs-converter@^3.9.0":
   "integrity" "sha512-cz8dpfOU5kOeY8SyNdmg5Pv836fYmZGH/6j3VaslALkqK63TOgVGpWUzi7f10KEZCZUk29TTVeu3u9zqobSBpA=="
   "resolved" "https://registry.npmmirror.com/@tensorflow/tfjs-converter/-/tfjs-converter-3.14.0.tgz"
   "version" "3.14.0"
 
-"@tensorflow/tfjs-core@^3.14.0", "@tensorflow/tfjs-core@^3.9.0", "@tensorflow/tfjs-core@3.14.0":
+"@tensorflow/tfjs-converter@3.18.0":
+  "integrity" "sha512-hpChA+zVNQOVwRnCfqDb1WI9jbEAKA6DuEm4m75Zb3dIlE6VVooDmAaHBhlc++z2q2G1sBzF9A4Bv48SUpN6vA=="
+  "resolved" "https://registry.npmmirror.com/@tensorflow/tfjs-converter/-/tfjs-converter-3.18.0.tgz"
+  "version" "3.18.0"
+
+"@tensorflow/tfjs-core@^3.1.0", "@tensorflow/tfjs-core@^3.14.0", "@tensorflow/tfjs-core@^3.9.0", "@tensorflow/tfjs-core@3.14.0":
   "integrity" "sha512-bS/iuI9BpDVZuqEPfLzIFLoHYd+ihNIiux+EXveuFO8phPx7FkgPqakatHYLzrdYlOfAXurIxIlGNAzVKNQOUQ=="
   "resolved" "https://registry.npmmirror.com/@tensorflow/tfjs-core/-/tfjs-core-3.14.0.tgz"
   "version" "3.14.0"
@@ -64,11 +94,68 @@
     "node-fetch" "~2.1.2"
     "seedrandom" "2.4.3"
 
+"@tensorflow/tfjs-core@3.18.0":
+  "integrity" "sha512-gMxisZozqsr5sCKlphF/eVBLg91MjlBiN60tjX8hJAu0WlSn6Gi5k65GNIL+Pq6hrxpvImcfdCmTH/2XJVZ0Mg=="
+  "resolved" "https://registry.npmmirror.com/@tensorflow/tfjs-core/-/tfjs-core-3.18.0.tgz"
+  "version" "3.18.0"
+  dependencies:
+    "@types/long" "^4.0.1"
+    "@types/offscreencanvas" "~2019.3.0"
+    "@types/seedrandom" "2.4.27"
+    "@types/webgl-ext" "0.0.30"
+    "@webgpu/types" "^0.1.16"
+    "long" "4.0.0"
+    "node-fetch" "~2.6.1"
+    "seedrandom" "2.4.3"
+
+"@tensorflow/tfjs-data@3.18.0":
+  "integrity" "sha512-s43vISJh8K/UN2E2zGRhtj/Kyn8dr4ll8EQkapwzm7fGO9afXCnMsTp6rkZq3fFXouCYA2k1B/j7JssIDr50+w=="
+  "resolved" "https://registry.npmmirror.com/@tensorflow/tfjs-data/-/tfjs-data-3.18.0.tgz"
+  "version" "3.18.0"
+  dependencies:
+    "@types/node-fetch" "^2.1.2"
+    "node-fetch" "~2.6.1"
+
+"@tensorflow/tfjs-layers@3.18.0":
+  "integrity" "sha512-AV7yDnPlH+RCcq8VPqkX1iyEchObE+e66m0XmJvLj+ncfKHYLa+39ZNroUA+OgB2/cMG6jgq77R4EhZbT6hwJA=="
+  "resolved" "https://registry.npmmirror.com/@tensorflow/tfjs-layers/-/tfjs-layers-3.18.0.tgz"
+  "version" "3.18.0"
+
+"@tensorflow/tfjs@^3.18.0":
+  "integrity" "sha512-mOzz4jJdgIpqFS7EHndVuxrQnLUDVIKGyTqOPTYps89fZwcOFfTVxi4BHemDNQpqlVE8IaGh9UUxVXpjgPY5+Q=="
+  "resolved" "https://registry.npmmirror.com/@tensorflow/tfjs/-/tfjs-3.18.0.tgz"
+  "version" "3.18.0"
+  dependencies:
+    "@tensorflow/tfjs-backend-cpu" "3.18.0"
+    "@tensorflow/tfjs-backend-webgl" "3.18.0"
+    "@tensorflow/tfjs-converter" "3.18.0"
+    "@tensorflow/tfjs-core" "3.18.0"
+    "@tensorflow/tfjs-data" "3.18.0"
+    "@tensorflow/tfjs-layers" "3.18.0"
+    "argparse" "^1.0.10"
+    "chalk" "^4.1.0"
+    "core-js" "3"
+    "regenerator-runtime" "^0.13.5"
+    "yargs" "^16.0.3"
+
 "@types/long@^4.0.1":
   "integrity" "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w=="
   "resolved" "https://registry.npmmirror.com/@types/long/-/long-4.0.1.tgz"
   "version" "4.0.1"
 
+"@types/node-fetch@^2.1.2":
+  "integrity" "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A=="
+  "resolved" "https://registry.npmmirror.com/@types/node-fetch/-/node-fetch-2.6.2.tgz"
+  "version" "2.6.2"
+  dependencies:
+    "@types/node" "*"
+    "form-data" "^3.0.0"
+
+"@types/node@*":
+  "integrity" "sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA=="
+  "resolved" "https://registry.npmmirror.com/@types/node/-/node-18.0.0.tgz"
+  "version" "18.0.0"
+
 "@types/offscreencanvas@~2019.3.0":
   "integrity" "sha512-esIJx9bQg+QYF0ra8GnvfianIY8qWB0GBx54PK5Eps6m+xTj86KLavHv6qDhzKcu5UUOgNfJ2pWaIIV7TRUd9Q=="
   "resolved" "https://registry.npmmirror.com/@types/offscreencanvas/-/offscreencanvas-2019.3.0.tgz"
@@ -99,6 +186,11 @@
   "resolved" "https://registry.npmmirror.com/@types/webgl2/-/webgl2-0.0.6.tgz"
   "version" "0.0.6"
 
+"@webgpu/types@^0.1.16":
+  "integrity" "sha512-MFb5oyxX+A7PWQNjcY3kSCSG2FAHaBo7IJBWtxWFgsS20FtY3D9UY7lYqLZ6avS8fSkdSylIS4qiHzFlQUdXag=="
+  "resolved" "https://registry.npmmirror.com/@webgpu/types/-/types-0.1.20.tgz"
+  "version" "0.1.20"
+
 "abab@^2.0.0":
   "integrity" "sha1-wLZ4+zLWD8EhnHhNaoJv44Wut5o="
   "resolved" "https://registry.npm.taobao.org/abab/download/abab-2.0.5.tgz"
@@ -206,6 +298,11 @@
   "resolved" "https://registry.nlark.com/ansi-regex/download/ansi-regex-3.0.0.tgz"
   "version" "3.0.0"
 
+"ansi-regex@^5.0.1":
+  "integrity" "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="
+  "resolved" "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz"
+  "version" "5.0.1"
+
 "ansi-styles@^2.2.1":
   "integrity" "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4="
   "resolved" "https://registry.nlark.com/ansi-styles/download/ansi-styles-2.2.1.tgz"
@@ -218,6 +315,13 @@
   dependencies:
     "color-convert" "^1.9.0"
 
+"ansi-styles@^4.0.0", "ansi-styles@^4.1.0":
+  "integrity" "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="
+  "resolved" "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz"
+  "version" "4.3.0"
+  dependencies:
+    "color-convert" "^2.0.1"
+
 "anymatch@^2.0.0":
   "integrity" "sha1-vLJLTzeTTZqnrBe0ra+J58du8us="
   "resolved" "https://registry.nlark.com/anymatch/download/anymatch-2.0.0.tgz"
@@ -239,7 +343,7 @@
   "resolved" "https://registry.nlark.com/aproba/download/aproba-1.2.0.tgz"
   "version" "1.2.0"
 
-"argparse@^1.0.7":
+"argparse@^1.0.10", "argparse@^1.0.7":
   "integrity" "sha1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE="
   "resolved" "https://registry.nlark.com/argparse/download/argparse-1.0.10.tgz"
   "version" "1.0.10"
@@ -1568,6 +1672,14 @@
     "escape-string-regexp" "^1.0.5"
     "supports-color" "^5.3.0"
 
+"chalk@^4.1.0":
+  "integrity" "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="
+  "resolved" "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz"
+  "version" "4.1.2"
+  dependencies:
+    "ansi-styles" "^4.1.0"
+    "supports-color" "^7.1.0"
+
 "check-types@^7.3.0":
   "integrity" "sha1-A3jsG5YW7HH3dJMaPGUW+tjBUvQ="
   "resolved" "https://registry.nlark.com/check-types/download/check-types-7.4.0.tgz"
@@ -1693,6 +1805,15 @@
     "strip-ansi" "^3.0.1"
     "wrap-ansi" "^2.0.0"
 
+"cliui@^7.0.2":
+  "integrity" "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ=="
+  "resolved" "https://registry.npmmirror.com/cliui/-/cliui-7.0.4.tgz"
+  "version" "7.0.4"
+  dependencies:
+    "string-width" "^4.2.0"
+    "strip-ansi" "^6.0.0"
+    "wrap-ansi" "^7.0.0"
+
 "clone@^1.0.2":
   "integrity" "sha1-2jCcwmPfFZlMaIypAheco8fNfH4="
   "resolved" "https://registry.nlark.com/clone/download/clone-1.0.4.tgz"
@@ -1739,11 +1860,23 @@
   dependencies:
     "color-name" "1.1.3"
 
+"color-convert@^2.0.1":
+  "integrity" "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="
+  "resolved" "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz"
+  "version" "2.0.1"
+  dependencies:
+    "color-name" "~1.1.4"
+
 "color-name@^1.0.0", "color-name@1.1.3":
   "integrity" "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
   "resolved" "https://registry.nlark.com/color-name/download/color-name-1.1.3.tgz"
   "version" "1.1.3"
 
+"color-name@~1.1.4":
+  "integrity" "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
+  "resolved" "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz"
+  "version" "1.1.4"
+
 "color-string@^0.3.0":
   "integrity" "sha1-J9RvtnAlxcL6JZk7+/V55HhBuZE="
   "resolved" "https://registry.nlark.com/color-string/download/color-string-0.3.0.tgz"
@@ -1795,7 +1928,7 @@
   "resolved" "https://registry.nlark.com/colors/download/colors-1.1.2.tgz"
   "version" "1.1.2"
 
-"combined-stream@^1.0.6", "combined-stream@~1.0.6":
+"combined-stream@^1.0.6", "combined-stream@^1.0.8", "combined-stream@~1.0.6":
   "integrity" "sha1-w9RaizT9cwYxoRCoolIGgrMdWn8="
   "resolved" "https://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.8.tgz"
   "version" "1.0.8"
@@ -1949,6 +2082,11 @@
   "resolved" "https://registry.nlark.com/core-js/download/core-js-2.6.12.tgz?cache=0&sync_timestamp=1624966012065&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcore-js%2Fdownload%2Fcore-js-2.6.12.tgz"
   "version" "2.6.12"
 
+"core-js@3":
+  "integrity" "sha512-oAKwkj9xcWNBAvGbT//WiCdOMpb9XQG92/Fe3ABFM/R16BsHgePG00mFOgKf7IsCtfj8tA1kHtf/VwErhriz5Q=="
+  "resolved" "https://registry.npmmirror.com/core-js/-/core-js-3.23.3.tgz"
+  "version" "3.23.3"
+
 "core-util-is@~1.0.0", "core-util-is@1.0.2":
   "integrity" "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
   "resolved" "https://registry.nlark.com/core-util-is/download/core-util-is-1.0.2.tgz"
@@ -2679,6 +2817,11 @@
     "minimalistic-assert" "^1.0.1"
     "minimalistic-crypto-utils" "^1.0.1"
 
+"emoji-regex@^8.0.0":
+  "integrity" "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
+  "resolved" "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz"
+  "version" "8.0.0"
+
 "emojis-list@^2.0.0":
   "integrity" "sha1-TapNnbAPmBmIDHn6RXrlsJof04k="
   "resolved" "https://registry.npm.taobao.org/emojis-list/download/emojis-list-2.1.0.tgz"
@@ -3212,6 +3355,15 @@
   "resolved" "https://registry.npm.taobao.org/forever-agent/download/forever-agent-0.6.1.tgz"
   "version" "0.6.1"
 
+"form-data@^3.0.0":
+  "integrity" "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg=="
+  "resolved" "https://registry.npmmirror.com/form-data/-/form-data-3.0.1.tgz"
+  "version" "3.0.1"
+  dependencies:
+    "asynckit" "^0.4.0"
+    "combined-stream" "^1.0.8"
+    "mime-types" "^2.1.12"
+
 "form-data@~2.3.2":
   "integrity" "sha1-3M5SwF9kTymManq5Nr1yTO/786Y="
   "resolved" "https://registry.npm.taobao.org/form-data/download/form-data-2.3.3.tgz"
@@ -3280,6 +3432,11 @@
   "resolved" "https://registry.npm.taobao.org/get-caller-file/download/get-caller-file-1.0.3.tgz"
   "version" "1.0.3"
 
+"get-caller-file@^2.0.5":
+  "integrity" "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="
+  "resolved" "https://registry.npmmirror.com/get-caller-file/-/get-caller-file-2.0.5.tgz"
+  "version" "2.0.5"
+
 "get-intrinsic@^1.0.2", "get-intrinsic@^1.1.1":
   "integrity" "sha1-FfWfN2+FXERpY5SPDSTNNje0q8Y="
   "resolved" "https://registry.nlark.com/get-intrinsic/download/get-intrinsic-1.1.1.tgz"
@@ -3429,6 +3586,11 @@
   "resolved" "https://registry.nlark.com/has-flag/download/has-flag-3.0.0.tgz"
   "version" "3.0.0"
 
+"has-flag@^4.0.0":
+  "integrity" "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
+  "resolved" "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz"
+  "version" "4.0.0"
+
 "has-symbols@^1.0.1", "has-symbols@^1.0.2":
   "integrity" "sha1-Fl0wcMADCXUqEjakeTMeOsVvFCM="
   "resolved" "https://registry.nlark.com/has-symbols/download/has-symbols-1.0.2.tgz"
@@ -3981,6 +4143,11 @@
   "resolved" "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-2.0.0.tgz"
   "version" "2.0.0"
 
+"is-fullwidth-code-point@^3.0.0":
+  "integrity" "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
+  "resolved" "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz"
+  "version" "3.0.0"
+
 "is-glob@^3.1.0":
   "integrity" "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo="
   "resolved" "https://registry.nlark.com/is-glob/download/is-glob-3.1.0.tgz?cache=0&sync_timestamp=1624543039732&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fis-glob%2Fdownload%2Fis-glob-3.1.0.tgz"
@@ -6344,6 +6511,11 @@
   "resolved" "https://registry.nlark.com/regenerator-runtime/download/regenerator-runtime-0.11.1.tgz?cache=0&sync_timestamp=1626993001371&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fregenerator-runtime%2Fdownload%2Fregenerator-runtime-0.11.1.tgz"
   "version" "0.11.1"
 
+"regenerator-runtime@^0.13.5":
+  "integrity" "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA=="
+  "resolved" "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz"
+  "version" "0.13.9"
+
 "regenerator-transform@^0.10.0":
   "integrity" "sha1-HkmWg3Ix2ot/PPQRTXG1aRoGgN0="
   "resolved" "https://registry.nlark.com/regenerator-transform/download/regenerator-transform-0.10.1.tgz"
@@ -6636,7 +6808,7 @@
     "ajv" "^6.1.0"
     "ajv-keywords" "^3.1.0"
 
-"seedrandom@2.4.3":
+"seedrandom@~2.4.3", "seedrandom@2.4.3":
   "integrity" "sha512-2CkZ9Wn2dS4mMUWQaXLsOAfGD+irMlLEeSP3cMxpGbgyOOzJGFa+MWCOMTOCMyZinHRPxyOj/S/C57li/1to6Q=="
   "resolved" "https://registry.npmmirror.com/seedrandom/-/seedrandom-2.4.3.tgz"
   "version" "2.4.3"
@@ -7068,6 +7240,15 @@
     "is-fullwidth-code-point" "^2.0.0"
     "strip-ansi" "^4.0.0"
 
+"string-width@^4.1.0", "string-width@^4.2.0":
+  "integrity" "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="
+  "resolved" "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz"
+  "version" "4.2.3"
+  dependencies:
+    "emoji-regex" "^8.0.0"
+    "is-fullwidth-code-point" "^3.0.0"
+    "strip-ansi" "^6.0.1"
+
 "string.prototype.trimend@^1.0.4":
   "integrity" "sha1-51rpDClCxjUEaGwYsoe0oLGkX4A="
   "resolved" "https://registry.npm.taobao.org/string.prototype.trimend/download/string.prototype.trimend-1.0.4.tgz?cache=0&sync_timestamp=1614127461586&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstring.prototype.trimend%2Fdownload%2Fstring.prototype.trimend-1.0.4.tgz"
@@ -7098,6 +7279,13 @@
   dependencies:
     "ansi-regex" "^3.0.0"
 
+"strip-ansi@^6.0.0", "strip-ansi@^6.0.1":
+  "integrity" "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="
+  "resolved" "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz"
+  "version" "6.0.1"
+  dependencies:
+    "ansi-regex" "^5.0.1"
+
 "strip-bom@^2.0.0":
   "integrity" "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4="
   "resolved" "https://registry.nlark.com/strip-bom/download/strip-bom-2.0.0.tgz"
@@ -7178,6 +7366,13 @@
   dependencies:
     "has-flag" "^3.0.0"
 
+"supports-color@^7.1.0":
+  "integrity" "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="
+  "resolved" "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz"
+  "version" "7.2.0"
+  dependencies:
+    "has-flag" "^4.0.0"
+
 "svgo@^0.7.0":
   "integrity" "sha1-n1dyQTlSE1xv779Ar+ak+qiLS7U="
   "resolved" "https://registry.nlark.com/svgo/download/svgo-0.7.2.tgz"
@@ -7996,6 +8191,15 @@
     "string-width" "^1.0.1"
     "strip-ansi" "^3.0.1"
 
+"wrap-ansi@^7.0.0":
+  "integrity" "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q=="
+  "resolved" "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz"
+  "version" "7.0.0"
+  dependencies:
+    "ansi-styles" "^4.0.0"
+    "string-width" "^4.1.0"
+    "strip-ansi" "^6.0.0"
+
 "wrappy@1":
   "integrity" "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
   "resolved" "https://registry.nlark.com/wrappy/download/wrappy-1.0.2.tgz?cache=0&sync_timestamp=1619133505879&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fwrappy%2Fdownload%2Fwrappy-1.0.2.tgz"
@@ -8046,11 +8250,21 @@
   "resolved" "https://registry.npm.taobao.org/y18n/download/y18n-4.0.3.tgz?cache=0&sync_timestamp=1617822684820&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fy18n%2Fdownload%2Fy18n-4.0.3.tgz"
   "version" "4.0.3"
 
+"y18n@^5.0.5":
+  "integrity" "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="
+  "resolved" "https://registry.npmmirror.com/y18n/-/y18n-5.0.8.tgz"
+  "version" "5.0.8"
+
 "yallist@^2.1.2":
   "integrity" "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI="
   "resolved" "https://registry.npm.taobao.org/yallist/download/yallist-2.1.2.tgz"
   "version" "2.1.2"
 
+"yargs-parser@^20.2.2":
+  "integrity" "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w=="
+  "resolved" "https://registry.npmmirror.com/yargs-parser/-/yargs-parser-20.2.9.tgz"
+  "version" "20.2.9"
+
 "yargs-parser@^4.2.0":
   "integrity" "sha1-KczqwNxPA8bIe0qfIX3RjJ90hxw="
   "resolved" "https://registry.nlark.com/yargs-parser/download/yargs-parser-4.2.1.tgz"
@@ -8065,6 +8279,19 @@
   dependencies:
     "camelcase" "^4.1.0"
 
+"yargs@^16.0.3":
+  "integrity" "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw=="
+  "resolved" "https://registry.npmmirror.com/yargs/-/yargs-16.2.0.tgz"
+  "version" "16.2.0"
+  dependencies:
+    "cliui" "^7.0.2"
+    "escalade" "^3.1.1"
+    "get-caller-file" "^2.0.5"
+    "require-directory" "^2.1.1"
+    "string-width" "^4.2.0"
+    "y18n" "^5.0.5"
+    "yargs-parser" "^20.2.2"
+
 "yargs@^8.0.2":
   "integrity" "sha1-YpmpBVsc78lp/355wdkY3Osiw2A="
   "resolved" "https://registry.nlark.com/yargs/download/yargs-8.0.2.tgz?cache=0&sync_timestamp=1626358476652&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fyargs%2Fdownload%2Fyargs-8.0.2.tgz"