Ejemplo n.º 1
0
    qin[frame % min_num] = 0
    qout[frame % min_num] = 0
    return sumin, sumout


if __name__ == '__main__':

    name = 'demo_v1'

    detect_time = 0
    track_time = 0
    draw_time = 0
    total_frames = 0
    ww, hh, line1, line2, line3, line4, line5, line6, line7, width, min_num = load_json(
        name)
    rotation, bias = get_parameters(line1, line2, line3, line4, line5, ww, hh,
                                    width)
    mark_list, vis, init_x, init_y, init_tim, pre_x, pre_y, pre_tim = make_zero(
        10000)

    qin = [0] * 100
    qout = [0] * 100
    sumin = 0
    sumout = 0

    detect_model = init_detect_model()

    print(next(detect_model.parameters()).device)

    mot_tracker = DeepSort(model_path="model/deep_sort/deep/checkpoint/ckpt.t7"
                           )  # 实例化SORT tracker
    total_frames = 0

    # demo_v1
    line1 = [594, 679], [580, 581]
    line2 = [498, 332], [472, 654]
    line3 = [267, 471], [317, 472]
    line4 = [239, 519], [294, 523]
    '''
    # demo_v2
    line1 = [189, 238], [163, 221]
    line2 = [274, 175], [252, 158]
    line3 = [189, 238], [223, 211]
    line4 = [163, 221], [252, 158]
    '''

    rotation, bias = get_parameters(line1, line2, line3, line4, w=854, h=480)
    print(getrealxy([223, 211], rotation, bias))
    # 目标区域

    # demo_v2
    tx1, ty1, tx2, ty2 = 1, 206, 853, 439
    '''
    # demo_v2
    tx1, ty1, tx2, ty2 = 1, 206, 853, 439
    '''
    # 标记列表 0 不存在, -1 在外面, 1 在里面
    mark_list = [0] * 10000
    init_x = [0] * 10000
    init_y = [0] * 10000
    init_tim = [0] * 10000