Closed aohan237 closed 4 years ago
Same here. On Android Wechat 7.0.10, posenet model detections always have 0 score. Please solve this issue as soon as possible.
@iooops
it seems to be the wx.createOffscreenCanvas() problem create a canvas by hand will be solve.
https://github.com/HunterXuan/wx-tfjs-demo/issues/19
<camera frame-size="medium" bindinitdone="cameraInit" binderror="cameraError"> <cax id="stage"></cax> <canvas type="webgl" id="myCanvas" hidden="{{ true }}"></canvas> </camera>
this solution will be fine. just add a webgl canvas on camera by hand .
it seems that android wechat 7.0.10 is a milestone update . it updates things on webgl and tests do not cover too much about it so be careful with android wechat 7.0.10
How did you configure it in plugin.configPlugin?
if (!hasConfigPlugin) {
plugin.configPlugin({
fetchFunc: fetchWechat.fetchFunc(),
tf,
canvas: wx.createOffscreenCanvas()
}, false);
//hasConfigPlugin = true;
}
What about the created webgl canvas?
@iooops the first answer...
Do you have sample repo?
sorry ,no
Ok I figured it out. Here's my solution.
var res = wx.getSystemInfoSync() let iOS = res.system.startsWith('iOS') const query = wx.createSelectorQuery() query.select('#myCanvas').node().exec((res) => { const canvas = res[0].node const gl = canvas.getContext('webgl') console.log('!!',canvas) plugin.configPlugin({ // polyfill fetch function fetchFunc: fetchWechat.fetchFunc(), // inject tfjs runtime tf, // provide webgl canvas canvas: iOS ? wx.createOffscreenCanvas() : canvas, backendName: 'wechat-webgl-' + Math.random() }); this.init() })
@aohan237 thanks, WeChat engineers are looking into the problem, will update here if it is fixed.
@pyu10055 thanks for updating information,too
@aohan237 Updates from WeChat, this will be fixed in the upcoming wechat common lib version 2.10.1 (hopeful released by tomorrow). Please try it out, and let us know if this issue is fixed. thanks.
@aohan237 Updates from WeChat, this will be fixed in the upcoming wechat common lib version 2.10.1 (hopeful released by tomorrow). Please try it out, and let us know if this issue is fixed. thanks.
Wechat common lib version 2.10.1 didn't fix this problem
@allrightzhu any luck with the latest wechat version 2.10.3? thanks
@allrightzhu any luck with the latest wechat version 2.10.3? thanks
It's ok on new version.
thanks for confirming.
as the title said, on android wechat7.0.10, load cocossd model error, shows tensorshape is zero error
any older version of android wechat works fine