-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_input_args.py
37 lines (31 loc) · 1.63 KB
/
get_input_args.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# */AIPND-revision/intropyproject-classify-pet-images/get_input_args.py
#
# PROGRAMMER: jay kava
# DATE CREATED: 19-06-2020
# REVISED DATE:
# PURPOSE: Create a function that retrieves the following 3 command line inputs
# from the user using the Argparse Python module. If the user fails to
# provide some or all of the 3 inputs, then the default values are
# used for the missing inputs. Command Line Arguments:
# 1. Image Folder as --dir with default value 'pet_images'
# 2. CNN Model Architecture as --arch with default value 'vgg'
# 3. Text File with Dog Names as --dogfile with default value 'dognames.txt'
#
##
# Imports python modules
import argparse
# TODO 1: Define get_input_args function below please be certain to replace None
# in the return statement with parser.parse_args() parsed argument
# collection that you created with this function
#
def get_input_args():
parser = argparse.ArgumentParser()
parser.add_argument('--dir', type=str, default='pet_images/',
help='path to the folder that contains the images; default is pet_images')
parser.add_argument('--arch', type=str, default='vgg',
help='CNN model to use for image classification; default is vgg')
parser.add_argument('--dogfile', type=str, default='dognames.txt',
help='file that contains all labels associated to dogs;default is dognames.txt')
return parser.parse_args()