Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions classify_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,18 @@

# Species classification modules will be imported later

if len(sys.argv) < 2:
print('Usage: %s <path to images or csv> <classification output csv file>'%sys.argv[0])

exit(1)

#%% Options

# Species classification API imports deferred until later, since we have to do a
# little path management. This also implicitly defers PyTorch imports.

# Directory to which you sync'd this repo.
api_root = r'/home/coyote/git/speciesclassification'
api_root = os.path.dirname(__file__)

# If not None, pre-pended to filenames. Most useful when filenames are coming from
# a .csv file.
Expand All @@ -68,10 +72,10 @@
# images_to_classify = r'/data/species-classification/elephant.jpg'
# images_to_classify = [r'/data/species-classification/elephant.jpg']
# images_to_classify = 'image_list.csv'
images_to_classify = r'/data/species-classification/images/sample_images.2019.12.28'
images_to_classify = sys.argv[1]

# Classification results will be written here
classification_output_file = '/data/species-classification/classification_output.csv'
classification_output_file = sys.argv[2]

# Path to taxa.csv, for latin --> common mapping
#
Expand Down