guoqing bakeup
This commit is contained in:
Binary file not shown.
Binary file not shown.
@ -333,7 +333,7 @@ def draw_tracking_boxes(imgs, tracks, scale=2):
|
||||
annotator.box_label(pt2, label, color=color)
|
||||
|
||||
img = annotator.result()
|
||||
subimgs.append((fid-1, img))
|
||||
subimgs.append((fid, img))
|
||||
|
||||
return subimgs
|
||||
|
||||
|
@ -79,18 +79,21 @@ def extract_data(datapath):
|
||||
feats.append(str_to_float_arr(feat))
|
||||
|
||||
if line.find("output_box:") >= 0:
|
||||
box = str_to_float_arr(line[line.find("output_box:") + 11:].strip())
|
||||
tboxes.append(box) # 去掉'output_box:'并去除可能的空白字符
|
||||
index = find_samebox_in_array(boxes, box)
|
||||
assert(len(boxes)>=0 and len(boxes)==len(feats)), f"{datapath}, {datapath}, len(boxes)!=len(feats)"
|
||||
|
||||
assert(len(boxes)==len(feats)), f"{datapath}, {datapath}, len(boxes)!=len(feats)"
|
||||
box = str_to_float_arr(line[line.find("output_box:") + 11:].strip())
|
||||
index = find_samebox_in_array(boxes, box)
|
||||
if index >= 0:
|
||||
tboxes.append(box) # 去掉'output_box:'并去除可能的空白字符
|
||||
|
||||
# feat_f = str_to_float_arr(input_feats[index])
|
||||
feat_f = feats[index]
|
||||
norm_f = np.linalg.norm(feat_f)
|
||||
feat_f = feat_f / norm_f
|
||||
tfeats.append(feat_f)
|
||||
|
||||
|
||||
|
||||
|
||||
if len(boxes): bboxes.append(np.array(boxes))
|
||||
if len(feats): ffeats.append(np.array(feats))
|
||||
if len(tboxes): trackerboxes = np.concatenate((trackerboxes, np.array(tboxes)))
|
||||
|
@ -80,13 +80,12 @@ def videosave(bboxes, videopath="100_1688009697927.mp4"):
|
||||
cap.release()
|
||||
|
||||
def main():
|
||||
videopath = r'\\192.168.1.28\share\测试_202406\0822\A_1724314806144'
|
||||
videopath = r'D:\videos'
|
||||
savepath = r'D:\videos'
|
||||
videopath = r'D:\datasets\ym'
|
||||
savepath = r'D:\datasets\ym'
|
||||
# video2imgs(videopath, savepath)
|
||||
k = 0
|
||||
for filename in os.listdir(videopath):
|
||||
# filename = "20240822-163506_88e6409d-f19b-4e97-9f01-b3fde259cbff.ts"
|
||||
filename = "20240929-155533.ts"
|
||||
|
||||
file, ext = os.path.splitext(filename)
|
||||
if ext not in VideoFormat:
|
||||
|
Reference in New Issue
Block a user