lambda-multilabel/pytorch/app.py
def predict(input_object, model):
    """Predicts the class from an input image.

    Parameters
    ----------
    input_object: Tensor, required
        The tensor object containing the image pixels reshaped and normalized.

    Returns
    ------
    Response object: dict
        Returns the predicted class and confidence score.
    
    """        
    logger.info("Calling **predict** on model")
    start_time = time.time()
    predict_values = model(input_object)
    inference_time = time.time() - start_time
    logger.info("--- Inference time: %s seconds ---" % (time.time() - start_time))
    response = prediction_one_label(predict_values)
    response_multilabel = prediction_multi_labels(predict_values)
    response['multi_label'] = response_multilabel
    response['inference_time'] = inference_time
    return response
Predicts the class from an input image.

    Parameters
    ----------
    input_object: Tensor, required
        The tensor object containing the image pixels reshaped and normalized.

    Returns
    ------
    Response object: dict
        Returns the predicted class and confidence score.
    
    
Predicts the class from an input image.
Parameters

Tensor, required
The tensor object containing the image pixels reshaped and normalized.

Returns

Response object: dict
Returns the predicted class and confidence score.
Predicts the class from an input image . Parameters Tensor required The tensor object containing the image pixels reshaped and normalized . Returns Response object : dict Returns the predicted class and confidence score .
def predict(input_object, model):
    logger.info("Calling **predict** on model")
    start_time = time.time()
    predict_values = model(input_object)
    inference_time = time.time() - start_time
    logger.info("--- Inference time: %s seconds ---" % (time.time() - start_time))
    response = prediction_one_label(predict_values)
    response_multilabel = prediction_multi_labels(predict_values)
    response['multi_label'] = response_multilabel
    response['inference_time'] = inference_time
    return response
def predict ( input_object , model ) : logger . info ( "Calling **predict** on model" ) start_time = time . time ( ) predict_values = model ( input_object ) inference_time = time . time ( ) - start_time logger . info ( "--- Inference time: %s seconds ---" % ( time . time ( ) - start_time ) ) response = prediction_one_label ( predict_values ) response_multilabel = prediction_multi_labels ( predict_values ) response [ 'multi_label' ] = response_multilabel response [ 'inference_time' ] = inference_time return response
Predicts the class from an input image.
Predicts the class from an input image .
"""Predicts the class from an input image.

    Parameters
    ----------
    input_object: Tensor, required
        The tensor object containing the image pixels reshaped and normalized.

    Returns
    ------
    Response object: dict
        Returns the predicted class and confidence score.
    
    """
input_object
model