def image_batch(channels_first):
    """
    Image fixtures of shape NHWC and NCHW and a sample object detection label.
    """
    channels = 3
    height = 20
    width = 16

    if channels_first:
        data_shape = (2, channels, height, width)
    else:
        data_shape = (2, height, width, channels)
    x = (0.5 * np.ones((data_shape))).astype(ART_NUMPY_DTYPE)

    y = []
    for _ in range(len(x)):
        y_1, x_1 = np.random.uniform(0, (height / 2, width / 2))
        y_2, x_2 = np.random.uniform((y_1 + 3, x_1 + 3), (height, width))
        target_dict = {
            "boxes": np.array([[x_1, y_1, x_2, y_2]]),
            "labels": np.array([0]),
        }
        y.append(target_dict)

    return x, y

    Image fixtures of shape NHWC and NCHW and a sample object detection label.
    
tests/attacks/poison/bad_det/conftest.py