当前位置:网站首页>Modify the VOT2018.json file and remove the color in the image path
Modify the VOT2018.json file and remove the color in the image path
2022-08-09 11:44:00 【anonymous magician】
Upload the code directly
import jsonimport os, sysjson_path = 'VOT2018.json'new_json_path = 'VOT2018_new.json'txt_path = 'list.txt'dict = {}def get_json_data(path): # Modify and delete the color in the original json filewith open(path) as f:params = json.load(f)file = open('list.txt')while 1 :lines = file.readline(1000)if not lines:breaklines = lines[:-1] # Get the name of each video folderroot = (params[lines]['img_names'])for i in range(len(root)):kind, color, jpg = root[i].split('/') # example kind :'ants1', color: 'color' , jpg :'00000001.jpg'root[i] = kind + '/' + jpg # rewrite the path, remove colorfile.close()dict = params# print(dict)f.close()return dictdef write_json_data(path, dictionary): # savewith open(path, 'w') as r:json.dump(dictionary, r)r.close()if __name__ == '__main__':dictionary = get_json_data(json_path)write_json_data(new_json_path, dictionary)OK
边栏推荐
猜你喜欢
![[现代控制理论]3_Phase_portrait 相图 相轨迹](/img/45/255a6a62f8be320c663f5fcad1ad1b.png)
[现代控制理论]3_Phase_portrait 相图 相轨迹
![[Essence] Analysis of the special case of C language structure: structure pointer / basic data type pointer, pointing to other structures](/img/cc/9e5067c9cedaf1a1797c0509e67f88.png)
[Essence] Analysis of the special case of C language structure: structure pointer / basic data type pointer, pointing to other structures

win10右键文件,一直转圈

Win10调整磁盘存储空间详解

mysql8.0和navicat premium15下载安装

爱可可AI前沿推介(8.9)

PTA习题 分类统计字符个数(C)

2022 全球 AI 模型周报

enum in c language

【Robustness of VQA-1】——2019-EMNLP-Don’t Take the Easy Way Out
随机推荐
BISS绝对值编码器_TI方案_线路延迟补偿
字符串 | 反转字符串 | 双指针法 | leecode刷题笔记
TI的片上固化好的boot ROM(上电引导加载程序)退出后的去向
F280049库函数API编程、直接寄存器控制编程和混合编程方法
PAT1001
Use gdb to debug multi-process programs, debug parent and child processes at the same time
The use of signal function (signal) in C language
mysql参数学习----max_allowed_packet
杂记(6)
ACM最长不下降子序列问题
[现代控制理论]3_Phase_portrait 相图 相轨迹
UNIX哲学
Redis的下载安装
信号量SIGCHLD的使用,如何让父进程得知子进程执行结束,如何让父进程区分多个子进程的结束
富媒体在客服IM消息通信中的秒发实践
web课程设计
学长告诉我,大厂MySQL都是通过SSH连接的
Win10调整磁盘存储空间详解
学长告诉我,大厂MySQL都是通过SSH连接的
C# 获取系统已安装的.NET版本