语义分割标签

发布于 2025-01-30 17:20:35 字数 930 浏览 4 评论 0原文

我是Trynna通过U-NET制作语义分割的划痕代码。我将使用CityScapes数据集。我正在尝试制作由密钥(汽车,火车,人类等)和值(RGB信息)组成的字典(Python)。如何将字典与我的dract_truth数据匹配?

标记字典的示例如下

color_map = {
'0': [0, 0, 0],             # unlabelled
'1': [128, 64, 128],        # road
'2': [244, 35, 232],        # sidewalk
'3': [70, 70, 70],          # building
'4': [102, 102, 156],       # wall
'5': [190, 153, 153],       # fence
'6': [153, 153, 153],       # pole
'7': [250,170, 30],         # traffic_light
'8': [220, 220, 0],         # traffic_sign
'9': [107, 142, 35],        # vegetation
'10': [152, 251, 152],      # terrain
'11': [0, 130, 180],        # sky
'12': [220, 20, 60],        # person
'13': [255, 0, 0],          # rider
'14': [0, 0, 142],          # car
'15': [0, 0, 70],           # truck
'16': [0, 60, 100],         # bus
'17': [0, 80, 100],         # train
'18': [0, 0, 230],          # motorcycle
'19': [119, 11, 32]         # bicycle
}

I'm trynna make a scratch code of Semantic segmentation through U-Net. I'll use Cityscapes Dataset. I'm trying to make a dictionary(python) composed of the key(car, train, human, etc) and the value(rgb info). How can I match the dictionary with my ground_truth data?

example of labeling dictionary is like below

color_map = {
'0': [0, 0, 0],             # unlabelled
'1': [128, 64, 128],        # road
'2': [244, 35, 232],        # sidewalk
'3': [70, 70, 70],          # building
'4': [102, 102, 156],       # wall
'5': [190, 153, 153],       # fence
'6': [153, 153, 153],       # pole
'7': [250,170, 30],         # traffic_light
'8': [220, 220, 0],         # traffic_sign
'9': [107, 142, 35],        # vegetation
'10': [152, 251, 152],      # terrain
'11': [0, 130, 180],        # sky
'12': [220, 20, 60],        # person
'13': [255, 0, 0],          # rider
'14': [0, 0, 142],          # car
'15': [0, 0, 70],           # truck
'16': [0, 60, 100],         # bus
'17': [0, 80, 100],         # train
'18': [0, 0, 230],          # motorcycle
'19': [119, 11, 32]         # bicycle
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文