【发布时间】:2021-04-08 07:38:50
【问题描述】:
我正在创建一个简单的正文分割 html following this
我试过了:
<body>
<!-- Load TensorFlow.js -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@0.13.3"></script>
<!-- Load BodyPix -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/body-pix"></script>
bodypix.load().then(function(net) {
// BodyPix model loaded
});
</script>
</body>
</html>
使用此脚本:
// load the BodyPix model from a checkpoint
const net = await bodyPix.load();
// arguments for estimating person segmentation.
const outputStride = 16;
const segmentationThreshold = 0.5;
const personSegmentation = await net.estimatePersonSegmentation(imageElement, outputStride, segmentationThreshold);
它工作正常,没有错误,但问题是它甚至无法从简单的图像中检测到人。我已经尝试使用此链接进行演示,使用source code 提供的图像 但即使在那里,它也掩盖了整个图像,没有检测到任何身体返回一个只有零的 uint8clamped 数组相同的模型适用于我的手机。 是不是我电脑的问题。 是i7 2600 3.7ghz
注意-我没有 gpu
【问题讨论】:
标签: javascript image image-segmentation tensorflow.js bodypix