本文介绍了如何从Synthia数据集中读取标签(注释)文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Synthia数据集的新手。我想从此数据集中读取标签文件。我希望有一个具有我RGB图像大小的通道矩阵,但是当我加载数据时,我得到了3x760x1280,它充满了零。

I am new to Synthia dataset. I would like to read the label file from this datset. I expect to have one channel matrix with size of my RGB image, but when I load the data I got 3x760x1280 and it is full of zeros.

我试图读为以下:

label = np.asarray(imread(label_path))

label = np.asarray(imread(label_path))

任何人都可以帮助阅读这些标签文件正确吗?

Can anyone help to read these labels file correctly?

推荐答案

我发现正确的读取方式如下:

I found the right way to read it as below:

label = np.asarray(imageio.imread(label_path,format ='PNG-FI'))[:,:,0]

label = np.asarray(imageio.imread(label_path, format='PNG-FI'))[:,:,0]

这篇关于如何从Synthia数据集中读取标签(注释)文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 16:51
查看更多