Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Commit

Permalink
fixed scores reshape for squeezenet
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro Lenzi committed Feb 8, 2017
1 parent 10d005b commit dbcb9ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion digits/model/images/classification/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,8 @@ def classify_many():
'Unable to classify any image from the file')

scores = last_output_data
scores = scores.reshape(scores.shape[:2])

# take top 5
indices = (-scores).argsort()[:, :5]

Expand All @@ -520,7 +522,6 @@ def classify_many():

# remove invalid ground truth
ground_truths = [x if x is not None and (0 <= x < n_labels) else None for x in ground_truths]

# how many pieces of ground truth to we have?
n_ground_truth = len([1 for x in ground_truths if x is not None])
show_ground_truth = n_ground_truth > 0
Expand Down

0 comments on commit dbcb9ed

Please sign in to comment.