Upload folder using huggingface_hub
Browse files
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'{
|
| 75 |
```
|
| 76 |
|
| 77 |
Output:
|
| 78 |
```
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
|
|
|
|
|
|
| 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'{
|
| 118 |
```
|
| 119 |
|
| 120 |
Output:
|
| 121 |
```
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
|
|
|
|
|
|
| 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 |
```
|