[
  {
    "path": ".gitignore",
    "content": "# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$py.class\n\n# C extensions\n*.so\n\n# Distribution / packaging\n.Python\nenv/\nbuild/\ndevelop-eggs/\ndist/\ndownloads/\neggs/\n.eggs/\nlib/\nlib64/\nparts/\nsdist/\nvar/\nwheels/\n*.egg-info/\n.installed.cfg\n*.egg\n\n# PyInstaller\n#  Usually these files are written by a python script from a template\n#  before PyInstaller builds the exe, so as to inject date/other infos into it.\n*.manifest\n*.spec\n\n# Installer logs\npip-log.txt\npip-delete-this-directory.txt\n\n# Unit test / coverage reports\nhtmlcov/\n.tox/\n.coverage\n.coverage.*\n.cache\nnosetests.xml\ncoverage.xml\n*.cover\n.hypothesis/\n\n# Translations\n*.mo\n*.pot\n\n# Django stuff:\n*.log\nlocal_settings.py\n\n# Flask stuff:\ninstance/\n.webassets-cache\n\n# Scrapy stuff:\n.scrapy\n\n# Sphinx documentation\ndocs/_build/\n\n# PyBuilder\ntarget/\n\n# Jupyter Notebook\n.ipynb_checkpoints\n\n# pyenv\n.python-version\n\n# celery beat schedule file\ncelerybeat-schedule\n\n# SageMath parsed files\n*.sage.py\n\n# dotenv\n.env\n\n# virtualenv\n.venv\nvenv/\nENV/\n\n# Spyder project settings\n.spyderproject\n.spyproject\n\n# Rope project settings\n.ropeproject\n\n# mkdocs documentation\n/site\n\n# mypy\n.mypy_cache/\n\n# mac osx\n.DS_Store\n\n.github/**\n"
  },
  {
    "path": "CODEOWNERS",
    "content": "*           @udacity/active-public-content"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2018 Udacity\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# AIPND-revision\nThis repository contains _REVISED_ code and associated files for the AI Programming with Python Nanodegree program. This repository consists of a number of tutorial notebooks for various coding exercises and programming labs that will be used to supplement the lessons of the course.\n\n## Table Of Contents\n\n### Tutorial Notebooks\n* No revisions\n\n### Programming Project\n* [Intro to Python Project - Classifying Pet Images:](https://github.com/udacity/AIPND-revision/tree/master/intropyproject-classify-pet-images \"Classifying Pet Images Project\") Determine which CNN architecture model works best at classifying images of dogs and their breeds.\n\n### NumPy and Pandas Mini-Projects\n* No revisions \n\n### Matplotlib\n* No revisions \n\n### Quiz Notes\n* [Notes:](https://github.com/udacity/AIPND-revision/tree/master/notes \"Notes\") This directory contains more information about certain quizzes that are testing more challenging concepts. Additionally, one will find the [Frequently Asked Questions](https://github.com/udacity/AIPND-revision/blob/master/notes/project_intro-to-python.md) for the _Intro to Python Project_. Click on the filename to view the contents of the notes on a _quiz_ or the _Intro to Python Project_.\n\n## Dependencies\n\nEach directory has a `requirements.txt` describing the minimal dependencies required to run the notebooks in that directory.\n\n### pip\n\nTo install these dependencies with pip, you can issue `pip3 install -r requirements.txt`.\n\n"
  },
  {
    "path": "intropyproject-classify-pet-images/adjust_results4_isadog.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# */AIPND-revision/intropyproject-classify-pet-images/adjust_results4_isadog.py\n#                                                                             \n# PROGRAMMER: \n# DATE CREATED:                                 \n# REVISED DATE: \n# PURPOSE: Create a function adjust_results4_isadog that adjusts the results \n#          dictionary to indicate whether or not the pet image label is of-a-dog, \n#          and to indicate whether or not the classifier image label is of-a-dog.\n#          All dog labels from both the pet images and the classifier function\n#          will be found in the dognames.txt file. We recommend reading all the\n#          dog names in dognames.txt into a dictionary where the 'key' is the \n#          dog name (from dognames.txt) and the 'value' is one. If a label is \n#          found to exist within this dictionary of dog names then the label \n#          is of-a-dog, otherwise the label isn't of a dog. Alternatively one \n#          could also read all the dog names into a list and then if the label\n#          is found to exist within this list - the label is of-a-dog, otherwise\n#          the label isn't of a dog. \n#         This function inputs:\n#            -The results dictionary as results_dic within adjust_results4_isadog \n#             function and results for the function call within main.\n#            -The text file with dog names as dogfile within adjust_results4_isadog\n#             function and in_arg.dogfile for the function call within main. \n#           This function uses the extend function to add items to the list \n#           that's the 'value' of the results dictionary. You will be adding the\n#           whether or not the pet image label is of-a-dog as the item at index\n#           3 of the list and whether or not the classifier label is of-a-dog as\n#           the item at index 4 of the list. Note we recommend setting the values\n#           at indices 3 & 4 to 1 when the label is of-a-dog and to 0 when the \n#           label isn't a dog.\n#\n##\n# TODO 4: Define adjust_results4_isadog function below, specifically replace the None\n#       below by the function definition of the adjust_results4_isadog function. \n#       Notice that this function doesn't return anything because the \n#       results_dic dictionary that is passed into the function is a mutable \n#       data type so no return is needed.\n# \ndef adjust_results4_isadog(results_dic, dogfile):\n    \"\"\"\n    Adjusts the results dictionary to determine if classifier correctly \n    classified images 'as a dog' or 'not a dog' especially when not a match. \n    Demonstrates if model architecture correctly classifies dog images even if\n    it gets dog breed wrong (not a match).\n    Parameters:\n      results_dic - Dictionary with 'key' as image filename and 'value' as a \n                    List. Where the list will contain the following items: \n                  index 0 = pet image label (string)\n                  index 1 = classifier label (string)\n                  index 2 = 1/0 (int)  where 1 = match between pet image\n                    and classifer labels and 0 = no match between labels\n                ------ where index 3 & index 4 are added by this function -----\n                 NEW - index 3 = 1/0 (int)  where 1 = pet image 'is-a' dog and \n                            0 = pet Image 'is-NOT-a' dog. \n                 NEW - index 4 = 1/0 (int)  where 1 = Classifier classifies image \n                            'as-a' dog and 0 = Classifier classifies image  \n                            'as-NOT-a' dog.\n     dogfile - A text file that contains names of all dogs from the classifier\n               function and dog names from the pet image files. This file has \n               one dog name per line dog names are all in lowercase with \n               spaces separating the distinct words of the dog name. Dog names\n               from the classifier function can be a string of dog names separated\n               by commas when a particular breed of dog has multiple dog names \n               associated with that breed (ex. maltese dog, maltese terrier, \n               maltese) (string - indicates text file's filename)\n    Returns:\n           None - results_dic is mutable data type so no return needed.\n    \"\"\"           \n    None\n"
  },
  {
    "path": "intropyproject-classify-pet-images/adjust_results4_isadog_hints.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# */AIPND-revision/intropyproject-classify-pet-images/adjust_results4_isadog_hints.py\n#                                                                             \n# PROGRAMMER: \n# DATE CREATED:                                 \n# REVISED DATE: \n# PURPOSE: This is a *hints* file to help guide students in creating the \n#          function adjust_results4_isadog that adjusts the results dictionary\n#          to indicate whether or not the pet image label is of-a-dog, \n#          and to indicate whether or not the classifier image label is of-a-dog.\n#          All dog labels from both the pet images and the classifier function\n#          will be found in the dognames.txt file. We recommend reading all the\n#          dog names in dognames.txt into a dictionary where the 'key' is the \n#          dog name (from dognames.txt) and the 'value' is one. If a label is \n#          found to exist within this dictionary of dog names then the label \n#          is of-a-dog, otherwise the label isn't of a dog. Alternatively one \n#          could also read all the dog names into a list and then if the label\n#          is found to exist within this list - the label is of-a-dog, otherwise\n#          the label isn't of a dog. \n#         This function inputs:\n#            -The results dictionary as results_dic within adjust_results4_isadog \n#             function and results for the function call within main.\n#            -The text file with dog names as dogfile within adjust_results4_isadog\n#             function and in_arg.dogfile for the function call within main. \n#           This function uses the extend function to add items to the list \n#           that's the 'value' of the results dictionary. You will be adding the\n#           whether or not the pet image label is of-a-dog as the item at index\n#           3 of the list and whether or not the classifier label is of-a-dog as\n#           the item at index 4 of the list. Note we recommend setting the values\n#           at indices 3 & 4 to 1 when the label is of-a-dog and to 0 when the \n#           label isn't a dog.\n#\n##\n# TODO 4: EDIT and ADD code BELOW to do the following that's stated in the \n#       comments below that start with \"TODO: 4\" for the adjust_results4_isadog \n#       function. Specifically EDIT and ADD code to define the \n#       adjust_results4_isadog function. Notice that this function doesn't return\n#       anything because the results_dic dictionary that is passed into the \n#       function is a mutable data type so no return is needed.\n# \ndef adjust_results4_isadog(results_dic, dogfile):\n    \"\"\"\n    Adjusts the results dictionary to determine if classifier correctly \n    classified images 'as a dog' or 'not a dog' especially when not a match. \n    Demonstrates if model architecture correctly classifies dog images even if\n    it gets dog breed wrong (not a match).\n    Parameters:\n      results_dic - Dictionary with 'key' as image filename and 'value' as a \n                    List. Where the list will contain the following items: \n                  index 0 = pet image label (string)\n                  index 1 = classifier label (string)\n                  index 2 = 1/0 (int)  where 1 = match between pet image\n                    and classifer labels and 0 = no match between labels\n                ------ where index 3 & index 4 are added by this function -----\n                 NEW - index 3 = 1/0 (int)  where 1 = pet image 'is-a' dog and \n                            0 = pet Image 'is-NOT-a' dog. \n                 NEW - index 4 = 1/0 (int)  where 1 = Classifier classifies image \n                            'as-a' dog and 0 = Classifier classifies image  \n                            'as-NOT-a' dog.\n     dogfile - A text file that contains names of all dogs from the classifier\n               function and dog names from the pet image files. This file has \n               one dog name per line dog names are all in lowercase with \n               spaces separating the distinct words of the dog name. Dog names\n               from the classifier function can be a string of dog names separated\n               by commas when a particular breed of dog has multiple dog names \n               associated with that breed (ex. maltese dog, maltese terrier, \n               maltese) (string - indicates text file's filename)\n    Returns:\n           None - results_dic is mutable data type so no return needed.\n    \"\"\"           \n    # Creates dognames dictionary for quick matching to results_dic labels from\n    # real answer & classifier's answer\n    dognames_dic = dict()\n\n    # Reads in dognames from file, 1 name per line & automatically closes file\n    with open(dogfile, \"r\") as infile:\n        # Reads in dognames from first line in file\n        line = infile.readline()\n\n        # Processes each line in file until reaching EOF (end-of-file) by \n        # processing line and adding dognames to dognames_dic with while loop\n        while line != \"\":\n\n            # TODO: 4a. REPLACE pass with CODE to remove the newline character\n            #           from the variable line  \n            #\n            # Process line by striping newline from line\n            pass\n\n            # TODO: 4b. REPLACE pass with CODE to check if the dogname(line) \n            #          exists within dognames_dic, then if the dogname(line) \n            #          doesn't exist within dognames_dic then add the dogname(line) \n            #          to dognames_dic as the 'key' with the 'value' of 1. \n            #\n            # adds dogname(line) to dogsnames_dic if it doesn't already exist \n            # in the dogsnames_dic dictionary\n            pass \n\n            # Reads in next line in file to be processed with while loop\n            # if this line isn't empty (EOF)\n            line = infile.readline()\n\n                \n    # Add to whether pet labels & classifier labels are dogs by appending\n    # two items to end of value(List) in results_dic. \n    # List Index 3 = whether(1) or not(0) Pet Image Label is a dog AND \n    # List Index 4 = whether(1) or not(0) Classifier Label is a dog\n    # How - iterate through results_dic if labels are found in dognames_dic\n    # then label \"is a dog\" index3/4=1 otherwise index3/4=0 \"not a dog\"\n    for key in results_dic:\n\n        # Pet Image Label IS of Dog (e.g. found in dognames_dic)\n        if results_dic[key][0] in dognames_dic:\n            \n            # Classifier Label IS image of Dog (e.g. found in dognames_dic)\n            # appends (1, 1) because both labels are dogs\n            if results_dic[key][1] in dognames_dic:\n                results_dic[key].extend((1, 1))\n\n            # TODO: 4c. REPLACE pass BELOW with CODE that adds the following to\n            #           results_dic dictionary for the key indicated by the \n            #           variable key - append (1,0) to the value using \n            #           the extend list function. This indicates\n            #           the pet label is-a-dog, classifier label is-NOT-a-dog. \n            #                              \n            # Classifier Label IS NOT image of dog (e.g. NOT in dognames_dic)\n            # appends (1,0) because only pet label is a dog\n            else:\n                pass\n\n        # Pet Image Label IS NOT a Dog image (e.g. NOT found in dognames_dic)\n        else:\n            # TODO: 4d. REPLACE pass BELOW with CODE that adds the following to\n            #           results_dic dictionary for the key indicated by the \n            #           variable key - append (0,1) to the value uisng\n            #           the extend list function. This indicates\n            #           the pet label is-NOT-a-dog, classifier label is-a-dog. \n            #                              \n            # Classifier Label IS image of Dog (e.g. found in dognames_dic)\n            # appends (0, 1)because only Classifier labe is a dog\n            if results_dic[key][1] in dognames_dic:\n                pass\n\n            # TODO: 4e. REPLACE pass BELOW with CODE that adds the following to\n            #           results_dic dictionary for the key indicated by the \n            #           variable key - append (0,0) to the value using the \n            #           extend list function. This indicates\n            #           the pet label is-NOT-a-dog, classifier label is-NOT-a-dog. \n            #                                              \n            # Classifier Label IS NOT image of Dog (e.g. NOT in dognames_dic)\n            # appends (0, 0) because both labels aren't dogs\n            else:\n                pass\n    "
  },
  {
    "path": "intropyproject-classify-pet-images/calculates_results_stats.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# */AIPND-revision/intropyproject-classify-pet-images/calculates_results_stats.py\n#                                                                             \n# PROGRAMMER:\n# DATE CREATED:                                  \n# REVISED DATE: \n# PURPOSE: Create a function calculates_results_stats that calculates the \n#          statistics of the results of the programrun using the classifier's model \n#          architecture to classify the images. This function will use the \n#          results in the results dictionary to calculate these statistics. \n#          This function will then put the results statistics in a dictionary\n#          (results_stats_dic) that's created and returned by this function.\n#          This will allow the user of the program to determine the 'best' \n#          model for classifying the images. The statistics that are calculated\n#          will be counts and percentages. Please see \"Intro to Python - Project\n#          classifying Images - xx Calculating Results\" for details on the \n#          how to calculate the counts and percentages for this function.    \n#         This function inputs:\n#            -The results dictionary as results_dic within calculates_results_stats \n#             function and results for the function call within main.\n#         This function creates and returns the Results Statistics Dictionary -\n#          results_stats_dic. This dictionary contains the results statistics \n#          (either a percentage or a count) where the key is the statistic's \n#           name (starting with 'pct' for percentage or 'n' for count) and value \n#          is the statistic's value.  This dictionary should contain the \n#          following keys:\n#            n_images - number of images\n#            n_dogs_img - number of dog images\n#            n_notdogs_img - number of NON-dog images\n#            n_match - number of matches between pet & classifier labels\n#            n_correct_dogs - number of correctly classified dog images\n#            n_correct_notdogs - number of correctly classified NON-dog images\n#            n_correct_breed - number of correctly classified dog breeds\n#            pct_match - percentage of correct matches\n#            pct_correct_dogs - percentage of correctly classified dogs\n#            pct_correct_breed - percentage of correctly classified dog breeds\n#            pct_correct_notdogs - percentage of correctly classified NON-dogs\n#\n##\n# TODO 5: Define calculates_results_stats function below, please be certain to replace None\n#       in the return statement with the results_stats_dic dictionary that you create \n#       with this function\n# \ndef calculates_results_stats(results_dic):\n    \"\"\"\n    Calculates statistics of the results of the program run using classifier's model \n    architecture to classifying pet images. Then puts the results statistics in a \n    dictionary (results_stats_dic) so that it's returned for printing as to help\n    the user to determine the 'best' model for classifying images. Note that \n    the statistics calculated as the results are either percentages or counts.\n    Parameters:\n      results_dic - Dictionary with key as image filename and value as a List \n             (index)idx 0 = pet image label (string)\n                    idx 1 = classifier label (string)\n                    idx 2 = 1/0 (int)  where 1 = match between pet image and \n                            classifer labels and 0 = no match between labels\n                    idx 3 = 1/0 (int)  where 1 = pet image 'is-a' dog and \n                            0 = pet Image 'is-NOT-a' dog. \n                    idx 4 = 1/0 (int)  where 1 = Classifier classifies image \n                            'as-a' dog and 0 = Classifier classifies image  \n                            'as-NOT-a' dog.\n    Returns:\n     results_stats_dic - Dictionary that contains the results statistics (either\n                    a percentage or a count) where the key is the statistic's \n                     name (starting with 'pct' for percentage or 'n' for count)\n                     and the value is the statistic's value. See comments above\n                     and the classroom Item XX Calculating Results for details\n                     on how to calculate the counts and statistics.\n    \"\"\"        \n    # Replace None with the results_stats_dic dictionary that you created with \n    # this function \n    return None\n"
  },
  {
    "path": "intropyproject-classify-pet-images/calculates_results_stats_hints.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# */AIPND-revision/intropyproject-classify-pet-images/calculates_results_stats_hints.py\n#                                                                             \n# PROGRAMMER:\n# DATE CREATED:                                  \n# REVISED DATE: \n# PURPOSE: This is a *hints* file to help guide students in creating the \n#          function calculates_results_stats that calculates the statistics\n#          of the results of the programrun using the classifier's model \n#          architecture to classify the images. This function will use the \n#          results in the results dictionary to calculate these statistics. \n#          This function will then put the results statistics in a dictionary\n#          (results_stats_dic) that's created and returned by this function.\n#          This will allow the user of the program to determine the 'best' \n#          model for classifying the images. The statistics that are calculated\n#          will be counts and percentages. Please see \"Intro to Python - Project\n#          classifying Images - xx Calculating Results\" for details on the \n#          how to calculate the counts and percentages for this function.    \n#         This function inputs:\n#            -The results dictionary as results_dic within calculates_results_stats \n#             function and results for the function call within main.\n#         This function creates and returns the Results Statistics Dictionary -\n#          results_stats_dic. This dictionary contains the results statistics \n#          (either a percentage or a count) where the key is the statistic's \n#           name (starting with 'pct' for percentage or 'n' for count) and value \n#          is the statistic's value.  This dictionary should contain the \n#          following keys:\n#            n_images - number of images\n#            n_dogs_img - number of dog images\n#            n_notdogs_img - number of NON-dog images\n#            n_match - number of matches between pet & classifier labels\n#            n_correct_dogs - number of correctly classified dog images\n#            n_correct_notdogs - number of correctly classified NON-dog images\n#            n_correct_breed - number of correctly classified dog breeds\n#            pct_match - percentage of correct matches\n#            pct_correct_dogs - percentage of correctly classified dogs\n#            pct_correct_breed - percentage of correctly classified dog breeds\n#            pct_correct_notdogs - percentage of correctly classified NON-dogs\n#\n##\n# TODO 5: EDIT and ADD code BELOW to do the following that's stated in the \n#       comments below that start with \"TODO: 5\" for the calculates_results_stats \n#       function. Please be certain to replace None in the return statement with\n#       the results_stats_dic dictionary that you create with this function\n# \ndef calculates_results_stats(results_dic):\n    \"\"\"\n    Calculates statistics of the results of the program run using classifier's model \n    architecture to classifying pet images. Then puts the results statistics in a \n    dictionary (results_stats_dic) so that it's returned for printing as to help\n    the user to determine the 'best' model for classifying images. Note that \n    the statistics calculated as the results are either percentages or counts.\n    Parameters:\n      results_dic - Dictionary with key as image filename and value as a List \n             (index)idx 0 = pet image label (string)\n                    idx 1 = classifier label (string)\n                    idx 2 = 1/0 (int)  where 1 = match between pet image and \n                            classifer labels and 0 = no match between labels\n                    idx 3 = 1/0 (int)  where 1 = pet image 'is-a' dog and \n                            0 = pet Image 'is-NOT-a' dog. \n                    idx 4 = 1/0 (int)  where 1 = Classifier classifies image \n                            'as-a' dog and 0 = Classifier classifies image  \n                            'as-NOT-a' dog.\n    Returns:\n     results_stats_dic - Dictionary that contains the results statistics (either\n                    a percentage or a count) where the key is the statistic's \n                     name (starting with 'pct' for percentage or 'n' for count)\n                     and the value is the statistic's value. See comments above\n                     and the classroom Item XX Calculating Results for details\n                     on how to calculate the counts and statistics.\n    \"\"\"        \n    # Creates empty dictionary for results_stats_dic\n    results_stats_dic = dict()\n    \n    # Sets all counters to initial values of zero so that they can \n    # be incremented while processing through the images in results_dic \n    results_stats_dic['n_dogs_img'] = 0\n    results_stats_dic['n_match'] = 0\n    results_stats_dic['n_correct_dogs'] = 0\n    results_stats_dic['n_correct_notdogs'] = 0\n    results_stats_dic['n_correct_breed'] = 0       \n    \n    # process through the results dictionary\n    for key in results_dic:\n         \n        # Labels Match Exactly\n        if results_dic[key][2] == 1:\n            results_stats_dic['n_match'] += 1\n\n        # TODO: 5a. REPLACE pass with CODE that counts how many pet images of\n        #           dogs had their breed correctly classified. This happens \n        #           when the pet image label indicates the image is-a-dog AND \n        #           the pet image label and the classifier label match. You \n        #           will need to write a conditional statement that determines\n        #           when the dog breed is correctly classified and then \n        #           increments 'n_correct_breed' by 1. Recall 'n_correct_breed' \n        #           is a key in the results_stats_dic dictionary with it's value \n        #           representing the number of correctly classified dog breeds.\n        #           \n        # Pet Image Label is a Dog AND Labels match- counts Correct Breed\n        pass\n        \n        # Pet Image Label is a Dog - counts number of dog images\n        if results_dic[key][3] == 1:\n            results_stats_dic['n_dogs_img'] += 1\n            \n            # Classifier classifies image as Dog (& pet image is a dog)\n            # counts number of correct dog classifications\n            if results_dic[key][4] == 1:\n                results_stats_dic['n_correct_dogs'] += 1\n\n        # TODO: 5b. REPLACE pass with CODE that counts how many pet images \n        #           that are NOT dogs were correctly classified. This happens \n        #           when the pet image label indicates the image is-NOT-a-dog \n        #           AND the classifier label indicates the images is-NOT-a-dog.\n        #           You will need to write a conditional statement that \n        #           determines when the classifier label indicates the image \n        #           is-NOT-a-dog and then increments 'n_correct_notdogs' by 1. \n        #           Recall the 'else:' above 'pass' already indicates that the \n        #           pet image label indicates the image is-NOT-a-dog and \n        #          'n_correct_notdogs' is a key in the results_stats_dic dictionary \n        #           with it's value representing the number of correctly \n        #           classified NOT-a-dog images.\n        #           \n        # Pet Image Label is NOT a Dog\n        else:\n            # Classifier classifies image as NOT a Dog(& pet image isn't a dog)\n            # counts number of correct NOT dog clasifications.\n            pass\n\n\n    # Calculates run statistics (counts & percentages) below that are calculated\n    # using the counters from above.\n    \n    # calculates number of total images\n    results_stats_dic['n_images'] = len(results_dic)\n\n    # calculates number of not-a-dog images using - images & dog images counts\n    results_stats_dic['n_notdogs_img'] = (results_stats_dic['n_images'] - \n                                      results_stats_dic['n_dogs_img']) \n\n    # TODO: 5c. REPLACE zero(0.0) with CODE that calculates the % of correctly\n    #           matched images. Recall that this can be calculated by the\n    #           number of correctly matched images ('n_match') divided by the \n    #           number of images('n_images'). This result will need to be \n    #           multiplied by 100.0 to provide the percentage.\n    #    \n    # Calculates % correct for matches\n    results_stats_dic['pct_match'] = 0.0\n\n    # TODO: 5d. REPLACE zero(0.0) with CODE that calculates the % of correctly\n    #           classified dog images. Recall that this can be calculated by \n    #           the number of correctly classified dog images('n_correct_dogs')\n    #           divided by the number of dog images('n_dogs_img'). This result \n    #           will need to be multiplied by 100.0 to provide the percentage.\n    #    \n    # Calculates % correct dogs\n    results_stats_dic['pct_correct_dogs'] = 0.0\n\n    # TODO: 5e. REPLACE zero(0.0) with CODE that calculates the % of correctly\n    #           classified breeds of dogs. Recall that this can be calculated \n    #           by the number of correctly classified breeds of dog('n_correct_breed') \n    #           divided by the number of dog images('n_dogs_img'). This result \n    #           will need to be multiplied by 100.0 to provide the percentage.\n    #    \n    # Calculates % correct breed of dog\n    results_stats_dic['pct_correct_breed'] = 0.0\n\n    # Calculates % correct not-a-dog images\n    # Uses conditional statement for when no 'not a dog' images were submitted \n    if results_stats_dic['n_notdogs_img'] > 0:\n        results_stats_dic['pct_correct_notdogs'] = (results_stats_dic['n_correct_notdogs'] /\n                                                results_stats_dic['n_notdogs_img'])*100.0\n    else:\n        results_stats_dic['pct_correct_notdogs'] = 0.0\n\n        \n    # TODO 5f. REPLACE None with the results_stats_dic dictionary that you \n    # created with this function \n    return None\n"
  },
  {
    "path": "intropyproject-classify-pet-images/check_images.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# */AIPND-revision/intropyproject-classify-pet-images/check_images.py\n#\n# TODO 0: Add your information below for Programmer & Date Created.                                                                             \n# PROGRAMMER: \n# DATE CREATED:                                  \n# REVISED DATE: \n# PURPOSE: Classifies pet images using a pretrained CNN model, compares these\n#          classifications to the true identity of the pets in the images, and\n#          summarizes how well the CNN performed on the image classification task. \n#          Note that the true identity of the pet (or object) in the image is \n#          indicated by the filename of the image. Therefore, your program must\n#          first extract the pet image label from the filename before\n#          classifying the images using the pretrained CNN model. With this \n#          program we will be comparing the performance of 3 different CNN model\n#          architectures to determine which provides the 'best' classification.\n#\n# Use argparse Expected Call with <> indicating expected user input:\n#      python check_images.py --dir <directory with images> --arch <model>\n#             --dogfile <file that contains dognames>\n#   Example call:\n#    python check_images_solution.py --dir pet_images/ --arch vgg --dogfile dognames.txt\n##\n\n# Imports python modules\nfrom time import time, sleep\n\n# Imports print functions that check the lab\nfrom print_functions_for_lab_checks import *\n\n# Imports functions created for this program\nfrom get_input_args import get_input_args\nfrom get_pet_labels import get_pet_labels\nfrom classify_images import classify_images\nfrom adjust_results4_isadog import adjust_results4_isadog\nfrom calculates_results_stats import calculates_results_stats\nfrom print_results import print_results\n\n# Main program function defined below\ndef main():\n    # TODO 0: Measures total program runtime by collecting start time\n    start_time = time()\n    \n    # TODO 1: Define get_input_args function within the file get_input_args.py\n    # This function retrieves 3 Command Line Arugments from user as input from\n    # the user running the program from a terminal window. This function returns\n    # the collection of these command line arguments from the function call as\n    # the variable in_arg\n    in_arg = get_input_args()\n\n    # Function that checks command line arguments using in_arg  \n    check_command_line_arguments(in_arg)\n\n    \n    # TODO 2: Define get_pet_labels function within the file get_pet_labels.py\n    # Once the get_pet_labels function has been defined replace 'None' \n    # in the function call with in_arg.dir  Once you have done the replacements\n    # your function call should look like this: \n    #             get_pet_labels(in_arg.dir)\n    # This function creates the results dictionary that contains the results, \n    # this dictionary is returned from the function call as the variable results\n    results = get_pet_labels(None)\n\n    # Function that checks Pet Images in the results Dictionary using results    \n    check_creating_pet_image_labels(results)\n\n\n    # TODO 3: Define classify_images function within the file classify_images.py\n    # Once the classify_images function has been defined replace first 'None' \n    # in the function call with in_arg.dir and replace the last 'None' in the\n    # function call with in_arg.arch  Once you have done the replacements your\n    # function call should look like this: \n    #             classify_images(in_arg.dir, results, in_arg.arch)\n    # Creates Classifier Labels with classifier function, Compares Labels, \n    # and adds these results to the results dictionary - results\n    classify_images(None, results, None)\n\n    # Function that checks Results Dictionary using results    \n    check_classifying_images(results)    \n\n    \n    # TODO 4: Define adjust_results4_isadog function within the file adjust_results4_isadog.py\n    # Once the adjust_results4_isadog function has been defined replace 'None' \n    # in the function call with in_arg.dogfile  Once you have done the \n    # replacements your function call should look like this: \n    #          adjust_results4_isadog(results, in_arg.dogfile)\n    # Adjusts the results dictionary to determine if classifier correctly \n    # classified images as 'a dog' or 'not a dog'. This demonstrates if \n    # model can correctly classify dog images as dogs (regardless of breed)\n    adjust_results4_isadog(results, None)\n\n    # Function that checks Results Dictionary for is-a-dog adjustment using results\n    check_classifying_labels_as_dogs(results)\n\n\n    # TODO 5: Define calculates_results_stats function within the file calculates_results_stats.py\n    # This function creates the results statistics dictionary that contains a\n    # summary of the results statistics (this includes counts & percentages). This\n    # dictionary is returned from the function call as the variable results_stats    \n    # Calculates results of run and puts statistics in the Results Statistics\n    # Dictionary - called results_stats\n    results_stats = calculates_results_stats(results)\n\n    # Function that checks Results Statistics Dictionary using results_stats\n    check_calculating_results(results, results_stats)\n\n\n    # TODO 6: Define print_results function within the file print_results.py\n    # Once the print_results function has been defined replace 'None' \n    # in the function call with in_arg.arch  Once you have done the \n    # replacements your function call should look like this: \n    #      print_results(results, results_stats, in_arg.arch, True, True)\n    # Prints summary results, incorrect classifications of dogs (if requested)\n    # and incorrectly classified breeds (if requested)\n    print_results(results, results_stats, None, True, True)\n    \n    # TODO 0: Measure total program runtime by collecting end time\n    end_time = time()\n    \n    # TODO 0: Computes overall runtime in seconds & prints it in hh:mm:ss format\n    tot_time = end_time - start_time\n    print(\"\\n** Total Elapsed Runtime:\",\n          str(int((tot_time/3600)))+\":\"+str(int((tot_time%3600)/60))+\":\"\n          +str(int((tot_time%3600)%60)) )\n    \n\n# Call to main function to run the program\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "intropyproject-classify-pet-images/classifier.py",
    "content": "import ast\nfrom PIL import Image\nimport torchvision.transforms as transforms\nfrom torch.autograd import Variable\nimport torchvision.models as models\nfrom torch import __version__\n\nresnet18 = models.resnet18(pretrained=True)\nalexnet = models.alexnet(pretrained=True)\nvgg16 = models.vgg16(pretrained=True)\n\nmodels = {'resnet': resnet18, 'alexnet': alexnet, 'vgg': vgg16}\n\n# obtain ImageNet labels\nwith open('imagenet1000_clsid_to_human.txt') as imagenet_classes_file:\n    imagenet_classes_dict = ast.literal_eval(imagenet_classes_file.read())\n\ndef classifier(img_path, model_name):\n    # load the image\n    img_pil = Image.open(img_path)\n\n    # define transforms\n    preprocess = transforms.Compose([\n        transforms.Resize(256),\n        transforms.CenterCrop(224),\n        transforms.ToTensor(),\n        transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])\n    ])\n    \n    # preprocess the image\n    img_tensor = preprocess(img_pil)\n    \n    # resize the tensor (add dimension for batch)\n    img_tensor.unsqueeze_(0)\n    \n    # wrap input in variable, wrap input in variable - no longer needed for\n    # v 0.4 & higher code changed 04/26/2018 by Jennifer S. to handle PyTorch upgrade\n    pytorch_ver = __version__.split('.')\n    \n    # pytorch versions 0.4 & hihger - Variable depreciated so that it returns\n    # a tensor. So to address tensor as output (not wrapper) and to mimic the \n    # affect of setting volatile = True (because we are using pretrained models\n    # for inference) we can set requires_gradient to False. Here we just set \n    # requires_grad_ to False on our tensor \n    if int(pytorch_ver[0]) > 0 or int(pytorch_ver[1]) >= 4:\n        img_tensor.requires_grad_(False)\n    \n    # pytorch versions less than 0.4 - uses Variable because not-depreciated\n    else:\n        # apply model to input\n        # wrap input in variable\n        data = Variable(img_tensor, volatile = True) \n\n    # apply model to input\n    model = models[model_name]\n\n    # puts model in evaluation mode\n    # instead of (default)training mode\n    model = model.eval()\n    \n    # apply data to model - adjusted based upon version to account for \n    # operating on a Tensor for version 0.4 & higher.\n    if int(pytorch_ver[0]) > 0 or int(pytorch_ver[1]) >= 4:\n        output = model(img_tensor)\n\n    # pytorch versions less than 0.4\n    else:\n        # apply data to model\n        output = model(data)\n\n    # return index corresponding to predicted class\n    pred_idx = output.data.numpy().argmax()\n\n    return imagenet_classes_dict[pred_idx]\n"
  },
  {
    "path": "intropyproject-classify-pet-images/classify_images.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# */AIPND-revision/intropyproject-classify-pet-images/classify_images.py\n#                                                                             \n# PROGRAMMER: \n# DATE CREATED:                                 \n# REVISED DATE: \n# PURPOSE: Create a function classify_images that uses the classifier function \n#          to create the classifier labels and then compares the classifier \n#          labels to the pet image labels. This function inputs:\n#            -The Image Folder as image_dir within classify_images and function \n#             and as in_arg.dir for function call within main. \n#            -The results dictionary as results_dic within classify_images \n#             function and results for the functin call within main.\n#            -The CNN model architecture as model within classify_images function\n#             and in_arg.arch for the function call within main. \n#           This function uses the extend function to add items to the list \n#           that's the 'value' of the results dictionary. You will be adding the\n#           classifier label as the item at index 1 of the list and the comparison \n#           of the pet and classifier labels as the item at index 2 of the list.\n#\n##\n# Imports classifier function for using CNN to classify images \nfrom classifier import classifier \n\n# TODO 3: Define classify_images function below, specifically replace the None\n#       below by the function definition of the classify_images function. \n#       Notice that this function doesn't return anything because the \n#       results_dic dictionary that is passed into the function is a mutable \n#       data type so no return is needed.\n# \ndef classify_images(images_dir, results_dic, model):\n    \"\"\"\n    Creates classifier labels with classifier function, compares pet labels to \n    the classifier labels, and adds the classifier label and the comparison of \n    the labels to the results dictionary using the extend function. Be sure to\n    format the classifier labels so that they will match your pet image labels.\n    The format will include putting the classifier labels in all lower case \n    letters and strip the leading and trailing whitespace characters from them.\n    For example, the Classifier function returns = 'Maltese dog, Maltese terrier, Maltese' \n    so the classifier label = 'maltese dog, maltese terrier, maltese'.\n    Recall that dog names from the classifier function can be a string of dog \n    names separated by commas when a particular breed of dog has multiple dog \n    names associated with that breed. For example, you will find pet images of\n    a 'dalmatian'(pet label) and it will match to the classifier label \n    'dalmatian, coach dog, carriage dog' if the classifier function correctly \n    classified the pet images of dalmatians.\n     PLEASE NOTE: This function uses the classifier() function defined in \n     classifier.py within this function. The proper use of this function is\n     in test_classifier.py Please refer to this program prior to using the \n     classifier() function to classify images within this function \n     Parameters: \n      images_dir - The (full) path to the folder of images that are to be\n                   classified by the classifier function (string)\n      results_dic - Results Dictionary with 'key' as image filename and 'value'\n                    as a List. Where the list will contain the following items: \n                  index 0 = pet image label (string)\n                --- where index 1 & index 2 are added by this function ---\n                  NEW - index 1 = classifier label (string)\n                  NEW - index 2 = 1/0 (int)  where 1 = match between pet image\n                    and classifer labels and 0 = no match between labels\n      model - Indicates which CNN model architecture will be used by the \n              classifier function to classify the pet images,\n              values must be either: resnet alexnet vgg (string)\n     Returns:\n           None - results_dic is mutable data type so no return needed.         \n    \"\"\"\n    None \n"
  },
  {
    "path": "intropyproject-classify-pet-images/classify_images_hints.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# */AIPND-revision/intropyproject-classify-pet-images/classify_images_hints.py\n#                                                                             \n# PROGRAMMER: \n# DATE CREATED:                                 \n# REVISED DATE: \n# PURPOSE: This is a *hints* file to help guide students in creating the \n#          function classify_images that uses the classifier function \n#          to create the classifier labels and then compares the classifier \n#          labels to the pet image labels. This function inputs:\n#            -The Image Folder as image_dir within classify_images and function \n#             and as in_arg.dir for function call within main. \n#            -The results dictionary as results_dic within classify_images \n#             function and results for the functin call within main.\n#            -The CNN model architecture as model within classify_images function\n#             and in_arg.arch for the function call within main. \n#           This function uses the extend function to add items to the list \n#           that's the 'value' of the results dictionary. You will be adding the\n#           classifier label as the item at index 1 of the list and the comparison \n#           of the pet and classifier labels as the item at index 2 of the list.\n#\n##\n# Imports classifier function for using CNN to classify images \nfrom classifier import classifier \n\n# TODO 3: EDIT and ADD code BELOW to do the following that's stated in the \n#       comments below that start with \"TODO: 3\" for the classify_images function \n#       Specifically EDIT and ADD code to define the classify_images function. \n#       Notice that this function doesn't return anything because the \n#       results_dic dictionary that is passed into the function is a mutable \n#       data type so no return is needed.\n# \ndef classify_images(images_dir, results_dic, model):\n    \"\"\"\n    Creates classifier labels with classifier function, compares pet labels to \n    the classifier labels, and adds the classifier label and the comparison of \n    the labels to the results dictionary using the extend function. Be sure to\n    format the classifier labels so that they will match your pet image labels.\n    The format will include putting the classifier labels in all lower case \n    letters and strip the leading and trailing whitespace characters from them.\n    For example, the Classifier function returns = 'Maltese dog, Maltese terrier, Maltese' \n    so the classifier label = 'maltese dog, maltese terrier, maltese'.\n    Recall that dog names from the classifier function can be a string of dog \n    names separated by commas when a particular breed of dog has multiple dog \n    names associated with that breed. For example, you will find pet images of\n    a 'dalmatian'(pet label) and it will match to the classifier label \n    'dalmatian, coach dog, carriage dog' if the classifier function correctly \n    classified the pet images of dalmatians.\n     PLEASE NOTE: This function uses the classifier() function defined in \n     classifier.py within this function. The proper use of this function is\n     in test_classifier.py Please refer to this program prior to using the \n     classifier() function to classify images within this function \n     Parameters: \n      images_dir - The (full) path to the folder of images that are to be\n                   classified by the classifier function (string)\n      results_dic - Results Dictionary with 'key' as image filename and 'value'\n                    as a List. Where the list will contain the following items: \n                  index 0 = pet image label (string)\n                --- where index 1 & index 2 are added by this function ---\n                  NEW - index 1 = classifier label (string)\n                  NEW - index 2 = 1/0 (int)  where 1 = match between pet image\n                    and classifer labels and 0 = no match between labels\n      model - Indicates which CNN model architecture will be used by the \n              classifier function to classify the pet images,\n              values must be either: resnet alexnet vgg (string)\n     Returns:\n           None - results_dic is mutable data type so no return needed.         \n    \"\"\"\n    # Process all files in the results_dic - use images_dir to give fullpath\n    # that indicates the folder and the filename (key) to be used in the \n    # classifier function\n    for key in results_dic:\n       \n       # TODO: 3a. Set the string variable model_label to be the string that's \n       #           returned from using the classifier function instead of the   \n       #           empty string below.\n       #\n       #  Runs classifier function to classify the images classifier function \n       # inputs: path + filename  and  model, returns model_label \n       # as classifier label\n       model_label = \"\"\n\n       # TODO: 3b. BELOW REPLACE pass with CODE to process the model_label to \n       #           convert all characters within model_label to lowercase \n       #           letters and then remove whitespace characters from the ends\n       #           of model_label. Be certain the resulting processed string \n       #           is named model_label.\n       #\n       # Processes the results so they can be compared with pet image labels\n       # set labels to lowercase (lower) and stripping off whitespace(strip)\n       pass\n              \n       # defines truth as pet image label \n       truth = results_dic[key][0]\n\n       # TODO: 3c. REPLACE pass BELOW with CODE that uses the extend list function\n       #           to add the classifier label (model_label) and the value of\n       #           1 (where the value of 1 indicates a match between pet image \n       #           label and the classifier label) to the results_dic dictionary\n       #           for the key indicated by the variable key \n       #\n       # If the pet image label is found within the classifier label list of terms \n       # as an exact match to on of the terms in the list - then they are added to \n       # results_dic as an exact match(1) using extend list function\n       if truth in model_label:\n           pass\n\n       # TODO: 3d. REPLACE pass BELOW with CODE that uses the extend list function\n       #           to add the classifier label (model_label) and the value of\n       #           0 (where the value of 0 indicates NOT a match between the pet \n       #           image label and the classifier label) to the results_dic \n       #           dictionary for the key indicated by the variable key\n       #                   \n       # if not found then added to results dictionary as NOT a match(0) using\n       # the extend function \n       else:\n           pass\n"
  },
  {
    "path": "intropyproject-classify-pet-images/create_images.txt",
    "content": "Questions regarding Uploaded Image Classification:\n\n1. Did the three model architectures classify the breed of dog in Dog_01.jpg to be the same breed? If not, report the differences in the classifications.\n\nAnswer: \n\n\n2. Did each of the three model architectures classify the breed of dog in Dog_01.jpg to be the same breed of dog as that model architecture classified Dog_02.jpg? If not, report the differences in the classifications.\n\nAnswer: \n\n\n3. Did the three model architectures correctly classify Animal_Name_01.jpg and Object_Name_01.jpg to not be dogs? If not, report the misclassifications.\n\nAnswer: \n\n\n4. Based upon your answers for questions 1. - 3. above, select the model architecture that you feel did the best at classifying the four uploaded images. Describe why you selected that model architecture as the best on uploaded image classification.\n\nAnswer:\n"
  },
  {
    "path": "intropyproject-classify-pet-images/dognames.txt",
    "content": "chihuahua\njapanese spaniel\nmaltese dog, maltese terrier, maltese\npekinese, pekingese, peke\nshih-tzu\nblenheim spaniel\npapillon\ntoy terrier\nrhodesian ridgeback\nafghan hound, afghan\nbasset, basset hound\nbeagle\nbloodhound, sleuthhound\nbluetick\nblack-and-tan coonhound\nwalker hound, walker foxhound\nenglish foxhound\nredbone\nborzoi, russian wolfhound\nirish wolfhound\nitalian greyhound\nwhippet\nibizan hound, ibizan podenco\nnorwegian elkhound, elkhound\notterhound, otter hound\nsaluki, gazelle hound\nscottish deerhound, deerhound\nweimaraner\nstaffordshire bullterrier, staffordshire bull terrier\namerican staffordshire terrier, staffordshire terrier, american pit bull terrier, pit bull terrier\nbedlington terrier\nborder terrier\nkerry blue terrier\nirish terrier\nnorfolk terrier\nnorwich terrier\nyorkshire terrier\nwire-haired fox terrier\nlakeland terrier\nsealyham terrier, sealyham\nairedale, airedale terrier\ncairn, cairn terrier\naustralian terrier\ndandie dinmont, dandie dinmont terrier\nboston bull, boston terrier\nminiature schnauzer\ngiant schnauzer\nstandard schnauzer, schnauzer\nscotch terrier, scottish terrier, scottie\ntibetan terrier, chrysanthemum dog\nsilky terrier, sydney silky\nsoft-coated wheaten terrier\nwest highland white terrier\nlhasa, lhasa apso\nflat-coated retriever\ncurly-coated retriever\ngolden retriever\nlabrador retriever\nchesapeake bay retriever\ngerman shorthaired pointer\nvizsla, hungarian pointer\nenglish setter\nirish setter, red setter\ngordon setter\nbrittany spaniel\nclumber, clumber spaniel\nenglish springer, english springer spaniel\nwelsh springer spaniel\ncocker spaniel, english cocker spaniel, cocker\nsussex spaniel\nirish water spaniel\nkuvasz\nschipperke\ngroenendael\nmalinois\nbriard\nkelpie\nkomondor\nold english sheepdog, bobtail\nshetland sheepdog, shetland sheep dog, shetland\ncollie\nborder collie\nbouvier des flandres, bouviers des flandres\nrottweiler\ngerman shepherd, german shepherd dog, german police dog, alsatian\ndoberman, doberman pinscher\nminiature pinscher\ngreater swiss mountain dog\nbernese mountain dog\nappenzeller\nentlebucher\nboxer\nbull mastiff\ntibetan mastiff\nfrench bulldog\ngreat dane\nsaint bernard, st bernard\neskimo dog, husky\nmalamute, malemute, alaskan malamute\nsiberian husky\ndalmatian, coach dog, carriage dog\naffenpinscher, monkey pinscher, monkey dog\nbasenji\npug, pug-dog\nleonberg\nnewfoundland, newfoundland dog\ngreat pyrenees\nsamoyed, samoyede\npomeranian\nchow, chow chow\nkeeshond\nbrabancon griffon\npembroke, pembroke welsh corgi, corgi\ncardigan, cardigan welsh corgi, corgi\ntoy poodle\nminiature poodle\nstandard poodle, poodle\nmexican hairless\naffenpinscher\nafghan hound\nairedale terrier\nakita\nalaskan malamute\namerican eskimo dog\namerican foxhound\namerican staffordshire terrier\namerican water spaniel\nanatolian shepherd dog\naustralian cattle dog\naustralian shepherd\nbasset hound\nbearded collie\nbeauceron\nbelgian malinois\nbelgian sheepdog\nbelgian tervuren\nbichon frise\nblack and tan coonhound\nblack russian terrier\nbloodhound\nbluetick coonhound\nborzoi\nboston terrier\nbouvier des flandres\nboykin spaniel\nbrittany\nbrussels griffon\nbull terrier\nbulldog\nbullmastiff\ncairn terrier\ncanaan dog\ncane corso\ncardigan welsh corgi\ncavalier king charles spaniel\nchinese crested\nchinese shar-pei\nchow chow\nclumber spaniel\ncocker spaniel\ncorgi\ndachshund\ndalmatian\ndandie dinmont terrier\ndeerhound\ndoberman pinscher\ndogue de bordeaux\nenglish cocker spaniel\nenglish springer spaniel\nenglish toy spaniel\nentlebucher mountain dog\nfield spaniel\nfinnish spitz\ngerman pinscher\ngerman shepherd dog\ngerman wirehaired pointer\nglen of imaal terrier\ngreyhound\nhavanese\nibizan hound\nicelandic sheepdog\nirish red and white setter\nirish setter\njapanese chin\nleonberger\nlhasa apso\nlowchen\nmaltese\nmanchester terrier\nmastiff\nneapolitan mastiff\nnewfoundland\nnorwegian buhund\nnorwegian elkhound\nnorwegian lundehund\nnova scotia duck tolling retriever\nold english sheepdog\notterhound\nparson russell terrier\npekingese\npembroke welsh corgi\npetit basset griffon vendeen\npharaoh hound\nplott\npointer\npoodle\nportuguese water dog\npug\nsaint bernard\nsaluki\nsamoyed\nschnauzer\nscottish terrier\nsealyham terrier\nshetland sheepdog\nsilky terrier\nsmooth fox terrier\nstaffordshire bull terrier\ntibetan terrier\nvizsla\nwalker hound\nwirehaired pointing griffon\nxoloitzcuintli\ndog\n"
  },
  {
    "path": "intropyproject-classify-pet-images/get_input_args.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# */AIPND-revision/intropyproject-classify-pet-images/get_input_args.py\n#                                                                             \n# PROGRAMMER: \n# DATE CREATED:                                   \n# REVISED DATE: \n# PURPOSE: Create a function that retrieves the following 3 command line inputs \n#          from the user using the Argparse Python module. If the user fails to \n#          provide some or all of the 3 inputs, then the default values are\n#          used for the missing inputs. Command Line Arguments:\n#     1. Image Folder as --dir with default value 'pet_images'\n#     2. CNN Model Architecture as --arch with default value 'vgg'\n#     3. Text File with Dog Names as --dogfile with default value 'dognames.txt'\n#\n##\n# Imports python modules\nimport argparse\n\n# TODO 1: Define get_input_args function below please be certain to replace None\n#       in the return statement with parser.parse_args() parsed argument \n#       collection that you created with this function\n# \ndef get_input_args():\n    \"\"\"\n    Retrieves and parses the 3 command line arguments provided by the user when\n    they run the program from a terminal window. This function uses Python's \n    argparse module to created and defined these 3 command line arguments. If \n    the user fails to provide some or all of the 3 arguments, then the default \n    values are used for the missing arguments. \n    Command Line Arguments:\n      1. Image Folder as --dir with default value 'pet_images'\n      2. CNN Model Architecture as --arch with default value 'vgg'\n      3. Text File with Dog Names as --dogfile with default value 'dognames.txt'\n    This function returns these arguments as an ArgumentParser object.\n    Parameters:\n     None - simply using argparse module to create & store command line arguments\n    Returns:\n     parse_args() -data structure that stores the command line arguments object  \n    \"\"\"\n    # Replace None with parser.parse_args() parsed argument collection that \n    # you created with this function \n    return None\n"
  },
  {
    "path": "intropyproject-classify-pet-images/get_input_args_hints.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# */AIPND-revision/intropyproject-classify-pet-images/get_input_args_hints.py\n#                                                                             \n# PROGRAMMER: \n# DATE CREATED:                                   \n# REVISED DATE: \n# PURPOSE: This is a *hints* file to help guide students in creating the \n#          function that retrieves the following 3 command line inputs from\n#          the user using the Argparse Python module. If the user fails to \n#          provide some or all of the 3 inputs, then the default values are\n#          used for the missing inputs. Command Line Arguments:\n#     1. Image Folder as --dir with default value 'pet_images'\n#     2. CNN Model Architecture as --arch with default value 'vgg'\n#     3. Text File with Dog Names as --dogfile with default value 'dognames.txt'\n#\n##\n# Imports python modules\nimport argparse\n\n# TODO 1: EDIT and ADD code BELOW to do the following that's stated in the \n#       comments below that start with \"TODO: 1\" for the get_input_args function\n#       Please be certain to replace None in the return statement with \n#       parser.parse_args() parsed argument collection that you created with \n#       this function\n# \ndef get_input_args():\n    \"\"\"\n    Retrieves and parses the 3 command line arguments provided by the user when\n    they run the program from a terminal window. This function uses Python's \n    argparse module to created and defined these 3 command line arguments. If \n    the user fails to provide some or all of the 3 arguments, then the default \n    values are used for the missing arguments. \n    Command Line Arguments:\n      1. Image Folder as --dir with default value 'pet_images'\n      2. CNN Model Architecture as --arch with default value 'vgg'\n      3. Text File with Dog Names as --dogfile with default value 'dognames.txt'\n    This function returns these arguments as an ArgumentParser object.\n    Parameters:\n     None - simply using argparse module to create & store command line arguments\n    Returns:\n     parse_args() -data structure that stores the command line arguments object  \n    \"\"\"\n    # Creates parse \n    parser = argparse.ArgumentParser()\n\n    # Creates 3 command line arguments args.dir for path to images files,\n    # args.arch which CNN model to use for classification, args.labels path to\n    # text file with names of dogs.\n    parser.add_argument('--dir', type=str, default='pet_images/', \n                        help='path to folder of images')\n    # TODO: 1a. EDIT parse.add_argument statements BELOW to add type & help for:\n    #          --arch - the CNN model architecture\n    #          --dogfile - text file of names of dog breeds\n    parser.add_argument('--arch', default = 'vgg' )\n    parser.add_argument('--dogfile', default = 'dognames.txt' )\n\n    # TODO: 1b. Replace None with parser.parse_args() parsed argument \n    # collection that you created with this function \n    return None\n"
  },
  {
    "path": "intropyproject-classify-pet-images/get_pet_labels.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# */AIPND-revision/intropyproject-classify-pet-images/get_pet_labels.py\n#                                                                             \n# PROGRAMMER: \n# DATE CREATED:                                  \n# REVISED DATE: \n# PURPOSE: Create the function get_pet_labels that creates the pet labels from \n#          the image's filename. This function inputs: \n#           - The Image Folder as image_dir within get_pet_labels function and \n#             as in_arg.dir for the function call within the main function. \n#          This function creates and returns the results dictionary as results_dic\n#          within get_pet_labels function and as results within main. \n#          The results_dic dictionary has a 'key' that's the image filename and\n#          a 'value' that's a list. This list will contain the following item\n#          at index 0 : pet image label (string).\n#\n##\n# Imports python modules\nfrom os import listdir\n\n# TODO 2: Define get_pet_labels function below please be certain to replace None\n#       in the return statement with results_dic dictionary that you create \n#       with this function\n# \ndef get_pet_labels(image_dir):\n    \"\"\"\n    Creates a dictionary of pet labels (results_dic) based upon the filenames \n    of the image files. These pet image labels are used to check the accuracy \n    of the labels that are returned by the classifier function, since the \n    filenames of the images contain the true identity of the pet in the image.\n    Be sure to format the pet labels so that they are in all lower case letters\n    and with leading and trailing whitespace characters stripped from them.\n    (ex. filename = 'Boston_terrier_02259.jpg' Pet label = 'boston terrier')\n    Parameters:\n     image_dir - The (full) path to the folder of images that are to be\n                 classified by the classifier function (string)\n    Returns:\n      results_dic - Dictionary with 'key' as image filename and 'value' as a \n      List. The list contains for following item:\n         index 0 = pet image label (string)\n    \"\"\"\n    # Replace None with the results_dic dictionary that you created with this\n    # function\n    return None\n"
  },
  {
    "path": "intropyproject-classify-pet-images/get_pet_labels_hints.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# */AIPND-revision/intropyproject-classify-pet-images/get_pet_labels_hints.py\n#                                                                             \n# PROGRAMMER: \n# DATE CREATED:                                  \n# REVISED DATE: \n# PURPOSE: This is a *hints* file to help guide students in creating the \n#          function get_pet_labels that creates the pet labels from the image's\n#          filename. This function inputs: \n#           - The Image Folder as image_dir within get_pet_labels function and \n#             as in_arg.dir for the function call within the main function. \n#          This function creates and returns the results dictionary as results_dic\n#          within get_pet_labels function and as results within main. \n#          The results_dic dictionary has a 'key' that's the image filename and\n#          a 'value' that's a list. This list will contain the following item\n#          at index 0 : pet image label (string).\n#\n##\n# Imports python modules\nfrom os import listdir\n\n# TODO 2: EDIT and ADD code BELOW to do the following that's stated in the \n#       comments below that start with \"TODO: 2\" for the get_pet_labels function \n#       Please be certain to replace None in the return statement with \n#       results_dic dictionary that you create with this function\n# \ndef get_pet_labels(image_dir):\n    \"\"\"\n    Creates a dictionary of pet labels (results_dic) based upon the filenames \n    of the image files. These pet image labels are used to check the accuracy \n    of the labels that are returned by the classifier function, since the \n    filenames of the images contain the true identity of the pet in the image.\n    Be sure to format the pet labels so that they are in all lower case letters\n    and with leading and trailing whitespace characters stripped from them.\n    (ex. filename = 'Boston_terrier_02259.jpg' Pet label = 'boston terrier')\n    Parameters:\n     image_dir - The (full) path to the folder of images that are to be\n                 classified by the classifier function (string)\n    Returns:\n      results_dic - Dictionary with 'key' as image filename and 'value' as a \n      List. The list contains for following item:\n         index 0 = pet image label (string)\n    \"\"\"\n    # Creates list of files in directory\n    in_files = listdir(image_dir)\n    \n    # Processes each of the files to create a dictionary where the key\n    # is the filename and the value is the picture label (below).\n \n    # Creates empty dictionary for the results (pet labels, etc.)\n    results_dic = dict()\n   \n    # Processes through each file in the directory, extracting only the words\n    # of the file that contain the pet image label\n    for idx in range(0, len(in_files), 1):\n       \n       # Skips file if starts with . (like .DS_Store of Mac OSX) because it \n       # isn't an pet image file\n       if in_files[idx][0] != \".\":\n           \n           # Creates temporary label variable to hold pet label name extracted \n           pet_label = \"\"\n\n           # TODO: 2a. BELOW REPLACE pass with CODE that will process each \n           #          filename in the in_files list to extract the dog breed \n           #          name from the filename. Recall that each filename can be\n           #          accessed by in_files[idx]. Be certain to place the \n           #          extracted dog breed name in the variable pet_label \n           #          that's created as an empty string ABOVE\n           pass\n\n           # If filename doesn't already exist in dictionary add it and it's\n           # pet label - otherwise print an error message because indicates \n           # duplicate files (filenames)\n           if in_files[idx] not in results_dic:\n              results_dic[in_files[idx]] = [pet_label]\n              \n           else:\n               print(\"** Warning: Duplicate files exist in directory:\", \n                     in_files[idx])\n \n    # TODO 2b. Replace None with the results_dic dictionary that you created\n    # with this function\n    return None\n"
  },
  {
    "path": "intropyproject-classify-pet-images/imagenet1000_clsid_to_human.txt",
    "content": "{0: 'tench, Tinca tinca',\n 1: 'goldfish, Carassius auratus',\n 2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',\n 3: 'tiger shark, Galeocerdo cuvieri',\n 4: 'hammerhead, hammerhead shark',\n 5: 'electric ray, crampfish, numbfish, torpedo',\n 6: 'stingray',\n 7: 'cock',\n 8: 'hen',\n 9: 'ostrich, Struthio camelus',\n 10: 'brambling, Fringilla montifringilla',\n 11: 'goldfinch, Carduelis carduelis',\n 12: 'house finch, linnet, Carpodacus mexicanus',\n 13: 'junco, snowbird',\n 14: 'indigo bunting, indigo finch, indigo bird, Passerina cyanea',\n 15: 'robin, American robin, Turdus migratorius',\n 16: 'bulbul',\n 17: 'jay',\n 18: 'magpie',\n 19: 'chickadee',\n 20: 'water ouzel, dipper',\n 21: 'kite',\n 22: 'bald eagle, American eagle, Haliaeetus leucocephalus',\n 23: 'vulture',\n 24: 'great grey owl, great gray owl, Strix nebulosa',\n 25: 'European fire salamander, Salamandra salamandra',\n 26: 'common newt, Triturus vulgaris',\n 27: 'eft',\n 28: 'spotted salamander, Ambystoma maculatum',\n 29: 'axolotl, mud puppy, Ambystoma mexicanum',\n 30: 'bullfrog, Rana catesbeiana',\n 31: 'tree frog, tree-frog',\n 32: 'tailed frog, bell toad, ribbed toad, tailed toad, Ascaphus trui',\n 33: 'loggerhead, loggerhead turtle, Caretta caretta',\n 34: 'leatherback turtle, leatherback, leathery turtle, Dermochelys coriacea',\n 35: 'mud turtle',\n 36: 'terrapin',\n 37: 'box turtle, box tortoise',\n 38: 'banded gecko, gecko',\n 39: 'common iguana, iguana, Iguana iguana',\n 40: 'American chameleon, anole, Anolis carolinensis',\n 41: 'whiptail, whiptail lizard',\n 42: 'agama',\n 43: 'frilled lizard, Chlamydosaurus kingi',\n 44: 'alligator lizard',\n 45: 'Gila monster, Heloderma suspectum',\n 46: 'green lizard, Lacerta viridis',\n 47: 'African chameleon, Chamaeleo chamaeleon',\n 48: 'Komodo dragon, Komodo lizard, dragon lizard, giant lizard, Varanus komodoensis',\n 49: 'African crocodile, Nile crocodile, Crocodylus niloticus',\n 50: 'American alligator, Alligator mississipiensis',\n 51: 'triceratops',\n 52: 'thunder snake, worm snake, Carphophis amoenus',\n 53: 'ringneck snake, ring-necked snake, ring snake',\n 54: 'hognose snake, puff adder, sand viper',\n 55: 'green snake, grass snake',\n 56: 'king snake, kingsnake',\n 57: 'garter snake, grass snake',\n 58: 'water snake',\n 59: 'vine snake',\n 60: 'night snake, Hypsiglena torquata',\n 61: 'boa constrictor, Constrictor constrictor',\n 62: 'rock python, rock snake, Python sebae',\n 63: 'Indian cobra, Naja naja',\n 64: 'green mamba',\n 65: 'sea snake',\n 66: 'horned viper, cerastes, sand viper, horned asp, Cerastes cornutus',\n 67: 'diamondback, diamondback rattlesnake, Crotalus adamanteus',\n 68: 'sidewinder, horned rattlesnake, Crotalus cerastes',\n 69: 'trilobite',\n 70: 'harvestman, daddy longlegs, Phalangium opilio',\n 71: 'scorpion',\n 72: 'black and gold garden spider, Argiope aurantia',\n 73: 'barn spider, Araneus cavaticus',\n 74: 'garden spider, Aranea diademata',\n 75: 'black widow, Latrodectus mactans',\n 76: 'tarantula',\n 77: 'wolf spider, hunting spider',\n 78: 'tick',\n 79: 'centipede',\n 80: 'black grouse',\n 81: 'ptarmigan',\n 82: 'ruffed grouse, partridge, Bonasa umbellus',\n 83: 'prairie chicken, prairie grouse, prairie fowl',\n 84: 'peacock',\n 85: 'quail',\n 86: 'partridge',\n 87: 'African grey, African gray, Psittacus erithacus',\n 88: 'macaw',\n 89: 'sulphur-crested cockatoo, Kakatoe galerita, Cacatua galerita',\n 90: 'lorikeet',\n 91: 'coucal',\n 92: 'bee eater',\n 93: 'hornbill',\n 94: 'hummingbird',\n 95: 'jacamar',\n 96: 'toucan',\n 97: 'drake',\n 98: 'red-breasted merganser, Mergus serrator',\n 99: 'goose',\n 100: 'black swan, Cygnus atratus',\n 101: 'tusker',\n 102: 'echidna, spiny anteater, anteater',\n 103: 'platypus, duckbill, duckbilled platypus, duck-billed platypus, Ornithorhynchus anatinus',\n 104: 'wallaby, brush kangaroo',\n 105: 'koala, koala bear, kangaroo bear, native bear, Phascolarctos cinereus',\n 106: 'wombat',\n 107: 'jellyfish',\n 108: 'sea anemone, anemone',\n 109: 'brain coral',\n 110: 'flatworm, platyhelminth',\n 111: 'nematode, nematode worm, roundworm',\n 112: 'conch',\n 113: 'snail',\n 114: 'slug',\n 115: 'sea slug, nudibranch',\n 116: 'chiton, coat-of-mail shell, sea cradle, polyplacophore',\n 117: 'chambered nautilus, pearly nautilus, nautilus',\n 118: 'Dungeness crab, Cancer magister',\n 119: 'rock crab, Cancer irroratus',\n 120: 'fiddler crab',\n 121: 'king crab, Alaska crab, Alaskan king crab, Alaska king crab, Paralithodes camtschatica',\n 122: 'American lobster, Northern lobster, Maine lobster, Homarus americanus',\n 123: 'spiny lobster, langouste, rock lobster, crawfish, crayfish, sea crawfish',\n 124: 'crayfish, crawfish, crawdad, crawdaddy',\n 125: 'hermit crab',\n 126: 'isopod',\n 127: 'white stork, Ciconia ciconia',\n 128: 'black stork, Ciconia nigra',\n 129: 'spoonbill',\n 130: 'flamingo',\n 131: 'little blue heron, Egretta caerulea',\n 132: 'American egret, great white heron, Egretta albus',\n 133: 'bittern',\n 134: 'crane',\n 135: 'limpkin, Aramus pictus',\n 136: 'European gallinule, Porphyrio porphyrio',\n 137: 'American coot, marsh hen, mud hen, water hen, Fulica americana',\n 138: 'bustard',\n 139: 'ruddy turnstone, Arenaria interpres',\n 140: 'red-backed sandpiper, dunlin, Erolia alpina',\n 141: 'redshank, Tringa totanus',\n 142: 'dowitcher',\n 143: 'oystercatcher, oyster catcher',\n 144: 'pelican',\n 145: 'king penguin, Aptenodytes patagonica',\n 146: 'albatross, mollymawk',\n 147: 'grey whale, gray whale, devilfish, Eschrichtius gibbosus, Eschrichtius robustus',\n 148: 'killer whale, killer, orca, grampus, sea wolf, Orcinus orca',\n 149: 'dugong, Dugong dugon',\n 150: 'sea lion',\n 151: 'Chihuahua',\n 152: 'Japanese spaniel',\n 153: 'Maltese dog, Maltese terrier, Maltese',\n 154: 'Pekinese, Pekingese, Peke',\n 155: 'Shih-Tzu',\n 156: 'Blenheim spaniel',\n 157: 'papillon',\n 158: 'toy terrier',\n 159: 'Rhodesian ridgeback',\n 160: 'Afghan hound, Afghan',\n 161: 'basset, basset hound',\n 162: 'beagle',\n 163: 'bloodhound, sleuthhound',\n 164: 'bluetick',\n 165: 'black-and-tan coonhound',\n 166: 'Walker hound, Walker foxhound',\n 167: 'English foxhound',\n 168: 'redbone',\n 169: 'borzoi, Russian wolfhound',\n 170: 'Irish wolfhound',\n 171: 'Italian greyhound',\n 172: 'whippet',\n 173: 'Ibizan hound, Ibizan Podenco',\n 174: 'Norwegian elkhound, elkhound',\n 175: 'otterhound, otter hound',\n 176: 'Saluki, gazelle hound',\n 177: 'Scottish deerhound, deerhound',\n 178: 'Weimaraner',\n 179: 'Staffordshire bullterrier, Staffordshire bull terrier',\n 180: 'American Staffordshire terrier, Staffordshire terrier, American pit bull terrier, pit bull terrier',\n 181: 'Bedlington terrier',\n 182: 'Border terrier',\n 183: 'Kerry blue terrier',\n 184: 'Irish terrier',\n 185: 'Norfolk terrier',\n 186: 'Norwich terrier',\n 187: 'Yorkshire terrier',\n 188: 'wire-haired fox terrier',\n 189: 'Lakeland terrier',\n 190: 'Sealyham terrier, Sealyham',\n 191: 'Airedale, Airedale terrier',\n 192: 'cairn, cairn terrier',\n 193: 'Australian terrier',\n 194: 'Dandie Dinmont, Dandie Dinmont terrier',\n 195: 'Boston bull, Boston terrier',\n 196: 'miniature schnauzer',\n 197: 'giant schnauzer',\n 198: 'standard schnauzer, schnauzer',\n 199: 'Scotch terrier, Scottish terrier, Scottie',\n 200: 'Tibetan terrier, chrysanthemum dog',\n 201: 'silky terrier, Sydney silky',\n 202: 'soft-coated wheaten terrier',\n 203: 'West Highland white terrier',\n 204: 'Lhasa, Lhasa apso',\n 205: 'flat-coated retriever',\n 206: 'curly-coated retriever',\n 207: 'golden retriever',\n 208: 'Labrador retriever',\n 209: 'Chesapeake Bay retriever',\n 210: 'German shorthaired pointer',\n 211: 'vizsla, Hungarian pointer',\n 212: 'English setter',\n 213: 'Irish setter, red setter',\n 214: 'Gordon setter',\n 215: 'Brittany spaniel',\n 216: 'clumber, clumber spaniel',\n 217: 'English springer, English springer spaniel',\n 218: 'Welsh springer spaniel',\n 219: 'cocker spaniel, English cocker spaniel, cocker',\n 220: 'Sussex spaniel',\n 221: 'Irish water spaniel',\n 222: 'kuvasz',\n 223: 'schipperke',\n 224: 'groenendael',\n 225: 'malinois',\n 226: 'briard',\n 227: 'kelpie',\n 228: 'komondor',\n 229: 'Old English sheepdog, bobtail',\n 230: 'Shetland sheepdog, Shetland sheep dog, Shetland',\n 231: 'collie',\n 232: 'Border collie',\n 233: 'Bouvier des Flandres, Bouviers des Flandres',\n 234: 'Rottweiler',\n 235: 'German shepherd, German shepherd dog, German police dog, alsatian',\n 236: 'Doberman, Doberman pinscher',\n 237: 'miniature pinscher',\n 238: 'Greater Swiss Mountain dog',\n 239: 'Bernese mountain dog',\n 240: 'Appenzeller',\n 241: 'EntleBucher',\n 242: 'boxer',\n 243: 'bull mastiff',\n 244: 'Tibetan mastiff',\n 245: 'French bulldog',\n 246: 'Great Dane',\n 247: 'Saint Bernard, St Bernard',\n 248: 'Eskimo dog, husky',\n 249: 'malamute, malemute, Alaskan malamute',\n 250: 'Siberian husky',\n 251: 'dalmatian, coach dog, carriage dog',\n 252: 'affenpinscher, monkey pinscher, monkey dog',\n 253: 'basenji',\n 254: 'pug, pug-dog',\n 255: 'Leonberg',\n 256: 'Newfoundland, Newfoundland dog',\n 257: 'Great Pyrenees',\n 258: 'Samoyed, Samoyede',\n 259: 'Pomeranian',\n 260: 'chow, chow chow',\n 261: 'keeshond',\n 262: 'Brabancon griffon',\n 263: 'Pembroke, Pembroke Welsh corgi, corgi',\n 264: 'Cardigan, Cardigan Welsh corgi, corgi',\n 265: 'toy poodle',\n 266: 'miniature poodle',\n 267: 'standard poodle, poodle',\n 268: 'Mexican hairless',\n 269: 'timber wolf, grey wolf, gray wolf, Canis lupus',\n 270: 'white wolf, Arctic wolf, Canis lupus tundrarum',\n 271: 'red wolf, maned wolf, Canis rufus, Canis niger',\n 272: 'coyote, prairie wolf, brush wolf, Canis latrans',\n 273: 'dingo, warrigal, warragal, Canis dingo',\n 274: 'dhole, Cuon alpinus',\n 275: 'African hunting dog, hyena dog, Cape hunting dog, Lycaon pictus',\n 276: 'hyena, hyaena',\n 277: 'red fox, Vulpes vulpes',\n 278: 'kit fox, Vulpes macrotis',\n 279: 'Arctic fox, white fox, Alopex lagopus',\n 280: 'grey fox, gray fox, Urocyon cinereoargenteus',\n 281: 'tabby, tabby cat, cat',\n 282: 'tiger cat, cat',\n 283: 'Persian cat, cat',\n 284: 'Siamese cat, Siamese, cat',\n 285: 'Egyptian cat, cat',\n 286: 'cougar, puma, mountain lion, painter, panther, Felis concolor',\n 287: 'lynx',\n 288: 'leopard, Panthera pardus',\n 289: 'snow leopard, ounce, Panthera uncia',\n 290: 'jaguar, panther, Panthera onca, Felis onca',\n 291: 'lion, king of beasts, Panthera leo',\n 292: 'tiger, Panthera tigris',\n 293: 'cheetah, chetah, Acinonyx jubatus',\n 294: 'brown bear, bruin, Ursus arctos',\n 295: 'American black bear, black bear, Ursus americanus, Euarctos americanus',\n 296: 'ice bear, polar bear, Ursus Maritimus, Thalarctos maritimus',\n 297: 'sloth bear, Melursus ursinus, Ursus ursinus',\n 298: 'mongoose',\n 299: 'meerkat, mierkat',\n 300: 'tiger beetle',\n 301: 'ladybug, ladybeetle, lady beetle, ladybird, ladybird beetle',\n 302: 'ground beetle, carabid beetle',\n 303: 'long-horned beetle, longicorn, longicorn beetle',\n 304: 'leaf beetle, chrysomelid',\n 305: 'dung beetle',\n 306: 'rhinoceros beetle',\n 307: 'weevil',\n 308: 'fly',\n 309: 'bee',\n 310: 'ant, emmet, pismire',\n 311: 'grasshopper, hopper',\n 312: 'cricket',\n 313: 'walking stick, walkingstick, stick insect',\n 314: 'cockroach, roach',\n 315: 'mantis, mantid',\n 316: 'cicada, cicala',\n 317: 'leafhopper',\n 318: 'lacewing, lacewing fly',\n 319: \"dragonfly, darning needle, devil's darning needle, sewing needle, snake feeder, snake doctor, mosquito hawk, skeeter hawk\",\n 320: 'damselfly',\n 321: 'admiral',\n 322: 'ringlet, ringlet butterfly',\n 323: 'monarch, monarch butterfly, milkweed butterfly, Danaus plexippus',\n 324: 'cabbage butterfly',\n 325: 'sulphur butterfly, sulfur butterfly',\n 326: 'lycaenid, lycaenid butterfly',\n 327: 'starfish, sea star',\n 328: 'sea urchin',\n 329: 'sea cucumber, holothurian',\n 330: 'wood rabbit, cottontail, cottontail rabbit, rabbit',\n 331: 'hare',\n 332: 'Angora, Angora rabbit',\n 333: 'hamster',\n 334: 'porcupine, hedgehog',\n 335: 'fox squirrel, eastern fox squirrel, Sciurus niger',\n 336: 'marmot',\n 337: 'beaver',\n 338: 'guinea pig, Cavia cobaya',\n 339: 'sorrel',\n 340: 'zebra',\n 341: 'hog, pig, grunter, squealer, Sus scrofa',\n 342: 'wild boar, boar, Sus scrofa',\n 343: 'warthog',\n 344: 'hippopotamus, hippo, river horse, Hippopotamus amphibius',\n 345: 'ox',\n 346: 'water buffalo, water ox, Asiatic buffalo, Bubalus bubalis',\n 347: 'bison',\n 348: 'ram, tup',\n 349: 'bighorn, bighorn sheep, cimarron, Rocky Mountain bighorn, Rocky Mountain sheep, Ovis canadensis',\n 350: 'ibex, Capra ibex',\n 351: 'hartebeest',\n 352: 'impala, Aepyceros melampus',\n 353: 'gazelle',\n 354: 'Arabian camel, dromedary, Camelus dromedarius',\n 355: 'llama',\n 356: 'weasel',\n 357: 'mink',\n 358: 'polecat, fitch, foulmart, foumart, Mustela putorius',\n 359: 'black-footed ferret, ferret, Mustela nigripes',\n 360: 'otter',\n 361: 'skunk, polecat, wood pussy',\n 362: 'badger',\n 363: 'armadillo',\n 364: 'three-toed sloth, ai, Bradypus tridactylus',\n 365: 'orangutan, orang, orangutang, Pongo pygmaeus',\n 366: 'gorilla, Gorilla gorilla',\n 367: 'chimpanzee, chimp, Pan troglodytes',\n 368: 'gibbon, Hylobates lar',\n 369: 'siamang, Hylobates syndactylus, Symphalangus syndactylus',\n 370: 'guenon, guenon monkey',\n 371: 'patas, hussar monkey, Erythrocebus patas',\n 372: 'baboon',\n 373: 'macaque',\n 374: 'langur',\n 375: 'colobus, colobus monkey',\n 376: 'proboscis monkey, Nasalis larvatus',\n 377: 'marmoset',\n 378: 'capuchin, ringtail, Cebus capucinus',\n 379: 'howler monkey, howler',\n 380: 'titi, titi monkey',\n 381: 'spider monkey, Ateles geoffroyi',\n 382: 'squirrel monkey, Saimiri sciureus',\n 383: 'Madagascar cat, ring-tailed lemur, Lemur catta',\n 384: 'indri, indris, Indri indri, Indri brevicaudatus',\n 385: 'Indian elephant, Elephas maximus',\n 386: 'African elephant, Loxodonta africana',\n 387: 'lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens',\n 388: 'giant panda, panda, panda bear, coon bear, Ailuropoda melanoleuca',\n 389: 'barracouta, snoek',\n 390: 'eel',\n 391: 'coho, cohoe, coho salmon, blue jack, silver salmon, Oncorhynchus kisutch',\n 392: 'rock beauty, Holocanthus tricolor',\n 393: 'anemone fish',\n 394: 'sturgeon',\n 395: 'gar, garfish, garpike, billfish, Lepisosteus osseus',\n 396: 'lionfish',\n 397: 'puffer, pufferfish, blowfish, globefish',\n 398: 'abacus',\n 399: 'abaya',\n 400: \"academic gown, academic robe, judge's robe\",\n 401: 'accordion, piano accordion, squeeze box',\n 402: 'acoustic guitar',\n 403: 'aircraft carrier, carrier, flattop, attack aircraft carrier',\n 404: 'airliner',\n 405: 'airship, dirigible',\n 406: 'altar',\n 407: 'ambulance',\n 408: 'amphibian, amphibious vehicle',\n 409: 'analog clock',\n 410: 'apiary, bee house',\n 411: 'apron',\n 412: 'ashcan, trash can, garbage can, wastebin, ash bin, ash-bin, ashbin, dustbin, trash barrel, trash bin',\n 413: 'assault rifle, assault gun',\n 414: 'backpack, back pack, knapsack, packsack, rucksack, haversack',\n 415: 'bakery, bakeshop, bakehouse',\n 416: 'balance beam, beam',\n 417: 'balloon',\n 418: 'ballpoint, ballpoint pen, ballpen, Biro',\n 419: 'Band Aid',\n 420: 'banjo',\n 421: 'bannister, banister, balustrade, balusters, handrail',\n 422: 'barbell',\n 423: 'barber chair',\n 424: 'barbershop',\n 425: 'barn',\n 426: 'barometer',\n 427: 'barrel, cask',\n 428: 'barrow, garden cart, lawn cart, wheelbarrow',\n 429: 'baseball',\n 430: 'basketball',\n 431: 'bassinet',\n 432: 'bassoon',\n 433: 'bathing cap, swimming cap',\n 434: 'bath towel',\n 435: 'bathtub, bathing tub, bath, tub',\n 436: 'beach wagon, station wagon, wagon, estate car, beach waggon, station waggon, waggon',\n 437: 'beacon, lighthouse, beacon light, pharos',\n 438: 'beaker',\n 439: 'bearskin, busby, shako',\n 440: 'beer bottle',\n 441: 'beer glass',\n 442: 'bell cote, bell cot',\n 443: 'bib',\n 444: 'bicycle-built-for-two, tandem bicycle, tandem',\n 445: 'bikini, two-piece',\n 446: 'binder, ring-binder',\n 447: 'binoculars, field glasses, opera glasses',\n 448: 'birdhouse',\n 449: 'boathouse',\n 450: 'bobsled, bobsleigh, bob',\n 451: 'bolo tie, bolo, bola tie, bola',\n 452: 'bonnet, poke bonnet',\n 453: 'bookcase',\n 454: 'bookshop, bookstore, bookstall',\n 455: 'bottlecap',\n 456: 'bow',\n 457: 'bow tie, bow-tie, bowtie',\n 458: 'brass, memorial tablet, plaque',\n 459: 'brassiere, bra, bandeau',\n 460: 'breakwater, groin, groyne, mole, bulwark, seawall, jetty',\n 461: 'breastplate, aegis, egis',\n 462: 'broom',\n 463: 'bucket, pail',\n 464: 'buckle',\n 465: 'bulletproof vest',\n 466: 'bullet train, bullet',\n 467: 'butcher shop, meat market',\n 468: 'cab, hack, taxi, taxicab',\n 469: 'caldron, cauldron',\n 470: 'candle, taper, wax light',\n 471: 'cannon',\n 472: 'canoe',\n 473: 'can opener, tin opener',\n 474: 'cardigan',\n 475: 'car mirror',\n 476: 'carousel, carrousel, merry-go-round, roundabout, whirligig',\n 477: \"carpenter's kit, tool kit\",\n 478: 'carton',\n 479: 'car wheel',\n 480: 'cash machine, cash dispenser, automated teller machine, automatic teller machine, automated teller, automatic teller, ATM',\n 481: 'cassette',\n 482: 'cassette player',\n 483: 'castle',\n 484: 'catamaran',\n 485: 'CD player',\n 486: 'cello, violoncello',\n 487: 'cellular telephone, cellular phone, cellphone, cell, mobile phone',\n 488: 'chain',\n 489: 'chainlink fence',\n 490: 'chain mail, ring mail, mail, chain armor, chain armour, ring armor, ring armour',\n 491: 'chain saw, chainsaw',\n 492: 'chest',\n 493: 'chiffonier, commode',\n 494: 'chime, bell, gong',\n 495: 'china cabinet, china closet',\n 496: 'Christmas stocking',\n 497: 'church, church building',\n 498: 'cinema, movie theater, movie theatre, movie house, picture palace',\n 499: 'cleaver, meat cleaver, chopper',\n 500: 'cliff dwelling',\n 501: 'cloak',\n 502: 'clog, geta, patten, sabot',\n 503: 'cocktail shaker',\n 504: 'coffee mug',\n 505: 'coffeepot',\n 506: 'coil, spiral, volute, whorl, helix',\n 507: 'combination lock',\n 508: 'computer keyboard, keypad',\n 509: 'confectionery, confectionary, candy store',\n 510: 'container ship, containership, container vessel',\n 511: 'convertible',\n 512: 'corkscrew, bottle screw',\n 513: 'cornet, horn, trumpet, trump',\n 514: 'cowboy boot',\n 515: 'cowboy hat, ten-gallon hat',\n 516: 'cradle',\n 517: 'crane',\n 518: 'crash helmet',\n 519: 'crate',\n 520: 'crib, cot',\n 521: 'Crock Pot',\n 522: 'croquet ball',\n 523: 'crutch',\n 524: 'cuirass',\n 525: 'dam, dike, dyke',\n 526: 'desk',\n 527: 'desktop computer',\n 528: 'dial telephone, dial phone',\n 529: 'diaper, nappy, napkin',\n 530: 'digital clock',\n 531: 'digital watch',\n 532: 'dining table, board',\n 533: 'dishrag, dishcloth',\n 534: 'dishwasher, dish washer, dishwashing machine',\n 535: 'disk brake, disc brake',\n 536: 'dock, dockage, docking facility',\n 537: 'dogsled, dog sled, dog sleigh',\n 538: 'dome',\n 539: 'doormat, welcome mat',\n 540: 'drilling platform, offshore rig',\n 541: 'drum, membranophone, tympan',\n 542: 'drumstick',\n 543: 'dumbbell',\n 544: 'Dutch oven',\n 545: 'electric fan, blower',\n 546: 'electric guitar',\n 547: 'electric locomotive',\n 548: 'entertainment center',\n 549: 'envelope',\n 550: 'espresso maker',\n 551: 'face powder',\n 552: 'feather boa, boa',\n 553: 'file, file cabinet, filing cabinet',\n 554: 'fireboat',\n 555: 'fire engine, fire truck',\n 556: 'fire screen, fireguard',\n 557: 'flagpole, flagstaff',\n 558: 'flute, transverse flute',\n 559: 'folding chair',\n 560: 'football helmet',\n 561: 'forklift',\n 562: 'fountain',\n 563: 'fountain pen',\n 564: 'four-poster',\n 565: 'freight car',\n 566: 'French horn, horn',\n 567: 'frying pan, frypan, skillet',\n 568: 'fur coat',\n 569: 'garbage truck, dustcart',\n 570: 'gasmask, respirator, gas helmet',\n 571: 'gas pump, gasoline pump, petrol pump, island dispenser',\n 572: 'goblet',\n 573: 'go-kart',\n 574: 'golf ball',\n 575: 'golfcart, golf cart',\n 576: 'gondola',\n 577: 'gong, tam-tam',\n 578: 'gown',\n 579: 'grand piano, grand',\n 580: 'greenhouse, nursery, glasshouse',\n 581: 'grille, radiator grille',\n 582: 'grocery store, grocery, food market, market',\n 583: 'guillotine',\n 584: 'hair slide',\n 585: 'hair spray',\n 586: 'half track',\n 587: 'hammer',\n 588: 'hamper',\n 589: 'hand blower, blow dryer, blow drier, hair dryer, hair drier',\n 590: 'hand-held computer, hand-held microcomputer',\n 591: 'handkerchief, hankie, hanky, hankey',\n 592: 'hard disc, hard disk, fixed disk',\n 593: 'harmonica, mouth organ, harp, mouth harp',\n 594: 'harp',\n 595: 'harvester, reaper',\n 596: 'hatchet',\n 597: 'holster',\n 598: 'home theater, home theatre',\n 599: 'honeycomb',\n 600: 'hook, claw',\n 601: 'hoopskirt, crinoline',\n 602: 'horizontal bar, high bar',\n 603: 'horse cart, horse-cart',\n 604: 'hourglass',\n 605: 'iPod',\n 606: 'iron, smoothing iron',\n 607: \"jack-o'-lantern\",\n 608: 'jean, blue jean, denim',\n 609: 'jeep, landrover',\n 610: 'jersey, T-shirt, tee shirt',\n 611: 'jigsaw puzzle',\n 612: 'jinrikisha, ricksha, rickshaw',\n 613: 'joystick',\n 614: 'kimono',\n 615: 'knee pad',\n 616: 'knot',\n 617: 'lab coat, laboratory coat',\n 618: 'ladle',\n 619: 'lampshade, lamp shade',\n 620: 'laptop, laptop computer',\n 621: 'lawn mower, mower',\n 622: 'lens cap, lens cover',\n 623: 'letter opener, paper knife, paperknife',\n 624: 'library',\n 625: 'lifeboat',\n 626: 'lighter, light, igniter, ignitor',\n 627: 'limousine, limo',\n 628: 'liner, ocean liner',\n 629: 'lipstick, lip rouge',\n 630: 'Loafer',\n 631: 'lotion',\n 632: 'loudspeaker, speaker, speaker unit, loudspeaker system, speaker system',\n 633: \"loupe, jeweler's loupe\",\n 634: 'lumbermill, sawmill',\n 635: 'magnetic compass',\n 636: 'mailbag, postbag',\n 637: 'mailbox, letter box',\n 638: 'maillot',\n 639: 'maillot, tank suit',\n 640: 'manhole cover',\n 641: 'maraca',\n 642: 'marimba, xylophone',\n 643: 'mask',\n 644: 'matchstick',\n 645: 'maypole',\n 646: 'maze, labyrinth',\n 647: 'measuring cup',\n 648: 'medicine chest, medicine cabinet',\n 649: 'megalith, megalithic structure',\n 650: 'microphone, mike',\n 651: 'microwave, microwave oven',\n 652: 'military uniform',\n 653: 'milk can',\n 654: 'minibus',\n 655: 'miniskirt, mini',\n 656: 'minivan',\n 657: 'missile',\n 658: 'mitten',\n 659: 'mixing bowl',\n 660: 'mobile home, manufactured home',\n 661: 'Model T',\n 662: 'modem',\n 663: 'monastery',\n 664: 'monitor',\n 665: 'moped',\n 666: 'mortar',\n 667: 'mortarboard',\n 668: 'mosque',\n 669: 'mosquito net',\n 670: 'motor scooter, scooter',\n 671: 'mountain bike, all-terrain bike, off-roader',\n 672: 'mountain tent',\n 673: 'mouse, computer mouse',\n 674: 'mousetrap',\n 675: 'moving van',\n 676: 'muzzle',\n 677: 'nail',\n 678: 'neck brace',\n 679: 'necklace',\n 680: 'nipple',\n 681: 'notebook, notebook computer',\n 682: 'obelisk',\n 683: 'oboe, hautboy, hautbois',\n 684: 'ocarina, sweet potato',\n 685: 'odometer, hodometer, mileometer, milometer',\n 686: 'oil filter',\n 687: 'organ, pipe organ',\n 688: 'oscilloscope, scope, cathode-ray oscilloscope, CRO',\n 689: 'overskirt',\n 690: 'oxcart',\n 691: 'oxygen mask',\n 692: 'packet',\n 693: 'paddle, boat paddle',\n 694: 'paddlewheel, paddle wheel',\n 695: 'padlock',\n 696: 'paintbrush',\n 697: \"pajama, pyjama, pj's, jammies\",\n 698: 'palace',\n 699: 'panpipe, pandean pipe, syrinx',\n 700: 'paper towel',\n 701: 'parachute, chute',\n 702: 'parallel bars, bars',\n 703: 'park bench',\n 704: 'parking meter',\n 705: 'passenger car, coach, carriage',\n 706: 'patio, terrace',\n 707: 'pay-phone, pay-station',\n 708: 'pedestal, plinth, footstall',\n 709: 'pencil box, pencil case',\n 710: 'pencil sharpener',\n 711: 'perfume, essence',\n 712: 'Petri dish',\n 713: 'photocopier',\n 714: 'pick, plectrum, plectron',\n 715: 'pickelhaube',\n 716: 'picket fence, paling',\n 717: 'pickup, pickup truck',\n 718: 'pier',\n 719: 'piggy bank, penny bank',\n 720: 'pill bottle',\n 721: 'pillow',\n 722: 'ping-pong ball',\n 723: 'pinwheel',\n 724: 'pirate, pirate ship',\n 725: 'pitcher, ewer',\n 726: \"plane, carpenter's plane, woodworking plane\",\n 727: 'planetarium',\n 728: 'plastic bag',\n 729: 'plate rack',\n 730: 'plow, plough',\n 731: \"plunger, plumber's helper\",\n 732: 'Polaroid camera, Polaroid Land camera',\n 733: 'pole',\n 734: 'police van, police wagon, paddy wagon, patrol wagon, wagon, black Maria',\n 735: 'poncho',\n 736: 'pool table, billiard table, snooker table',\n 737: 'pop bottle, soda bottle',\n 738: 'pot, flowerpot',\n 739: \"potter's wheel\",\n 740: 'power drill',\n 741: 'prayer rug, prayer mat',\n 742: 'printer',\n 743: 'prison, prison house',\n 744: 'projectile, missile',\n 745: 'projector',\n 746: 'puck, hockey puck',\n 747: 'punching bag, punch bag, punching ball, punchball',\n 748: 'purse',\n 749: 'quill, quill pen',\n 750: 'quilt, comforter, comfort, puff',\n 751: 'racer, race car, racing car',\n 752: 'racket, racquet',\n 753: 'radiator',\n 754: 'radio, wireless',\n 755: 'radio telescope, radio reflector',\n 756: 'rain barrel',\n 757: 'recreational vehicle, RV, R.V.',\n 758: 'reel',\n 759: 'reflex camera',\n 760: 'refrigerator, icebox',\n 761: 'remote control, remote',\n 762: 'restaurant, eating house, eating place, eatery',\n 763: 'revolver, six-gun, six-shooter',\n 764: 'rifle',\n 765: 'rocking chair, rocker',\n 766: 'rotisserie',\n 767: 'rubber eraser, rubber, pencil eraser',\n 768: 'rugby ball',\n 769: 'rule, ruler',\n 770: 'running shoe',\n 771: 'safe',\n 772: 'safety pin',\n 773: 'saltshaker, salt shaker',\n 774: 'sandal',\n 775: 'sarong',\n 776: 'sax, saxophone',\n 777: 'scabbard',\n 778: 'scale, weighing machine',\n 779: 'school bus',\n 780: 'schooner',\n 781: 'scoreboard',\n 782: 'screen, CRT screen',\n 783: 'screw',\n 784: 'screwdriver',\n 785: 'seat belt, seatbelt',\n 786: 'sewing machine',\n 787: 'shield, buckler',\n 788: 'shoe shop, shoe-shop, shoe store',\n 789: 'shoji',\n 790: 'shopping basket',\n 791: 'shopping cart',\n 792: 'shovel',\n 793: 'shower cap',\n 794: 'shower curtain',\n 795: 'ski',\n 796: 'ski mask',\n 797: 'sleeping bag',\n 798: 'slide rule, slipstick',\n 799: 'sliding door',\n 800: 'slot, one-armed bandit',\n 801: 'snorkel',\n 802: 'snowmobile',\n 803: 'snowplow, snowplough',\n 804: 'soap dispenser',\n 805: 'soccer ball',\n 806: 'sock',\n 807: 'solar dish, solar collector, solar furnace',\n 808: 'sombrero',\n 809: 'soup bowl',\n 810: 'space bar',\n 811: 'space heater',\n 812: 'space shuttle',\n 813: 'spatula',\n 814: 'speedboat',\n 815: \"spider web, spider's web\",\n 816: 'spindle',\n 817: 'sports car, sport car',\n 818: 'spotlight, spot',\n 819: 'stage',\n 820: 'steam locomotive',\n 821: 'steel arch bridge',\n 822: 'steel drum',\n 823: 'stethoscope',\n 824: 'stole',\n 825: 'stone wall',\n 826: 'stopwatch, stop watch',\n 827: 'stove',\n 828: 'strainer',\n 829: 'streetcar, tram, tramcar, trolley, trolley car',\n 830: 'stretcher',\n 831: 'studio couch, day bed',\n 832: 'stupa, tope',\n 833: 'submarine, pigboat, sub, U-boat',\n 834: 'suit, suit of clothes',\n 835: 'sundial',\n 836: 'sunglass',\n 837: 'sunglasses, dark glasses, shades',\n 838: 'sunscreen, sunblock, sun blocker',\n 839: 'suspension bridge',\n 840: 'swab, swob, mop',\n 841: 'sweatshirt',\n 842: 'swimming trunks, bathing trunks',\n 843: 'swing',\n 844: 'switch, electric switch, electrical switch',\n 845: 'syringe',\n 846: 'table lamp',\n 847: 'tank, army tank, armored combat vehicle, armoured combat vehicle',\n 848: 'tape player',\n 849: 'teapot',\n 850: 'teddy, teddy bear',\n 851: 'television, television system',\n 852: 'tennis ball',\n 853: 'thatch, thatched roof',\n 854: 'theater curtain, theatre curtain',\n 855: 'thimble',\n 856: 'thresher, thrasher, threshing machine',\n 857: 'throne',\n 858: 'tile roof',\n 859: 'toaster',\n 860: 'tobacco shop, tobacconist shop, tobacconist',\n 861: 'toilet seat',\n 862: 'torch',\n 863: 'totem pole',\n 864: 'tow truck, tow car, wrecker',\n 865: 'toyshop',\n 866: 'tractor',\n 867: 'trailer truck, tractor trailer, trucking rig, rig, articulated lorry, semi',\n 868: 'tray',\n 869: 'trench coat',\n 870: 'tricycle, trike, velocipede',\n 871: 'trimaran',\n 872: 'tripod',\n 873: 'triumphal arch',\n 874: 'trolleybus, trolley coach, trackless trolley',\n 875: 'trombone',\n 876: 'tub, vat',\n 877: 'turnstile',\n 878: 'typewriter keyboard',\n 879: 'umbrella',\n 880: 'unicycle, monocycle',\n 881: 'upright, upright piano',\n 882: 'vacuum, vacuum cleaner',\n 883: 'vase',\n 884: 'vault',\n 885: 'velvet',\n 886: 'vending machine',\n 887: 'vestment',\n 888: 'viaduct',\n 889: 'violin, fiddle',\n 890: 'volleyball',\n 891: 'waffle iron',\n 892: 'wall clock',\n 893: 'wallet, billfold, notecase, pocketbook',\n 894: 'wardrobe, closet, press',\n 895: 'warplane, military plane',\n 896: 'washbasin, handbasin, washbowl, lavabo, wash-hand basin',\n 897: 'washer, automatic washer, washing machine',\n 898: 'water bottle',\n 899: 'water jug',\n 900: 'water tower',\n 901: 'whiskey jug',\n 902: 'whistle',\n 903: 'wig',\n 904: 'window screen',\n 905: 'window shade',\n 906: 'Windsor tie',\n 907: 'wine bottle',\n 908: 'wing',\n 909: 'wok',\n 910: 'wooden spoon',\n 911: 'wool, woolen, woollen',\n 912: 'worm fence, snake fence, snake-rail fence, Virginia fence',\n 913: 'wreck',\n 914: 'yawl',\n 915: 'yurt',\n 916: 'web site, website, internet site, site',\n 917: 'comic book',\n 918: 'crossword puzzle, crossword',\n 919: 'street sign',\n 920: 'traffic light, traffic signal, stoplight',\n 921: 'book jacket, dust cover, dust jacket, dust wrapper',\n 922: 'menu',\n 923: 'plate',\n 924: 'guacamole',\n 925: 'consomme',\n 926: 'hot pot, hotpot',\n 927: 'trifle',\n 928: 'ice cream, icecream',\n 929: 'ice lolly, lolly, lollipop, popsicle',\n 930: 'French loaf',\n 931: 'bagel, beigel',\n 932: 'pretzel',\n 933: 'cheeseburger',\n 934: 'hotdog, hot dog, red hot',\n 935: 'mashed potato',\n 936: 'head cabbage',\n 937: 'broccoli',\n 938: 'cauliflower',\n 939: 'zucchini, courgette',\n 940: 'spaghetti squash',\n 941: 'acorn squash',\n 942: 'butternut squash',\n 943: 'cucumber, cuke',\n 944: 'artichoke, globe artichoke',\n 945: 'bell pepper',\n 946: 'cardoon',\n 947: 'mushroom',\n 948: 'Granny Smith',\n 949: 'strawberry',\n 950: 'orange',\n 951: 'lemon',\n 952: 'fig',\n 953: 'pineapple, ananas',\n 954: 'banana',\n 955: 'jackfruit, jak, jack',\n 956: 'custard apple',\n 957: 'pomegranate',\n 958: 'hay',\n 959: 'carbonara',\n 960: 'chocolate sauce, chocolate syrup',\n 961: 'dough',\n 962: 'meat loaf, meatloaf',\n 963: 'pizza, pizza pie',\n 964: 'potpie',\n 965: 'burrito',\n 966: 'red wine',\n 967: 'espresso',\n 968: 'cup',\n 969: 'eggnog',\n 970: 'alp',\n 971: 'bubble',\n 972: 'cliff, drop, drop-off',\n 973: 'coral reef',\n 974: 'geyser',\n 975: 'lakeside, lakeshore',\n 976: 'promontory, headland, head, foreland',\n 977: 'sandbar, sand bar',\n 978: 'seashore, coast, seacoast, sea-coast',\n 979: 'valley, vale',\n 980: 'volcano',\n 981: 'ballplayer, baseball player',\n 982: 'groom, bridegroom',\n 983: 'scuba diver',\n 984: 'rapeseed',\n 985: 'daisy',\n 986: \"yellow lady's slipper, yellow lady-slipper, Cypripedium calceolus, Cypripedium parviflorum\",\n 987: 'corn',\n 988: 'acorn',\n 989: 'hip, rose hip, rosehip',\n 990: 'buckeye, horse chestnut, conker',\n 991: 'coral fungus',\n 992: 'agaric',\n 993: 'gyromitra',\n 994: 'stinkhorn, carrion fungus',\n 995: 'earthstar',\n 996: 'hen-of-the-woods, hen of the woods, Polyporus frondosus, Grifola frondosa',\n 997: 'bolete',\n 998: 'ear, spike, capitulum',\n 999: 'toilet tissue, toilet paper, bathroom tissue'}\n"
  },
  {
    "path": "intropyproject-classify-pet-images/print_functions_for_lab_checks.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# */AIPND/intropylab-classifying-images/print_functions_for_lab_checks.py\n#                                                                             \n# PROGRAMMER: Jennifer S.                                                    \n# DATE CREATED: 05/14/2018                                  \n# REVISED DATE:             <=(Date Revised - if any)                         \n# PURPOSE:  This set of functions can be used to check your code after programming \n#           each function. The top section of each part of the lab contains\n#           the section labeled 'Checking your code'. When directed within this\n#           section of the lab one can use these functions to more easily check \n#           your code. See the docstrings below each function for details on how\n#           to use the function within your code.\n#\n##\n\n# Functions below defined to help with \"Checking your code\", specifically\n# running these functions with the appropriate input arguments within the\n# main() funtion will print out what's needed for \"Checking your code\"\n#\ndef check_command_line_arguments(in_arg):\n    \"\"\"\n    For Lab: Classifying Images - 7. Command Line Arguments\n    Prints each of the command line arguments passed in as parameter in_arg, \n    assumes you defined all three command line arguments as outlined in \n    '7. Command Line Arguments'\n    Parameters:\n     in_arg -data structure that stores the command line arguments object\n    Returns:\n     Nothing - just prints to console  \n    \"\"\"\n    if in_arg is None:\n        print(\"* Doesn't Check the Command Line Arguments because 'get_input_args' hasn't been defined.\")\n    else:\n        # prints command line agrs\n        print(\"Command Line Arguments:\\n     dir =\", in_arg.dir, \n              \"\\n    arch =\", in_arg.arch, \"\\n dogfile =\", in_arg.dogfile)\n\ndef check_creating_pet_image_labels(results_dic):\n    \"\"\"    For Lab: Classifying Images - 9/10. Creating Pet Image Labels\n    Prints first 10 key-value pairs and makes sure there are 40 key-value \n    pairs in your results_dic dictionary. Assumes you defined the results_dic\n    dictionary as was outlined in \n    '9/10. Creating Pet Image Labels'\n    Parameters:\n      results_dic - Dictionary with key as image filename and value as a List \n             (index)idx 0 = pet image label (string)\n    Returns:\n     Nothing - just prints to console  \n    \"\"\"\n    if results_dic is None:\n        print(\"* Doesn't Check the Results Dictionary because 'get_pet_labels' hasn't been defined.\")\n    else:\n        # Code to print 10 key-value pairs (or fewer if less than 10 images)\n        # & makes sure there are 40 pairs, one for each file in pet_images/\n        stop_point = len(results_dic)\n        if stop_point > 10:\n            stop_point = 10\n        print(\"\\nPet Image Label Dictionary has\", len(results_dic),\n              \"key-value pairs.\\nBelow are\", stop_point, \"of them:\")\n    \n        # counter - to count how many labels have been printed\n        n = 0\n    \n        # for loop to iterate through the dictionary\n        for key in results_dic:\n \n            # prints only first 10 labels\n            if n < stop_point:\n                print(\"{:2d} key: {:>30}  label: {:>26}\".format(n+1, key,\n                      results_dic[key][0]) )\n\n                # Increments counter\n                n += 1\n            \n            # If past first 10 (or fewer) labels the breaks out of loop\n            else:\n                break\n\n\ndef check_classifying_images(results_dic):\n    \"\"\"    For Lab: Classifying Images - 11/12. Classifying Images\n    Prints Pet Image Label and Classifier Label for ALL Matches followed by ALL \n    NOT matches. Next prints out the total number of images followed by how \n    many were matches and how many were not-matches to check all 40 images are\n    processed. Assumes you defined the results_dic dictionary as was \n    outlined in '11/12. Classifying Images'\n    Parameters:\n      results_dic - Dictionary with key as image filename and value as a List \n             (index)idx 0 = pet image label (string)\n                    idx 1 = classifier label (string)\n                    idx 2 = 1/0 (int)   where 1 = match between pet image and \n                    classifer labels and 0 = no match between labels\n    Returns:\n     Nothing - just prints to console  \n\n    \"\"\"\n    if results_dic is None:\n        print(\"* Doesn't Check the Results Dictionary because 'classify_images' hasn't been defined.\")\n    elif len(results_dic[next(iter(results_dic))]) < 2:\n        print(\"* Doesn't Check the Results Dictionary because 'classify_images' hasn't been defined.\")\n    else:\n        # Code for checking classify_images -\n        # Checks matches and not matches are classified correctly\n        # Checks that all 40 images are classified as a Match or Not-a Match\n    \n        # Sets counters for matches & NOT-matches\n        n_match = 0\n        n_notmatch = 0\n    \n        # Prints all Matches first\n        print(\"\\n     MATCH:\")\n        for key in results_dic:\n\n            # Prints only if a Match Index 2 == 1\n            if results_dic[key][2] == 1:\n\n                # Increments Match counter\n                n_match += 1\n                print(\"\\n{:>30}: \\nReal: {:>26}   Classifier: {:>30}\".format(key, \n                      results_dic[key][0], results_dic[key][1]))\n\n        # Prints all NOT-Matches next\n        print(\"\\n NOT A MATCH:\")\n        for key in results_dic:\n        \n            # Prints only if NOT-a-Match Index 2 == 0 \n            if results_dic[key][2] == 0:\n \n                # Increments Not-a-Match counter\n                n_notmatch += 1\n                print(\"\\n{:>30}: \\nReal: {:>26}   Classifier: {:>30}\".format(key,\n                      results_dic[key][0], results_dic[key][1]))\n\n        # Prints Total Number of Images - expects 40 from pet_images folder\n        print(\"\\n# Total Images\",n_match + n_notmatch, \"# Matches:\",n_match ,\n              \"# NOT Matches:\",n_notmatch)\n\n \ndef check_classifying_labels_as_dogs(results_dic):\n    \"\"\"    For Lab: Classifying Images - 13. Classifying Labels as Dogs\n    Prints Pet Image Label, Classifier Label, whether Pet Label is-a-dog(1=Yes,\n    0=No), and whether Classifier Label is-a-dog(1=Yes, 0=No) for ALL Matches \n    followed by ALL NOT matches. Next prints out the total number of images \n    followed by how many were matches and how many were not-matches to check \n    all 40 images are processed. Assumes you defined the results_dic dictionary\n    as was outlined in '13. Classifying Labels as Dogs'\n    Parameters:\n      results_dic - Dictionary with key as image filename and value as a List \n             (index)idx 0 = pet image label (string)\n                    idx 1 = classifier label (string)\n                    idx 2 = 1/0 (int)   where 1 = match between pet image and \n                    classifer labels and 0 = no match between labels\n                    idx 3 = 1/0 (int)  where 1 = pet image 'is-a' dog and \n                            0 = pet Image 'is-NOT-a' dog. \n                    idx 4 = 1/0 (int)  where 1 = Classifier classifies image \n                            'as-a' dog and 0 = Classifier classifies image  \n                            'as-NOT-a' dog.\n    Returns:\n     Nothing - just prints to console  \n\n    \"\"\"\n    if results_dic is None:\n        print(\"* Doesn't Check the Results Dictionary because 'adjust_results4_isadog' hasn't been defined.\")\n    elif len(results_dic[next(iter(results_dic))]) < 4 :\n        print(\"* Doesn't Check the Results Dictionary because 'adjust_results4_isadog' hasn't been defined.\")\n\n    else:\n        # Code for checking adjust_results4_isadog -\n        # Checks matches and not matches are classified correctly as \"dogs\" and\n        # \"not-dogs\" Checks that all 40 images are classified as a Match or Not-a \n        # Match\n    \n        # Sets counters for matches & NOT-matches\n        n_match = 0\n        n_notmatch = 0\n    \n        # Prints all Matches first\n        print(\"\\n     MATCH:\")\n        for key in results_dic:\n\n            # Prints only if a Match Index 2 == 1\n            if results_dic[key][2] == 1:\n\n                # Increments Match counter\n                n_match += 1\n                print(\"\\n{:>30}: \\nReal: {:>26}   Classifier: {:>30}  \\nPetLabelDog: {:1d}  ClassLabelDog: {:1d}\".format(key,\n                      results_dic[key][0], results_dic[key][1], results_dic[key][3], \n                      results_dic[key][4]))\n\n        # Prints all NOT-Matches next\n        print(\"\\n NOT A MATCH:\")\n        for key in results_dic:\n        \n            # Prints only if NOT-a-Match Index 2 == 0 \n            if results_dic[key][2] == 0:\n \n                # Increments Not-a-Match counter\n                n_notmatch += 1\n                print(\"\\n{:>30}: \\nReal: {:>26}   Classifier: {:>30}  \\nPetLabelDog: {:1d}  ClassLabelDog: {:1d}\".format(key,\n                      results_dic[key][0], results_dic[key][1], results_dic[key][3], \n                      results_dic[key][4]))\n\n        # Prints Total Number of Images - expects 40 from pet_images folder\n        print(\"\\n# Total Images\",n_match + n_notmatch, \"# Matches:\",n_match ,\n              \"# NOT Matches:\",n_notmatch)\n\n\n\ndef check_calculating_results(results_dic, results_stats_dic):\n    \"\"\"    For Lab: Classifying Images - 14. Calculating Results\n    Prints First statistics from the results stats dictionary (that was created\n    by the calculates_results_stats() function), then prints the same statistics\n    that were calculated in this function using the results dictionary.\n    Assumes you defined the results_stats dictionary and the statistics \n    as was outlined in '14. Calculating Results '\n    Parameters:\n      results_dic - Dictionary with key as image filename and value as a List \n             (index)idx 0 = pet image label (string)\n                    idx 1 = classifier label (string)\n                    idx 2 = 1/0 (int)   where 1 = match between pet image and \n                    classifer labels and 0 = no match between labels\n                    idx 3 = 1/0 (int)  where 1 = pet image 'is-a' dog and \n                            0 = pet Image 'is-NOT-a' dog. \n                    idx 4 = 1/0 (int)  where 1 = Classifier classifies image \n                            'as-a' dog and 0 = Classifier classifies image  \n                            'as-NOT-a' dog.\n     results_stats_dic - Dictionary that contains the results statistics (either\n                     a percentage or a count) where the key is the statistic's \n                     name (starting with 'pct' for percentage or 'n' for count)\n                     and the value is the statistic's value \n    Returns:\n     Nothing - just prints to console  \n\n    \"\"\"\n    if results_stats_dic is None:\n        print(\"* Doesn't Check the Results Dictionary because 'calculates_results_stats' hasn't been defined.\")\n    else:\n        # Code for checking results_stats_dic -\n        # Checks calculations of counts & percentages BY using results_dic\n        # to re-calculate the values and then compare to the values\n        # in results_stats_dic\n    \n        # Initialize counters to zero and number of images total\n        n_images = len(results_dic)\n        n_pet_dog = 0\n        n_class_cdog = 0\n        n_class_cnotd = 0\n        n_match_breed = 0\n    \n        # Interates through results_dic dictionary to recompute the statistics\n        # outside of the calculates_results_stats() function\n        for key in results_dic:\n\n            # match (if dog then breed match)\n            if results_dic[key][2] == 1:\n\n                # isa dog (pet label) & breed match\n                if results_dic[key][3] == 1:\n                    n_pet_dog += 1\n\n                    # isa dog (classifier label) & breed match\n                    if results_dic[key][4] == 1:\n                        n_class_cdog += 1\n                        n_match_breed += 1\n\n                # NOT dog (pet_label)\n                else:\n\n                    # NOT dog (classifier label)\n                    if results_dic[key][4] == 0:\n                        n_class_cnotd += 1\n\n            # NOT - match (not a breed match if a dog)\n            else:\n \n                # NOT - match\n                # isa dog (pet label) \n                if results_dic[key][3] == 1:\n                    n_pet_dog += 1\n\n                    # isa dog (classifier label)\n                    if results_dic[key][4] == 1:\n                        n_class_cdog += 1\n\n                # NOT dog (pet_label)\n                else:\n\n                    # NOT dog (classifier label)\n                    if results_dic[key][4] == 0:\n                        n_class_cnotd += 1\n\n                    \n        # calculates statistics based upon counters from above\n        n_pet_notd = n_images - n_pet_dog\n        pct_corr_dog = ( n_class_cdog / n_pet_dog )*100\n        pct_corr_notdog = ( n_class_cnotd / n_pet_notd )*100\n        pct_corr_breed = ( n_match_breed / n_pet_dog )*100\n    \n        # prints calculated statistics\n        print(\"\\n ** Statistics from calculates_results_stats() function:\")\n        print(\"N Images: {:2d}  N Dog Images: {:2d}  N NotDog Images: {:2d} \\nPct Corr dog: {:5.1f} Pct Corr NOTdog: {:5.1f}  Pct Corr Breed: {:5.1f}\".format(\n              results_stats_dic['n_images'], results_stats_dic['n_dogs_img'],\n              results_stats_dic['n_notdogs_img'], results_stats_dic['pct_correct_dogs'],\n              results_stats_dic['pct_correct_notdogs'],\n              results_stats_dic['pct_correct_breed']))\n        print(\"\\n ** Check Statistics - calculated from this function as a check:\")\n        print(\"N Images: {:2d}  N Dog Images: {:2d}  N NotDog Images: {:2d} \\nPct Corr dog: {:5.1f} Pct Corr NOTdog: {:5.1f}  Pct Corr Breed: {:5.1f}\".format(\n              n_images, n_pet_dog, n_pet_notd, pct_corr_dog, pct_corr_notdog,\n              pct_corr_breed))\n"
  },
  {
    "path": "intropyproject-classify-pet-images/print_results.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# */AIPND-revision/intropyproject-classify-pet-images/print_results.py\n#                                                                             \n# PROGRAMMER: \n# DATE CREATED:\n# REVISED DATE: \n# PURPOSE: Create a function print_results that prints the results statistics\n#          from the results statistics dictionary (results_stats_dic). It \n#          should also allow the user to be able to print out cases of misclassified\n#          dogs and cases of misclassified breeds of dog using the Results \n#          dictionary (results_dic).  \n#         This function inputs:\n#            -The results dictionary as results_dic within print_results \n#             function and results for the function call within main.\n#            -The results statistics dictionary as results_stats_dic within \n#             print_results function and results_stats for the function call within main.\n#            -The CNN model architecture as model wihtin print_results function\n#             and in_arg.arch for the function call within main. \n#            -Prints Incorrectly Classified Dogs as print_incorrect_dogs within\n#             print_results function and set as either boolean value True or \n#             False in the function call within main (defaults to False)\n#            -Prints Incorrectly Classified Breeds as print_incorrect_breed within\n#             print_results function and set as either boolean value True or \n#             False in the function call within main (defaults to False)\n#         This function does not output anything other than printing a summary\n#         of the final results.\n##\n# TODO 6: Define print_results function below, specifically replace the None\n#       below by the function definition of the print_results function. \n#       Notice that this function doesn't to return anything because it  \n#       prints a summary of the results using results_dic and results_stats_dic\n# \ndef print_results(results_dic, results_stats_dic, model, \n                  print_incorrect_dogs = False, print_incorrect_breed = False):\n    \"\"\"\n    Prints summary results on the classification and then prints incorrectly \n    classified dogs and incorrectly classified dog breeds if user indicates \n    they want those printouts (use non-default values)\n    Parameters:\n      results_dic - Dictionary with key as image filename and value as a List \n             (index)idx 0 = pet image label (string)\n                    idx 1 = classifier label (string)\n                    idx 2 = 1/0 (int)  where 1 = match between pet image and \n                            classifer labels and 0 = no match between labels\n                    idx 3 = 1/0 (int)  where 1 = pet image 'is-a' dog and \n                            0 = pet Image 'is-NOT-a' dog. \n                    idx 4 = 1/0 (int)  where 1 = Classifier classifies image \n                            'as-a' dog and 0 = Classifier classifies image  \n                            'as-NOT-a' dog.\n      results_stats_dic - Dictionary that contains the results statistics (either\n                   a  percentage or a count) where the key is the statistic's \n                     name (starting with 'pct' for percentage or 'n' for count)\n                     and the value is the statistic's value \n      model - Indicates which CNN model architecture will be used by the \n              classifier function to classify the pet images,\n              values must be either: resnet alexnet vgg (string)\n      print_incorrect_dogs - True prints incorrectly classified dog images and \n                             False doesn't print anything(default) (bool)  \n      print_incorrect_breed - True prints incorrectly classified dog breeds and \n                              False doesn't print anything(default) (bool) \n    Returns:\n           None - simply printing results.\n    \"\"\"    \n    None\n                \n"
  },
  {
    "path": "intropyproject-classify-pet-images/print_results_hints.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# */AIPND-revision/intropyproject-classify-pet-images/print_results_hints.py\n#                                                                             \n# PROGRAMMER: \n# DATE CREATED:\n# REVISED DATE: \n# PURPOSE: This is a *hints* file to help guide students in creating the \n#          function print_results that prints the results statistics from the\n#          results statistics dictionary (results_stats_dic). It should also\n#          allow the user to be able to print out cases of misclassified\n#          dogs and cases of misclassified breeds of dog using the Results \n#          dictionary (results_dic).  \n#         This function inputs:\n#            -The results dictionary as results_dic within print_results \n#             function and results for the function call within main.\n#            -The results statistics dictionary as results_stats_dic within \n#             print_results function and results_stats for the function call within main.\n#            -The CNN model architecture as model wihtin print_results function\n#             and in_arg.arch for the function call within main. \n#            -Prints Incorrectly Classified Dogs as print_incorrect_dogs within\n#             print_results function and set as either boolean value True or \n#             False in the function call within main (defaults to False)\n#            -Prints Incorrectly Classified Breeds as print_incorrect_breed within\n#             print_results function and set as either boolean value True or \n#             False in the function call within main (defaults to False)\n#         This function does not output anything other than printing a summary\n#         of the final results.\n##\n# TODO 6: EDIT and ADD code BELOW to do the following that's stated in the \n#       comments below that start with \"TODO: 6\" for the print_results function.\n#       Specifically edit and add code below within the the print_results function. \n#       Notice that this function doesn't return anything because it prints \n#       a summary of the results using results_dic and results_stats_dic\n# \ndef print_results(results_dic, results_stats_dic, model, \n                  print_incorrect_dogs = False, print_incorrect_breed = False):\n    \"\"\"\n    Prints summary results on the classification and then prints incorrectly \n    classified dogs and incorrectly classified dog breeds if user indicates \n    they want those printouts (use non-default values)\n    Parameters:\n      results_dic - Dictionary with key as image filename and value as a List \n             (index)idx 0 = pet image label (string)\n                    idx 1 = classifier label (string)\n                    idx 2 = 1/0 (int)  where 1 = match between pet image and \n                            classifer labels and 0 = no match between labels\n                    idx 3 = 1/0 (int)  where 1 = pet image 'is-a' dog and \n                            0 = pet Image 'is-NOT-a' dog. \n                    idx 4 = 1/0 (int)  where 1 = Classifier classifies image \n                            'as-a' dog and 0 = Classifier classifies image  \n                            'as-NOT-a' dog.\n      results_stats_dic - Dictionary that contains the results statistics (either\n                   a  percentage or a count) where the key is the statistic's \n                     name (starting with 'pct' for percentage or 'n' for count)\n                     and the value is the statistic's value \n      model - Indicates which CNN model architecture will be used by the \n              classifier function to classify the pet images,\n              values must be either: resnet alexnet vgg (string)\n      print_incorrect_dogs - True prints incorrectly classified dog images and \n                             False doesn't print anything(default) (bool)  \n      print_incorrect_breed - True prints incorrectly classified dog breeds and \n                              False doesn't print anything(default) (bool) \n    Returns:\n           None - simply printing results.\n    \"\"\"   \n    # Prints summary statistics over the run\n    print(\"\\n\\n*** Results Summary for CNN Model Architecture\",model.upper(), \n          \"***\")\n    print(\"{:20}: {:3d}\".format('N Images', results_stats_dic['n_images']))\n    print(\"{:20}: {:3d}\".format('N Dog Images', results_stats_dic['n_dogs_img']))\n\n    # TODO: 6a. REPLACE print(\"\") with CODE that prints the text string \n    #          'N Not-Dog Images' and then the number of NOT-dog images \n    #          that's accessed by key 'n_notdogs_img' using dictionary \n    #          results_stats_dic\n    #\n    print(\"\")\n\n\n    # Prints summary statistics (percentages) on Model Run\n    print(\" \")\n    for key in results_stats_dic:\n        # TODO: 6b. REPLACE pass with CODE that prints out all the percentages \n        #           in the results_stats_dic dictionary. Recall that all \n        #           percentages in results_stats_dic have 'keys' that start with \n        #           the letter p. You will need to write a conditional \n        #           statement that determines if the key starts with the letter\n        #           'p' and then you want to use a print statement to print \n        #           both the key and the value. Remember the value is accessed \n        #           by results_stats_dic[key]\n        #\n        pass \n\n\n    # IF print_incorrect_dogs == True AND there were images incorrectly \n    # classified as dogs or vice versa - print out these cases\n    if (print_incorrect_dogs and \n        ( (results_stats_dic['n_correct_dogs'] + results_stats_dic['n_correct_notdogs'])\n          != results_stats_dic['n_images'] ) \n       ):\n        print(\"\\nINCORRECT Dog/NOT Dog Assignments:\")\n\n        # process through results dict, printing incorrectly classified dogs\n        for key in results_dic:\n\n            # TODO: 6c. REPLACE pass with CODE that prints out the pet label \n            #           and the classifier label from results_dic dictionary    \n            #           ONLY when the classifier function (classifier label) \n            #           misclassified dogs specifically: \n            #             pet label is-a-dog and classifier label is-NOT-a-dog \n            #               -OR- \n            #             pet label is-NOT-a-dog and classifier label is-a-dog \n            #          You will need to write a conditional statement that \n            #          determines if the classifier function misclassified dogs\n            #          See 'Adjusting Results Dictionary' section in \n            #         'Classifying Labels as Dogs' for details on the \n            #          format of the results_dic dictionary. Remember the value\n            #          is accessed by results_dic[key] and the value is a list\n            #          so results_dic[key][idx] - where idx represents the \n            #          index value of the list and can have values 0-4.\n            #\n            # Pet Image Label is a Dog - Classified as NOT-A-DOG -OR- \n            # Pet Image Label is NOT-a-Dog - Classified as a-DOG\n            pass\n\n    # IF print_incorrect_breed == True AND there were dogs whose breeds \n    # were incorrectly classified - print out these cases                    \n    if (print_incorrect_breed and \n        (results_stats_dic['n_correct_dogs'] != results_stats_dic['n_correct_breed']) \n       ):\n        print(\"\\nINCORRECT Dog Breed Assignment:\")\n\n        # process through results dict, printing incorrectly classified breeds\n        for key in results_dic:\n\n            # Pet Image Label is-a-Dog, classified as-a-dog but is WRONG breed\n            if ( sum(results_dic[key][3:]) == 2 and\n                results_dic[key][2] == 0 ):\n                print(\"Real: {:>26}   Classifier: {:>30}\".format(results_dic[key][0],\n                                                          results_dic[key][1]))\n"
  },
  {
    "path": "intropyproject-classify-pet-images/run_models_batch.bat",
    "content": "@echo off\nREM */AIPND-revision/intropyproject-classify-pet-images/run_models_batch.bat\nREM                                                                             \nREM PROGRAMMER: Jennifer S.\nREM DATE CREATED: 02/08/2018\nREM REVISED DATE: 04/23/2018 - revised run_models_batch.sh to run on \nREM                            windows OS using bat and Anaconda Prompt \nREM PURPOSE: Runs all three models to test which provides 'best' solution.\nREM          Please note output from each run has been piped into a text file.\nREM\nREM Usage: run_models_batch.bat  -- will run program from commandline on Window OS\nREM \n@echo on\npython check_images.py --dir pet_images/ --arch resnet  --dogfile dognames.txt > resnet_pet-images.txt\npython check_images.py --dir pet_images/ --arch alexnet --dogfile dognames.txt > alexnet_pet-images.txt\npython check_images.py --dir pet_images/ --arch vgg  --dogfile dognames.txt > vgg_pet-images.txt\n"
  },
  {
    "path": "intropyproject-classify-pet-images/run_models_batch.sh",
    "content": "#!/bin/sh\n# */AIPND-revision/intropyproject-classify-pet-images/run_models_batch.sh\n#                                                                             \n# PROGRAMMER: Jennifer S.\n# DATE CREATED: 02/08/2018                                  \n# REVISED DATE: 02/27/2018  - \n# PURPOSE: Runs all three models to test which provides 'best' solution.\n#          Please note output from each run has been piped into a text file.\n#\n# Usage: sh run_models_batch.sh    -- will run program from commandline within Project Workspace\n#  \npython check_images.py --dir pet_images/ --arch resnet  --dogfile dognames.txt > resnet_pet-images.txt\npython check_images.py --dir pet_images/ --arch alexnet --dogfile dognames.txt > alexnet_pet-images.txt\npython check_images.py --dir pet_images/ --arch vgg  --dogfile dognames.txt > vgg_pet-images.txt\n"
  },
  {
    "path": "intropyproject-classify-pet-images/run_models_batch_uploaded.bat",
    "content": "@echo off\nREM */AIPND-revision/intropyproject-classify-pet-images/run_models_batch_uploaded.bat\nREM                                                                             \nREM PROGRAMMER: Jennifer S.\nREM DATE CREATED: 02/08/2018\nREM REVISED DATE: 04/23/2018 - revised run_models_batch.sh to run on \nREM                            windows OS using bat and Anaconda Prompt \nREM PURPOSE: Runs all three models to test which provides 'best' solution on the Uploaded Images.\nREM          Please note output from each run has been piped into a text file.\nREM\nREM Usage: run_models_batch_uploaded.bat  -- will run program from commandline on Window OS\nREM \n@echo on\npython check_images.py --dir uploaded_images/ --arch resnet  --dogfile dognames.txt > resnet_uploaded-images.txt\npython check_images.py --dir uploaded_images/ --arch alexnet --dogfile dognames.txt > alexnet_uploaded-images.txt\npython check_images.py --dir uploaded_images/ --arch vgg  --dogfile dognames.txt > vgg_uploaded-images.txt\n"
  },
  {
    "path": "intropyproject-classify-pet-images/run_models_batch_uploaded.sh",
    "content": "#!/bin/sh\n# */AIPND-revision/intropyproject-classify-pet-images/run_models_batch_uploaded.sh\n#                                                                             \n# PROGRAMMER: Jennifer S.\n# DATE CREATED: 02/08/2018                                  \n# REVISED DATE: 02/27/2018  - \n# PURPOSE: Runs all three models to test which provides 'best' solution on the Uploaded Images.\n#          Please note output from each run has been piped into a text file.\n#\n# Usage: sh run_models_batch_uploaded.sh    -- will run program from commandline within Project Workspace\n#  \npython check_images.py --dir uploaded_images/ --arch resnet  --dogfile dognames.txt > resnet_uploaded-images.txt\npython check_images.py --dir uploaded_images/ --arch alexnet --dogfile dognames.txt > alexnet_uploaded-images.txt\npython check_images.py --dir uploaded_images/ --arch vgg  --dogfile dognames.txt > vgg_uploaded-images.txt\n"
  },
  {
    "path": "intropyproject-classify-pet-images/test_classifier.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# */AIPND-revision/intropyproject-classify-pet-images/test_classifier.py\n#                                                                             \n# PROGRAMMER: Jennifer S.                                                    \n# DATE CREATED: 01/30/2018                                  \n# REVISED DATE:             <=(Date Revised - if any)                         \n# PURPOSE: To demonstrate the proper usage of the classifier() function that \n#          is defined in classifier.py This function uses CNN model \n#          architecture that has been pretrained on the ImageNet data to \n#          classify images. The only model architectures that this function \n#          will accept are: 'resnet', 'alexnet', and 'vgg'. See the example\n#          usage below.\n#\n# Usage: python test_classifier.py    -- will run program from commandline\n\n# Imports classifier function for using pretrained CNN to classify images \nfrom classifier import classifier \n\n# Defines a dog test image from pet_images folder\ntest_image=\"pet_images/Collie_03797.jpg\"\n\n# Defines a model architecture to be used for classification\n# NOTE: this function only works for model architectures: \n#      'vgg', 'alexnet', 'resnet'  \nmodel = \"vgg\"\n\n# Demonstrates classifier() functions usage\n# NOTE: image_classication is a text string - It contains mixed case(both lower\n# and upper case letter) image labels that can be separated by commas when a \n# label has more than one word that can describe it.\nimage_classification = classifier(test_image, model)\n\n# prints result from running classifier() function\nprint(\"\\nResults from test_classifier.py\\nImage:\", test_image, \"using model:\",\n      model, \"was classified as a:\", image_classification)\n"
  },
  {
    "path": "notes/project_intro-to-python.md",
    "content": "#  Notes: Frequently Asked Questions for Classifying Images Project\nThese notes pertain to Frequently Asked Questions (FAQ) for the **_2. Intro to Python_**, **_Lesson 6. Project: Classify Images_** that were posted and addressed on AIPND slack. We recommend that you review these notes prior to starting the **_Classify Images Project_** to help clarify potential points of confusion regarding the Project.\n&nbsp;  \n&nbsp;     \n    \n## Quick Links to Frequently Asked Questions \n* [GitHub AIPND Repository Link](https://github.com/udacity/AIPND-revision)\n* [Issues with the Project Workspace](https://github.com/udacity/AIPND-revision/blob/master/notes/project_intro-to-python.md#issues-with-the-project-workspace)\n* [Running the Project on a Local Computer](https://github.com/udacity/AIPND-revision/blob/master/notes/project_intro-to-python.md#running-the-project-on-a-local-computer)\n* [Files Required to Run **_check_images.py_** Locally](https://github.com/udacity/AIPND-revision/blob/master/notes/project_intro-to-python.md#files-required-to-run-check_imagespy-locally)\n* [Running Batch Files on Windows OS Locally](https://github.com/udacity/AIPND-revision/blob/master/notes/project_intro-to-python.md#running-batch-files-on-windows-os-locally)\n* [**_Hints_** for this Project](https://github.com/udacity/AIPND-revision/blob/master/notes/project_intro-to-python.md#hints-for-this-project)\n* [Eliminating Syntax Errors with Text Editor/Integrated Development Environment](https://github.com/udacity/AIPND-revision/blob/master/notes/project_intro-to-python.md#eliminating-syntax-errors-with-text-editorintegrated-development-environment)\n* [Cutting and Pasting Code in the Classroom](https://github.com/udacity/AIPND-revision/blob/master/notes/project_intro-to-python.md#cutting-and-pasting-code-in-the-classroom)\n* [Indention of Python Code](https://github.com/udacity/AIPND-revision/blob/master/notes/project_intro-to-python.md#indention-of-python-code)\n* [Replacing None and Pass Statements](https://github.com/udacity/AIPND-revision/blob/master/notes/project_intro-to-python.md#replacing-none-and-pass-statements)\n&nbsp;  \n&nbsp;     \n  \n## Issues with the Project Workspace\nWhile it is recommended that you work on the project within the **_Project Workspace_**, a few students _may_ have experienced issues trying to work within the _Project Workspace_.  Some students found these issues resolved when they switched their internet browsers.  Specifically, some students found that **_Chrome_** worked best; while others found that **_Firefox_** worked better for them.  If you are running into the problem where the _files_ in the workspace don't load and/or running code within the workspace runs extremely slowly; please try the following:\n* Quit and exit out of the **_web browser_** you are using, then open it back up and restart it.\n* Switch to a different **_web browser_**. \n\nIf you run into issues with the **_Project Workspace_** and the above recommendations didn't work; alternatively, you are welcome to complete the project on a local computer using the instructions in the next [FAQ](https://github.com/udacity/AIPND-revision/blob/master/notes/project_intro-to-python.md#running-the-project-on-a-local-computer). \n&nbsp;      \n&nbsp;     \n     \n## Running the Project on a Local Computer\nWhile it is recommended that you work on the project within the **_Project Workspace_**, to run the project on a local computer, you will have needed to have Python 3.6 intalled on your computer. \n### Installing Anaconda \nThe easiest way to install python and the appropriate python modules is to install [Anaconda](https://www.anaconda.com/download). You will also have found the directions to install Anaconda in **_2. Intro to Python_**, **_Lesson 5. Scripting_**, **_Section 3. Install Python Using Anaconda_**. \n### Installing PyTorch and torchvision\n### Linux, OSX(Mac), Windows\nFor this project you will also need to install the python packages pytorch and torchvision.  If your local computer has a Linux, OSX (Mac), or Windows operating system look to [*Get Started.*](http://pytorch.org/) for installation instructions. \n&nbsp;     \n&nbsp;    \n   \n## Files Required to Run **_check_images.py_** Locally\nThe following files and folders need to be put in the same folder as the **_check_images.py_** python program on your local computer. You will find these files and folders within the [GitHub AIPND Repository](https://github.com/udacity/AIPND-revision/tree/master/intropyproject-classify-pet-images). There are more programs in the repository than you will need, these extra programs are there to provide the code within the lessons in a format that can be copied and pasted from.\n### Needed Files:\n* **pet_images**  (folder of 40 pet image)\n* **uploaded_images** (a folder you will have to create to hold your uploaded images in that section of the project)\n* **classifier.py** (classifier function you will be using to classify the images)\n* **dognames.txt** (file that contains all the valid dog names from the classifier function and the pet image files)\n* **imagenet1000_clsid_to_human.txt** (dictionary that converts the classifier function ids to text labels)\n* **adjust_results4_isadog.py** (a program that contains the **adjust_results4_isadog** function that you will be defining as part of the project)\n* **calculates_results_stats.py** (a program that contains the **calculates_results_stats** function that you will be defining as part of the project)\n* **classify_images.py** (a program that contains the **classify_images** function that you will be defining as part of the project)\n* **get_input_args.py** (a program that contains the **get_input_args** function that you will be defining as part of the project)\n* **get_pet_labels.py** (a program that contains the **get_pet_labels** function that you will be defining as part of the project)\n* **print_results.py** (a program that contains the **print_results** function that you will be defining as part of the project)\n* **run_models_batch.sh** (a bash script that will run check_images.py sequentially for all 3 model architectures and output their results to text files - on Unix/Linux/OSX/Project Workspace from a terminal window)\n* **run_models_batch.bat** (a batch script that will run check_images.py sequentially for all 3 model architectures and output their results to text files - on Windows from the Anaconda Prompt window)\n* **run_models_batch_uploaded.sh** (a bash script that will run check_images.py sequentially for all 3 model architectures  on the uploaded images folder and output their results to text files - on Unix/Linux/OSX/Project Workspace from a terminal window)\n* **run_models_batch_uploaded.bat** (a batch script that will run check_images.py sequentially for all 3 model architectures on the uploaded images folder and output their results to text files - on Windows from the Anaconda Prompt window)\n* **test_classifier.py** (an example program that demonstrates how to use the classifier function)\n* **print_functions_for_lab_checks.py** (a program that contains functions that will allow you to check your code)\n\nAlso be aware that instructor provided **_hints_** files are provided for each of the functions used within this project, these files will end with **_hints.py**. These **_hints_** files contain extra code to provide a few **_hints_** to help guide students to the solution. You will find these **_hints_** files within the **_Project Workspace_** and also within the [**_GitHub repository_**](https://github.com/udacity/AIPND-revision/tree/master/intropyproject-classify-pet-images) as the following files:\n* **adjust_results4_isadog_hints.py** (a program that contains **_hints_** for the **adjust_results4_isadog** function that you will be defining as part of the project)\n* **calculates_results_stats_hints.py** (a program that contains **_hints_** for the **calculates_results_stats** function that you will be defining as part of the project)\n* **classify_images_hints.py** (a program that contains **_hints_** for the **classify_images** function that you will be defining as part of the project)\n* **get_input_args_hints.py** (a program that contains **_hints_** for the **get_input_args** function that you will be defining as part of the project)\n* **get_pet_labels_hints.py** (a program that contains **_hints_** for the **get_pet_labels** function that you will be defining as part of the project)\n* **print_results_hints.py** (a program that contains **_hints_** for the **print_results** function that you will be defining as part of the project)\n&nbsp;   \n&nbsp;     \n     \n## Running Batch Files on Windows OS Locally\nTo run the files **_run_models_batch_** or **_run_models_batch_uploaded_** that run all 3 model architectures using **_check_images.py_** on a Windows OS locally; you will need to use the files that end with the extention **_.bat_** instead of the extension **_.sh_**.  You will have also needed to have installed Anaconda on your computer (see following [FAQ](https://github.com/udacity/AIPND-revision/blob/master/notes/project_intro-to-python.md#running-the-project-on-a-local-computer) for details on Anaconda installation).\n### Directions:\n* Open the **Anaconda Prompt** - either from typing **_Anaconda Prompt_** within the search bar and selecting it _or_ by clicking on it once it's found within the **Anaconda** folder of programs.\n* Navigate to the _folder_ within the **Anaconda Prompt** that contains the _Project files_ including **_check_images.py_** and **_run_models_batch.bat_** using the command [_cd_](https://en.wikipedia.org/wiki/Cd_(command)).\n* Type the command within the **Anaconda Prompt**:\n```terminal\nrun_models_batch.bat\n```\nIf instead you are working with the uploaded images , you will replace all instances of **_run_models_batch.bat_** from the _directions_ above with **_run_models_batch_uploaded.bat_**. \n&nbsp;     \n&nbsp;         \n\n## **_Hints_** for this Project\nInstructor provided **_hints_** files are provided for each of the functions used within this project, these files will end with **_hints.py**. These **_hints_** files contain extra code to provide a few **_hints_** to help guide students to the solution. You will find these **_hints_** files within the **_Project Workspace_** and also within the [**_GitHub repository_**](https://github.com/udacity/AIPND-revision/tree/master/intropyproject-classify-pet-images) as the following files:   \n* **adjust_results4_isadog_hints.py** (a program that contains **_hints_** for the **adjust_results4_isadog** function that you will be defining as part of the project)\n* **calculates_results_stats_hints.py** (a program that contains **_hints_** for the **calculates_results_stats** function that you will be defining as part of the project)\n* **classify_images_hints.py** (a program that contains **_hints_** for the **classify_images** function that you will be defining as part of the project)\n* **get_input_args_hints.py** (a program that contains **_hints_** for the **get_input_args** function that you will be defining as part of the project)\n* **get_pet_labels_hints.py** (a program that contains **_hints_** for the **get_pet_labels** function that you will be defining as part of the project)\n* **print_results_hints.py** (a program that contains **_hints_** for the **print_results** function that you will be defining as part of the project)\n&nbsp;   \n&nbsp;   \n\n## Eliminating Syntax Errors with Text Editor/Integrated Development Environment \nIf you are experiencing a lot of syntax errors with your code, you may consider downloading your code and looking at it with your favorite text editor/IDE to help eliminate the syntax errors from your program.  Recall in **_2. Intro to Python_**, **_Lesson 5. Scripting_**, **_Section 6. Programming Environment Setup_** you were provided with a number of text editors that are available to use with python (like _Atom_, _Sublime Text_, _Notepad++_). Additionally, when you installed Anaconda, the Spyder IDE (Integrated Development Environment) for python should be available through the _Anaconda Navigator_. \n&nbsp;   \n&nbsp;   \n     \n## Cutting and Pasting Code in the Classroom\nIf you cut and paste code directly from the classroom, it is very likely you will generate syntax errors with the single and double quotes. This is because the font type differences.  If you are going to cut and paste code from the classroom, you will need to erase and replace any copied double or single quotes.  Additionally, cutting and pasting code from the classroom may also result in issues regarding the proper code indention; therefore, it is not recommended to cut and paste code directly from the classroom.\n&nbsp;    \n&nbsp;   \n     \n## Indention of Python Code\nIndention is used within Python to distinquish between blocks of code; whereas, with other programming languages, like Java and  C++,  they may have used curly brackets. The [PEP8 Style guide](https://www.python.org/dev/peps/pep-0008/) provides the standard for Python code and is what has been used for the programs within the Github respository and the Project workspace. The [PEP8 standard for indention](https://www.python.org/dev/peps/pep-0008/#indentation) is to use 4 spaces for each indention level. Not using 4 spaces for indention when editing **_check_images.py_**, will likely result in syntax errors. \n\nBe aware that using the _tab_ key within most text editors might not guarantee the proper 4 space indention.  Additionally, not all text editors (including the **_Project Workspace_**) provide the proper 4 space indention as is used in the Python programs within the repository for this project.\n&nbsp;     \n&nbsp;    \n    \n## Replacing None and Pass Statements\nWhen editing the functions provided in **_check_images.py_** you will need to replace [_None_](https://docs.python.org/3/library/constants.html#None) or the [_pass_](https://docs.python.org/3/tutorial/controlflow.html#pass-statements) statement with your code for that function. The pass statement does nothing, it's used so that the program will still run even though the functions have not been fully defined. Similarly the value of _None_ represents the absence of a value, it's used so that the program will still run even though the functions have not been fully defined.\n&nbsp;    \n&nbsp;     \n    \n"
  },
  {
    "path": "requirements.txt",
    "content": "torch==1.4.0\nPillow==7.1.2\ntorchvision==0.2.1"
  }
]