countEachLabel
(不推荐)计算的像素数量为每个类标签bigimageDatastore
对象
的countEachLabel
的函数bigimageDatastore
不推荐对象。使用countEachLabel
相关函数blockedImageDatastore
对象。有关更多信息,请参见兼容性的考虑。
描述
例子
输入参数
输出参数
提示
您可以使用标签返回的信息countEachLabel
计算类权重类平衡。例如,对于像素数据信息的标签资源描述
:
制服类平衡重量每个类,每个包含一个统一的先验概率:
numClasses =身高(台)= 1 / numClasses之前;classWeights = prior. / tbl.PixelCount
逆频率平衡重量每个类,这样弱势类给出更高的重量:
totalNumberOfPixels = (tbl.PixelCount)和频率=(资源。PixelCount / totalNumberOfPixels;classWeights = 1. /频率
中值频率平衡重量每个类使用中值频率:
imageFreq =(资源。PixelCount。/ tbl.ImagePixelCount classWeights = median(imageFreq) ./ imageFreq
你可以通过类权重计算pixelClassificationLayer
(计算机视觉工具箱)。
版本历史
介绍了R2020a另请参阅
pixelClassificationLayer
(计算机视觉工具箱)|trainNetwork
(深度学习工具箱)|blockedImageDatastore
|countEachLabel