def _count_left_pp(x):
    """Count objects on the left hand side of the camera."""
    # Count distribution (thresholded at 15):

    # Location feature contains (x, y, z) in meters w.r.t. the camera.
    objects_on_left = tf.where(x['objects']['location'][:, 0] < 0)
    label = tf.math.minimum(tf.size(objects_on_left), 8)
    return {'image': x['image'], 'label': label}
Count objects on the left hand side of the camera.
clip_benchmark/clip_benchmark/datasets/kitti.py