def quality(arr, threshold=0.5, comment=False):
    """Quality estimation by RPF frame distribution
  """
    good = 0.7
    m = max(arr)
    for i, a in enumerate(arr):
        if a == m:
            frame = i
            break
    txt = '%.2f ' % m
    use = True
    if m < threshold:
        if comment:
            txt += 'fail'
        use = False
    elif comment:
        if m < good:
            txt += 'pass'
        else:
            txt += 'good'
    return use, frame, txt
