def get_filename_stem(filename):
    """
    A filename should have the following format:
    /path/to/file/filename_stem.jpg

    This function extracts filename_stem from the input filename string.

    """

    filename_stem = filename.split("/")
    filename_stem = filename_stem[-1].split(".")    
    filename_stem = filename_stem[0]

    return filename_stem