def check_conditions(line, category, method, thresh=0.3):
    """Check conditions of our or m3d txt file"""
    check = False
    assert category in ['pedestrian', 'cyclist', 'all']
    if method == 'gt':
        if category == 'all':
            categories_gt = ['Pedestrian', 'Person_sitting', 'Cyclist']
        else:
            categories_gt = [category.upper()[0] + category[1:]]
        if line.split()[0] in categories_gt:
            check = True
    elif method in ('m3d', '3dop'):
        conf = float(line[15])
        if line[0] == category and conf >= thresh:
            check = True
    elif method == 'monodepth':
        check = True
    else:
        zz = float(line[13])
        conf = float(line[15])
        if conf >= thresh and 0.5 < zz < 70:
            check = True
    return check
