Skip to content

Commit

Permalink
Update simple_videofacerec.py
Browse files Browse the repository at this point in the history
xrange(max(labels)) would start count at 1, were as we want it to start at 0. So that len(list_of_labels) == len(subject_names)

If the subject detected was the last folder used for training, we hit an Key Error, on self.model.subject_name[prediction].
  • Loading branch information
tomhollingworth committed Jul 31, 2013
1 parent c65c19a commit 813d5c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion py/apps/videofacerec/simple_videofacerec.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def run(self):
print "Loading dataset..."
[images, labels, subject_names] = read_images(options.dataset, image_size)
# Zip us a {label, name} dict from the given data:
list_of_labels = list(xrange(max(labels)))
list_of_labels = set(labels)
subject_dictionary = dict(zip(list_of_labels, subject_names))
# Get the model we want to compute:
model = get_model(image_size=image_size, subject_names=subject_dictionary)
Expand Down

0 comments on commit 813d5c7

Please sign in to comment.