import numpy as np
def generate_data(
name,
low=2,
high=20,
num_of_images=1,
image_height=224,
image_width=224,
channels=3,
channel_first=False,
):
"""Generate random input data for the model."""
# Generate random dataset
if channel_first:
dataset = np.random.randint(
low, high, (num_of_images, channels, image_height, image_width)
).astype(np.float32)
else:
dataset = np.random.randint(
low, high, (num_of_images, image_height, image_width, channels)
).astype(np.float32)
dataset = np.ascontiguousarray(dataset)
# Create the input_data dictionary
input_data = {name: dataset}
return input_data, dataset