Ejemplo n.º 1
0
def __predict(data: Data):
    input_np = DataConverter.convert_input_data_to_np(data.input_data)
    output_np = active_predictor.predict(input_np)
    reshaped_output_nps = DataConverter.reshape_output(output_np)
    data.prediction = reshaped_output_nps.tolist()
    logger.info({'job_id': data.job_id, 'prediction': data.prediction})
Ejemplo n.º 2
0
def __predict(data: Data):
    image_data = get_image_data(data.image_data)
    output_np = active_predictor.predict(image_data)
    reshaped_output_nps = DataConverter.reshape_output(output_np)
    data.prediction = reshaped_output_nps.tolist()
    logger.info({'job_id': data.job_id, 'prediction': data.prediction})
def predict_image(image_data: Image.Image) -> List:
    output_np = active_predictor.predict(image_data)
    reshaped_output_nps = DataConverter.reshape_output(output_np)
    prediction = reshaped_output_nps.tolist()
    return prediction