MedMagik commited on
Commit
11b46c4
·
verified ·
1 Parent(s): db3984d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -53,7 +53,7 @@ def custom_decode_predictions(predictions, class_labels):
53
  decoded_predictions = []
54
  for pred in predictions:
55
  # Get indices of top predicted classes
56
- top_indices = pred.argsort()[-3:][::-1] # Change 5 to the number of top classes you want to retrieve
57
  # Decode each top predicted class
58
  decoded_pred = [(class_labels[i], pred[i]) for i in top_indices]
59
  decoded_predictions.append(decoded_pred)
@@ -61,8 +61,6 @@ def custom_decode_predictions(predictions, class_labels):
61
 
62
  def classify_image(img):
63
  img_array = img_to_array(img)
64
- img_array = img_array / 255.0
65
- img_array = (img_array - img_array.mean()) / img_array.std()
66
  img_array = np.expand_dims(img_array, axis=0)
67
  img_array = preprocess_input(img_array)
68
 
 
53
  decoded_predictions = []
54
  for pred in predictions:
55
  # Get indices of top predicted classes
56
+ top_indices = pred.argsort()[-4:][::-1] # Change 5 to the number of top classes you want to retrieve
57
  # Decode each top predicted class
58
  decoded_pred = [(class_labels[i], pred[i]) for i in top_indices]
59
  decoded_predictions.append(decoded_pred)
 
61
 
62
  def classify_image(img):
63
  img_array = img_to_array(img)
 
 
64
  img_array = np.expand_dims(img_array, axis=0)
65
  img_array = preprocess_input(img_array)
66