HunterXuan / wx-tfjs-demo

微信小程序运行 TensorFlow 的 Demo
https://hunterx.xyz/retry-tfjs-on-wx.html
525 stars 100 forks source link

通用物体识别的box不显示 #22

Closed 2H0U closed 4 years ago

2H0U commented 4 years ago

你好,我运行通用物体识别(coco-ssd) demo已经识别出物体,box也有数据,这些都已经在调试模式下确认,但是box并没有画在屏幕上。我做的唯一修改是把pages/coco-ssd/index.wxml里的canvas改成了<canvas type="webgl" id="canvas" hidden = "{{true}}"></canvas>。这是因为我也遇到了这个问题new wechat verison 7.0.10 on android,all classes's probability are 0.

请帮忙解决,谢谢。

HunterXuan commented 4 years ago

按照下面的代码改下,再试试吧。

<view class="page">
  <view class="page__bd page__bd_spacing">
    <camera
      device-position="back"
      flash="off"
      frame-size="medium"
      class="camera"
    >
      <canvas id="canvas" canvas-id="canvas" class="canvas"></canvas>
    </camera>
  </view>
  <canvas type="webgl" id="myCanvas" hidden="{{ true }}"></canvas>
</view>
2H0U commented 4 years ago

成功了,牛逼!👍