papousek commited on
Commit
5ca6dbe
·
verified ·
1 Parent(s): c662e59

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +14 -10
README.md CHANGED
@@ -71,15 +71,17 @@ with torch.no_grad():
71
  image_tensor = torchvision.transforms.functional.to_tensor(image_array_resized).to(DEVICE_NAME)
72
  prediction = MODEL(image_tensor.unsqueeze(0)).squeeze(0).cpu().numpy()
73
  for i in (-prediction).argsort():
74
- print(f'{classes[i]:>10}: {100 * prediction[i]:.1f}%')
75
  ```
76
 
77
  Output:
78
  ```
79
- plant: 96.7%
80
- human: 0.1%
81
- insect: 0.1%
82
- mushroom: 0.0%
 
 
83
  ```
84
 
85
  ###
@@ -114,13 +116,15 @@ INTERPRETER.invoke()
114
  logits = INTERPRETER.get_tensor(output_details[0]['index'])[0]
115
  prediction = tf.nn.sigmoid(logits).numpy()
116
  for i in (-prediction).argsort():
117
- print(f'{classes[i]:>10}: {100 * prediction[i]:.1f}%')
118
  ```
119
 
120
  Output:
121
  ```
122
- plant: 96.7%
123
- human: 0.1%
124
- insect: 0.1%
125
- mushroom: 0.0%
 
 
126
  ```
 
71
  image_tensor = torchvision.transforms.functional.to_tensor(image_array_resized).to(DEVICE_NAME)
72
  prediction = MODEL(image_tensor.unsqueeze(0)).squeeze(0).cpu().numpy()
73
  for i in (-prediction).argsort():
74
+ print(f'{CLASSES[i]:>10}: {100 * prediction[i]:.1f}%')
75
  ```
76
 
77
  Output:
78
  ```
79
+ plant: 91.3%
80
+ unhealthy_plant: 53.3%
81
+ crop: 16.2%
82
+ insect: 0.4%
83
+ human: 0.1%
84
+ mushroom: 0.0%
85
  ```
86
 
87
  ###
 
116
  logits = INTERPRETER.get_tensor(output_details[0]['index'])[0]
117
  prediction = tf.nn.sigmoid(logits).numpy()
118
  for i in (-prediction).argsort():
119
+ print(f'{CLASSES[i]:>10}: {100 * prediction[i]:.1f}%')
120
  ```
121
 
122
  Output:
123
  ```
124
+ plant: 91.3%
125
+ unhealthy_plant: 53.3%
126
+ crop: 16.2%
127
+ insect: 0.4%
128
+ human: 0.1%
129
+ mushroom: 0.0%
130
  ```