python 读shell

test_txt = /home/zcm/tensorf/siamfc-tf-master/data/Biker/groundtruth.txtdef load_label_set(label_dir):label_folder = open(label_dir, r)trainlines = label_folder.read().splitlines() #返回每一行的数据...

test_txt = '/home/zcm/tensorf/siamfc-tf-master/data/Biker/groundtruth.txt'
def load_label_set(label_dir):
label_folder = open(label_dir, "r")
trainlines = label_folder.read().splitlines() #返回每一行的数据
for line in trainlines:
line = line.split(" ") #按照空格键分割每一行里面的数据
box = [float(line[0]), float(line[1]), float(line[2]), float(line[3])]#box读取标签ground_truth
label_folder.close()

return  train_box

#train_box = load_train_test_set(test_txt)

本文标题为:python 读shell

基础教程推荐