iot-blog/image-classification-connector-and-feedback/part_1/beverageclassifier.py [87:96]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def function_handler(event, context):
    image_filename = create_image_filename()
    capture_and_save_image_as(image_filename)

    predicted_category, prediction_confidence = get_inference(image_filename)

    gg_client.publish(
        topic='/response/prediction/beverage_container',
        payload=json.dumps({'message':'Classified image as {} with a confidence of {}'.format(predicted_category, str(prediction_confidence))})
    )
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



iot-blog/image-classification-connector-and-feedback/part_2/beverageclassifier.py [119:128]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def function_handler(event, context):
    image_filename = create_image_filename()
    capture_and_save_image_as(image_filename)

    predicted_category, prediction_confidence = get_inference(image_filename)

    gg_client.publish(
        topic='/response/prediction/beverage_container',
        payload=json.dumps({'message':'Classified image as {} with a confidence of {}'.format(predicted_category, str(prediction_confidence))})
    )
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



