Custom Input Function - 1.1 English

Vitis AI User Guide (UG1414)

Document ID
Release Date
1.1 English

The function input format is module_name.input_fn_name, (for example, my_input_fn.calib_input). The input_fn takes an int object as input, indicating the calibration step number, and returns a dict`(placeholder_name, numpy.Array)` object for each call, which is fed into the placeholder nodes of the model when running inference. The shape of numpy.array must be consistent with the placeholders. See the following pseudo code example:

$ “”
def calib_input(iter):
“””A function that provides input data for the calibration
iter: A `int` object, indicating the calibration step number
    dict( placeholder_name, numpy.array): a `dict` object, which will be fed into the model
  image = load_image(iter)
  preprocessed_image = do_preprocess(image)
  return {"placeholder_name": preprocessed_images}