当前位置:网站首页>[语法糖] 关于类别字符串到类别数字id的映射
[语法糖] 关于类别字符串到类别数字id的映射
2022-08-10 01:12:00 【氵文大师】
在https://github.com/ming71/DAL,dota_dataset.py
中:
self.classes = ('__background__', 'plane', 'ship', 'storage-tank', 'baseball-diamond',
'tennis-court', 'basketball-court', 'ground-track-field', 'harbor',
'bridge', 'large-vehicle', 'small-vehicle', 'helicopter', 'roundabout',
'soccer-ball-field' , 'swimming-pool')
self.num_classes = len(self.classes)
self.class_to_ind = dict(zip(self.classes, range(self.num_classes)))
类别到数字id的转换只用了一行,妙啊,zip和dict还能这种配合
边栏推荐
- Interlay集成至Moonbeam,为网络带来interBTC和INTR
- 改变社交与工作状态的即时通讯是什么呢?
- 什么是持续测试?
- 小程序中计算距离信息
- 你有对象类,我有结构体,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang结构体(struct)的使用EP06
- unity 报错 Unsafe code may only appear if compiling with /unsafe. Enable “Allow ‘unsafe‘ code“ in Pla
- Unity reports Unsafe code may only appear if compiling with /unsafe. Enable “Allow ‘unsafe’ code” in Pla
- Solve the problem of sed replacement text containing special characters such as "/" and "#"
- UI遍历的初步尝试
- 用于X射线光学器件的哈特曼波前传感器
猜你喜欢
随机推荐
【ROS2原理10】Interface数据的规定
Unity碰撞和触发
信息化和数字化的核心差异
Solve the problem of sed replacement text containing special characters such as "/" and "#"
Qt的pro文件递归搜寻添加文件
什么是一网统管?终于有人讲明白了
嵌入式Qt-实现两个窗口的切换
【报错】ModuleNotFoundError: No module named ‘scp‘
基于FTP协议实现文件上传与下载
【LeetCode】求根节点到叶节点数字之和
具有多孔光纤的偏振分束器
Visual low-code system practice based on design draft identification
罗彻斯特大学 | 现在是什么序列?蛋白质序列的贝叶斯优化的预训练集成
递归 二分查找 冒泡排序 快速排序
C语言头文件组织与包含原则
手把手教你编写性能测试用例
微信小程序tab切换时保存checkbox状态
鲜花线上销售管理系统的设计与实现
3438. 数制转换
RedHat红帽RHEL7安装与使用,VMware Workstation16 Pro虚拟机的安装与使用