当前位置:网站首页>视觉任务种常用的类别文件之一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))
边栏推荐
猜你喜欢
LeetCode814算题第15天二叉树系列值《814 二叉树剪枝》
LeetCode刷题第10天字符串系列之《125回文串验证》
LeetCode刷题第17天之《3 无重复字符的最长子串》
《卫星界》刊评“星辰大海”计划:孙宇晨为太空旅游带来新的机遇
【FPGA】day20-I2C读写EEPROM
【人话版】WEB3将至之“权益的游戏”
UNI-APP_iphone bottom safe area
Day20 FPGA 】 【 - block the I2C read and write EEPROM
【FPGA】day22-SPI protocol loopback
LeetCode814 Math Question Day 15 Binary Tree Series Value "814 Binary Tree Pruning"
随机推荐
【C语言】入门
"110 Balanced Binary Tree Judgment" in leetCode's 14-day binary tree series
Multi-serial port RS485 industrial gateway BL110
【yolov7系列三】实战从0构建训练自己的数据集
What is ensemble learning in machine learning?
send_sig: 内核执行流程
机器学习是什么?详解机器学习概念
力扣——青蛙跳台阶问题
关于pom.xml文件
Leetcode 450. 删除二叉搜索树中的节点
直播平台开发,Flutter,Drawer侧滑
(转)JVM中那些区域会发生OOM?
洛谷P6586 蒟蒻火锅的盛宴
"239 Sliding Window Maximum Value" on the 16th day of LeetCode brushing
Get Qt installation information: including installation directory and various macro addresses
交换机--- 生成树--三层架构总结
Which one to choose for mobile map development?
【FPGA】day22-SPI protocol loopback
利用Navicat Premium导出数据库表结构信息至Excel
增加PRODUCT_BOOT_JARS及类 提供jar包给应用