detectFaces(frame,width,height) { const tensor = tf.tidy(() => { const temp = tf.browser.fromPixels({ data: new Uint8Array(frame.data), width: frame.width, height: frame.height, }, 4) const sliceOptions = getFrameSliceOptions(frame.width,frame.height,width,height) const tempSlice = tf.slice(temp,sliceOptions.start,sliceOptions.size) return tf.image.resizeBilinear(tempSlice,[height,width]) }) // console.log(tensor); const flipHorizontal = false const faces = this.model.estimateFaces(tensor,flipHorizontal) tensor.dispose() return faces } 报错Cannot read property 'height' of und
时间: 2024-04-28 21:26:35 浏览: 148
这个错误通常表示 `frame` 对象未定义或未正确设置。你需要确保传递给 `detectFaces` 函数的 `frame` 参数已被正确设置为一个包含图像数据的对象,并且其 `width` 和 `height` 属性已被正确设置。如果 `frame` 对象已经被正确设置,那么可能是 `getFrameSliceOptions` 函数的某些属性未正确设置,你需要检查一下这个函数中的属性是否已经被正确设置。如果你仍然无法解决问题,请提供更多的上下文信息,以便我能够更好地帮助你。
阅读全文
相关推荐
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![txt](https://img-home.csdnimg.cn/images/20241231045021.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![text/x-c; charset=iso-8859-1](https://img-home.csdnimg.cn/images/20250102104920.png)
![txt](https://img-home.csdnimg.cn/images/20241231045021.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)