def _width(bbox):
    """Computes width of a 2D bounding box.
    
    Args:
        bbox: A dict with keys 'x1', 'x2', 'y1', 'y2' encoding spatial
            co-ordinates.
    
    Returns:
        The width (in the X dimension) of the bounding box.
    """
    return bbox['x2'] - bbox['x1']
