BiSeNet icon indicating copy to clipboard operation
BiSeNet copied to clipboard

关于config文件里的n_cats设置

Open yangaiping opened this issue 2 years ago • 10 comments

我通过check_dataset_info.py脚本查到我的所有数据集标签图像像素值区间是[0,132],但是我的数据集标签类别一共才13类,为什么n_cats设成13我的训练就会报错呢,但是设成133又能成功运行? image

yangaiping avatar Aug 10 '23 02:08 yangaiping

Your category does not in range of [0, 13], but in [0, 131] instead. You should convert the label values into [0, 13].

CoinCheung avatar Aug 10 '23 10:08 CoinCheung

您是什么意思呢,我的图像像素值区间是[0,132],但是我的像素颜色种类是13,那我的n_cats应该设为多少呢

yangaiping avatar Aug 10 '23 10:08 yangaiping

You should map the pixel value of your label file into range of [0, 12].

CoinCheung avatar Aug 10 '23 10:08 CoinCheung

代码里的这个输出[0,132]难道不是像素的最小值与最大值形成的区间吗 image image

yangaiping avatar Aug 10 '23 10:08 yangaiping

You have 13 categories, but your category index are not continously ranging from 0 to 12, they are sparsely ranging from 0 to 132.

You should map your raw label values continuously into range [0, 12].

For example, in the picture above, we can see the mapping rule as:

0    -> 0
14  -> 1
19  -> 2
....

You should process your label files to by-pass those empty categories, or you have to set the number of categories into 132.

CoinCheung avatar Aug 10 '23 11:08 CoinCheung

They are expected to be singe channel image.

CoinCheung avatar Aug 10 '23 11:08 CoinCheung

我明白您的意思了,我的png格式的标签文件有问题,我应该下去修改,是需要把彩色标签图像改成单通道8位标签图像吗

yangaiping avatar Aug 10 '23 11:08 yangaiping

Yes, they are expected to be single channel with label values rather than pixel values.

CoinCheung avatar Aug 10 '23 11:08 CoinCheung

非常感谢您,我再下去试试。再次感谢

yangaiping avatar Aug 10 '23 11:08 yangaiping