def main(test_image_path, checkpoint_path, top_k, category_names, gpu):
    print('test_image_path: ', test_image_path)
    print('checkpoint_path: ', checkpoint_path)
    print('top_k: ', top_k)
    print('category_names: ', category_names)
    print('Use_GPU', gpu)
    if (gpu == True):
        device = 'cuda'
    else:
        device = 'cpu'
    if (category_names is not None):
        with open(category_names, 'r') as f:
            cat_to_name = json.load(f)
    else:
        cat_to_name = None
    (model, class_to_idx) = utils.load_model_checkpoint(checkpoint_path)
    idx_to_class = {class_to_idx[k]: k for k in class_to_idx}
    (probs, outputs, names) = utils.predict(test_image_path, model, idx_to_class, cat_to_name, top_k, device)
    print(f'The Top {top_k} predictions are:')
    for i in range(top_k):
        print(f'	Prediction #{i} : {names[i]} with Probability : {probs[i]:.3f}')
def main(test_image_path, checkpoint_path, top_k, category_names, gpu):
    print('test_image_path: ', test_image_path)
    print('checkpoint_path: ', checkpoint_path)
    print('top_k: ', top_k)
    print('category_names: ', category_names)
    print('Use_GPU', gpu)
    if (gpu == True):
        device = 'cuda'
    else:
        device = 'cpu'
    if (category_names is not None):
        with open(category_names, 'r') as f:
            cat_to_name = json.load(f)
    else:
        cat_to_name = None
    (model, class_to_idx) = utils.load_model_checkpoint(checkpoint_path)
    idx_to_class = {class_to_idx[k]: k for k in class_to_idx}
    (probs, outputs, names) = utils.predict(test_image_path, model, idx_to_class, cat_to_name, top_k, device)
    print(f'The Top {top_k} predictions are:')
    for i in range(top_k):
        print(f'	Prediction #{i} : {names[i]} with Probability : {probs[i]:.3f}')