lambda-multilabel/pytorch/app.py
def input_fn(request_body):
    """Pre-processes the input data from JSON to PyTorch Tensor.

    Parameters
    ----------
    request_body: dict, required
        The request body submitted by the client. Expect an entry 'url' containing a URL of an image to classify.

    Returns
    ------
    PyTorch Tensor object: Tensor
    
    """    
    logger.info("Getting input URL to a image Tensor object")
    if isinstance(request_body, str):
        request_body = json.loads(request_body)
    img_url = request_body['url']
    #img_tensor = input_fn_core(img_url)
    img_tensor = load_and_process_image(img_url, image_sz)
    return img_tensor
Pre-processes the input data from JSON to PyTorch Tensor.

    Parameters
    ----------
    request_body: dict, required
        The request body submitted by the client. Expect an entry 'url' containing a URL of an image to classify.

    Returns
    ------
    PyTorch Tensor object: Tensor
    
    
Pre-processes the input data from JSON to PyTorch Tensor.
Parameters

dict, required
The request body submitted by the client. Expect an entry 'url' containing a URL of an image to classify.

Returns

PyTorch Tensor object: Tensor
Pre - processes the input data from JSON to PyTorch Tensor . Parameters dict required The request body submitted by the client . Expect an entry ' url ' containing a URL of an image to classify . Returns PyTorch Tensor object : Tensor
def input_fn(request_body):
    logger.info("Getting input URL to a image Tensor object")
    if isinstance(request_body, str):
        request_body = json.loads(request_body)
    img_url = request_body['url']
    img_tensor = load_and_process_image(img_url, image_sz)
    return img_tensor
def input_fn ( request_body ) : logger . info ( "Getting input URL to a image Tensor object" ) if isinstance ( request_body , str ) : request_body = json . loads ( request_body ) img_url = request_body [ 'url' ] img_tensor = load_and_process_image ( img_url , image_sz ) return img_tensor
Pre-processes the input data from JSON to PyTorch Tensor.
Pre - processes the input data from JSON to PyTorch Tensor .
"""Pre-processes the input data from JSON to PyTorch Tensor.

    Parameters
    ----------
    request_body: dict, required
        The request body submitted by the client. Expect an entry 'url' containing a URL of an image to classify.

    Returns
    ------
    PyTorch Tensor object: Tensor
    
    """ #img_tensor = input_fn_core(img_url)
request_body