Update README.md
#2
by gouldj2 - opened
README.md
CHANGED
|
@@ -127,11 +127,11 @@ with torch.no_grad():
|
|
| 127 |
images = images.to(device)
|
| 128 |
|
| 129 |
for c in range(images.shape[1]):
|
| 130 |
-
# Extract single channel: (N, C, H, W) -> (N,
|
| 131 |
-
single_channel = images[:, c, :, :]
|
| 132 |
|
| 133 |
-
# Apply transforms
|
| 134 |
-
single_channel = transform(single_channel
|
| 135 |
|
| 136 |
# Extract features
|
| 137 |
output = model.forward_features(single_channel)
|
|
|
|
| 127 |
images = images.to(device)
|
| 128 |
|
| 129 |
for c in range(images.shape[1]):
|
| 130 |
+
# Extract single channel: (N, C, H, W) -> (N, H, W)
|
| 131 |
+
single_channel = images[:, c, :, :]
|
| 132 |
|
| 133 |
+
# Apply transforms, add dimension 1 ((N, 1, H, W))
|
| 134 |
+
single_channel = transform(single_channel).unsqueeze(1)
|
| 135 |
|
| 136 |
# Extract features
|
| 137 |
output = model.forward_features(single_channel)
|