utility_functions.py
def label_mapping(category_names = 'cat_to_name.json'):
    
    """
    Function loads in a mapping from category label to category name and creates
    a dictionary from it where the keys are the indices and the values the names.
    
    Parameters:
     category_names - name of the file (has to be in the folger "ImageClassifier"
    Returns:
     cat_to_name - dictionary mapping the integer encoded categories to the actual 
     names of the flowers.
    """
    
    ## Create string
    path_category_names = 'ImageClassifier/' + category_names
    
    ## Load in a mapping from category label to category name (JSON object)
    with open(path_category_names, 'r') as f:
        name_mapping = json.load(f)
        
        # Create a dictionary where the keys are the numbers (converted from string
        # to integers) and the values are the names
        name_mapping = {int(k):v for k,v in name_mapping.items()}
    
    ## Return the dictionary
    return name_mapping

    Function loads in a mapping from category label to category name and creates
    a dictionary from it where the keys are the indices and the values the names.
    
    Parameters:
     category_names - name of the file (has to be in the folger "ImageClassifier"
    Returns:
     cat_to_name - dictionary mapping the integer encoded categories to the actual 
     names of the flowers.
    
Function loads in a mapping from category label to category name and creates
a dictionary from it where the keys are the indices and the values the names.

name of the file (has to be in the folger "ImageClassifier"
Returns:
cat_to_name - dictionary mapping the integer encoded categories to the actual
names of the flowers.
Function loads in a mapping from category label to category name and creates a dictionary from it where the keys are the indices and the values the names . name of the file ( has to be in the folger " ImageClassifier " Returns : cat_to_name - dictionary mapping the integer encoded categories to the actual names of the flowers .
def label_mapping(category_names = 'cat_to_name.json'):
    path_category_names = 'ImageClassifier/' + category_names
    with open(path_category_names, 'r') as f:
        name_mapping = json.load(f)
        name_mapping = {int(k):v for k,v in name_mapping.items()}
    return name_mapping
def label_mapping ( category_names = 'cat_to_name.json' ) : path_category_names = 'ImageClassifier/' + category_names with open ( path_category_names , 'r' ) as f : name_mapping = json . load ( f ) name_mapping = { int ( k ) : v for k , v in name_mapping . items ( ) } return name_mapping
Function loads in a mapping from category label to category name and creates
a dictionary from it where the keys are the indices and the values the names.
Function loads in a mapping from category label to category name and creates a dictionary from it where the keys are the indices and the values the names .
"""
    Function loads in a mapping from category label to category name and creates
    a dictionary from it where the keys are the indices and the values the names.
    
    Parameters:
     category_names - name of the file (has to be in the folger "ImageClassifier"
    Returns:
     cat_to_name - dictionary mapping the integer encoded categories to the actual 
     names of the flowers.
    """ ## Create string ## Load in a mapping from category label to category name (JSON object) # Create a dictionary where the keys are the numbers (converted from string # to integers) and the values are the names ## Return the dictionary
category_names