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