def METHOD_NAME(self, data):
    """
    Preprocess function to convert the request input to a tensor(Torchserve supported format).
    The user needs to override to customize the pre-processing
    Args :
        data (list): List of the data from the request input.
    Returns:
        tensor: Returns the tensor data of the input
    """
    preprocess_start = time.time()
    metrics = self.context.metrics
    # "add_or_update" will emit the metric
    self.inf_request_count.add_or_update(value=1, dimension_values=[])
    # "get_metric" will fetch the corresponding metric from metric cache if present
    preprocess_call_count_metric = metrics.get_metric(
        metric_name="PreprocessCallCount", metric_type=MetricTypes.COUNTER
    )
    preprocess_call_count_metric.add_or_update(
        value=1, dimension_values=[self.context.model_name]
    )
    request_batch_size_metric = metrics.get_metric(
        metric_name="RequestBatchSize", metric_type=MetricTypes.GAUGE
    )
    request_batch_size_metric.add_or_update(
        value=len(data), dimension_values=[self.context.model_name]
    )
    input = data[0].get("body")
    # "add_size" will register the metric if not already present in metric cache,
    # include the "ModelName" and "Level" dimensions by default and emit it
    metrics.add_size(
        name="SizeOfImage", value=len(input) / 1024, idx=None, unit="kB"
    )
    preprocessed_image = ImageClassifier.METHOD_NAME(self, data)
    preprocess_stop = time.time()
    # "add_time" will register the metric if not already present in metric cache,
    # include the "ModelName" and "Level" dimensions by default and emit it
    metrics.add_time(
        name="HandlerMethodTime",
        value=(preprocess_stop - preprocess_start) * 1000,
        idx=None,
        unit="ms",
        dimensions=[Dimension(name="MethodName", value="preprocess")],
        metric_type=MetricTypes.GAUGE,
    )
    return preprocessed_image