PaddlePaddle / Paddle.js

Paddle.js is a web project for Baidu PaddlePaddle, which is an open source deep learning framework running in the browser. Paddle.js can either load a pre-trained model, or transforming a model from paddle-hub with model transforming tools provided by Paddle.js. It could run in every browser with WebGL/WebGPU/WebAssembly supported. It could also run in Baidu Smartprogram and WX miniprogram.
https://paddlejs.baidu.com
Apache License 2.0
975 stars 138 forks source link

使用vite时报错 opencv_ocr.js:46 Uncaught ReferenceError: Module is not defined #472

Closed chenqianhe closed 1 year ago

chenqianhe commented 2 years ago

使用vite时会有针对 opencv_ocr.js 的报错

opencv_ocr.js:46 Uncaught ReferenceError: Module is not defined
    at opencv_ocr.js:46:5
    at opencv_ocr.js:11:22
    at node_modules/@paddlejs-mediapipe/opencv/library/opencv_ocr.js (opencv_ocr.js:22:1)
    at __require (chunk-RSJERJUL.js?v=aa02e290:3:50)
    at dep:@paddlejs-mediapipe_opencv_library_opencv_ocr:1:16
zlq4863947 commented 1 year ago

我也报这个错

chenqianhe commented 1 year ago

我也报这个错

https://github.com/PaddlePaddle/FastDeploy/blob/17a118919913a3c84b57940b9e0a5c19b2835f37/examples/application/js/web_demo/src/pages/cv/ocr/TextRecognition/index.html#L4

我把整个都重新搞了下;但是cv这个没源码,问题只能这么解决

zlq4863947 commented 1 year ago

我也报这个错

https://github.com/PaddlePaddle/FastDeploy/blob/17a118919913a3c84b57940b9e0a5c19b2835f37/examples/application/js/web_demo/src/pages/cv/ocr/TextRecognition/index.html#L4

我把整个都重新搞了下;但是cv这个没源码,问题只能这么解决

非常感谢,醍醐灌顶啊,终于解决了这个问题!!

Banqc0621 commented 3 months ago

没看明白,是怎样解决的呢?