当前位置:网站首页>视觉任务种常用的类别文件之一json文件
视觉任务种常用的类别文件之一json文件
2022-08-11 04:22:00 【默凉】
我们在计算机视觉项目中常见的类别标签格式:json
认识一下
直接使用记事本打开:例如猫狗二分类
一般都使用类似字典的方式存储,但和字典不同,无论是键还是值,都要加上双引号。
用 python 读取
import json
import os
# 路径
json_path = "./class.json"
# 检出是否存在 文件
assert os.path.exists(json_path), "file: '{}' dose not exist.".format(json_path)
# 读的方式 打开文件
json_file = open(json_path, "r")
# 把其他类型的对象转为Python对象 转换成了字典
class_indict = json.load(json_file)
print(class_indict)
print(type(class_indict))
边栏推荐
- [C Language] Getting Started
- 解决多线程调用sql存储过程问题
- 【C语言】入门
- 直播平台开发,Flutter,Drawer侧滑
- 蹭个热度-请勿打开
- "104 Maximum Depth of Binary Trees" in LeetCode's Day 12 Binary Tree Series
- 简历里写了会代码,却依然过不了面试这一关
- es-head plugin insert query and conditional query (5)
- Self-research capability was recognized again, and Tencent Cloud Database was included in the Forrester Translytical report
- 【FPGA】day19-二进制转换为十进制(BCD码)
猜你喜欢
对象的创建以及显示转换
Interchangeability Measurements and Techniques - Calculation of Deviations and Tolerances, Drawing of Tolerance Charts, Selection of Fits and Tolerance Classes
【yolov7系列三】实战从0构建训练自己的数据集
【深度学习】基于卷积神经网络的天气识别训练
Get Qt installation information: including installation directory and various macro addresses
What is machine learning?Explain machine learning concepts in detail
"98 BST and Its Verification" of the 13th day of leetcode brushing series of binary tree series
【FPGA】名词缩写
无线电射频能量的收集
"3 Longest Substring Without Repeating Characters" on the 17th day of LeetCode brushing
随机推荐
The custom of the C language types -- -- -- -- -- - structure
我的 archinstall 使用手册
无线电射频能量的收集
AVH 动手实践 (二) | 在 Arm 虚拟硬件上部署 PP-OCR 模型
shell monitors gpu usage
Basic understanding of MongoDB (2)
【FPGA】day18-ds18b20实现温度采集
Get the length of the linked list
这些云自动化测试工具值得拥有
干货:服务器网卡组技术原理与实践
Get Qt installation information: including installation directory and various macro addresses
【服务器安装Redis】Centos7离线安装redis
0基础转行软件测试,自学3个月,浅拿12k*13薪offer
如何给网页添加icon图标?
洛谷P2245 星际导航
机器学习怎么学?机器学习流程
什么是机器强化学习?原理是什么?
【组成原理 九 CPU】
"110 Balanced Binary Tree Judgment" in leetCode's 14-day binary tree series
【实战场景】商城-折扣活动设计方案