def output(pix):
    accuracy = 0
    for i in os.listdir(test_dir):
        output_path = os.path.join('/media/alpha4TB/ziqi/Parking/CNN/output', (i.strip('.jpg') + '.txt'))
        img_path = os.path.join('/media/alpha4TB/ziqi/Parking/Ps_locate_dataset/img', i)
        trans_inv = os.path.join('/media/alpha4TB/ziqi/Parking/Ps_locate_dataset/trans_inv', (i.strip('.jpg') + '.txt'))
        fina_path = os.path.join('/media/alpha4TB/ziqi/Parking/Ps_locate_dataset/fina', i)
        annt_path2 = os.path.join('./Ps_locate_dataset/annt', (i.strip('.jpg') + '_OA.txt'))
        point_path = os.path.join('/media/alpha4TB/ziqi/Parking/Ps_locate_dataset/point', (i.strip('.jpg') + '_OA.txt'))
        (ps2, _) = read_pslot(annt_path2)
        tmp = output_pic(img_path, output_path, trans_inv, fina_path, ps2, pix, point_path)
        accuracy += tmp
    return accuracy
def output(pix):
    accuracy = 0
    for i in os.listdir(test_dir):
        output_path = os.path.join('/media/alpha4TB/ziqi/Parking/CNN/output', (i.strip('.jpg') + '.txt'))
        img_path = os.path.join('/media/alpha4TB/ziqi/Parking/Ps_locate_dataset/img', i)
        trans_inv = os.path.join('/media/alpha4TB/ziqi/Parking/Ps_locate_dataset/trans_inv', (i.strip('.jpg') + '.txt'))
        fina_path = os.path.join('/media/alpha4TB/ziqi/Parking/Ps_locate_dataset/fina', i)
        annt_path2 = os.path.join('./Ps_locate_dataset/annt', (i.strip('.jpg') + '_OA.txt'))
        point_path = os.path.join('/media/alpha4TB/ziqi/Parking/Ps_locate_dataset/point', (i.strip('.jpg') + '_OA.txt'))
        (ps2, _) = read_pslot(annt_path2)
        tmp = output_pic(img_path, output_path, trans_inv, fina_path, ps2, pix, point_path)
        accuracy += tmp
    return accuracy