数据集的处理需要将txt文件和其他信息打包成.Json文件,因此使用的是python语言,代码附上,欢迎讨论。
import json
import os
import pandas as pd
import numpy as np
dict_name = {'Key1':"vidoe_dir", 'Key2':"init_rect",'Key3':"img_names", "Key4":"gt_rect", "Key5":"attr"
}
attr = ["Scale Variation", "Partial Occlusion", "Out-of-View", "Camera Motion", "Similar Object"]
def read_bb_anno(seq_path, files):
bb_anno_file = os.path.join(seq_path, files, "groundtruth.txt")
gt = pd.read_csv(bb_anno_file, delimiter=',', usecols=[1,2,3,4], header=None, na_filter=False, low_memory=False)
col = list(gt.columns)
gt[col] = gt[col].apply(pd.to_numeric, errors='coerce').fillna(0)
gt = np.array(gt, dtype=np.float32)[:-1]
return gt
def generate_json(work_path):
&

最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



