def _closest_object_distance_pp(x):
    """Predict the distance to the closest object."""
    # Label distribution:

    # Location feature contains (x, y, z) in meters w.r.t. the camera.
    dist = tf.reduce_min(x['objects']['location'][:, 2])
    thrs = np.array([-100, 5.6, 8.4, 13.4, 23.4])
    label = tf.reduce_max(tf.where((thrs - dist) < 0))
    return {'image': x['image'], 'label': label}
Predict the distance to the closest object.
clip_benchmark/clip_benchmark/datasets/kitti.py