You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-22Lines changed: 22 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,15 +20,15 @@ Simple way to leverage the class-specific activation of convolutional layers in
20
20
21
21
TorchCAM leverages [PyTorch hooking mechanisms](https://pytorch.org/tutorials/beginner/former_torchies/nnft_tutorial.html#forward-and-backward-function-hooks) to seamlessly retrieve all required information to produce the class activation without additional efforts from the user. Each CAM object acts as a wrapper around your model.
22
22
23
-
You can find the exhaustive list of supported CAM methods in the [documentation](https://frgfm.github.io/torch-cam/cams.html), then use it as follows:
23
+
You can find the exhaustive list of supported CAM methods in the [documentation](https://frgfm.github.io/torch-cam/methods.html), then use it as follows:
24
24
25
25
```python
26
26
# Define your model
27
27
from torchvision.models import resnet18
28
28
model = resnet18(pretrained=True).eval()
29
29
30
30
# Set your CAM extractor
31
-
from torchcam.camsimport SmoothGradCAMpp
31
+
from torchcam.methodsimport SmoothGradCAMpp
32
32
cam_extractor = SmoothGradCAMpp(model)
33
33
```
34
34
@@ -44,7 +44,7 @@ Once your CAM extractor is set, you only need to use your model to infer on your
44
44
from torchvision.io.image import read_image
45
45
from torchvision.transforms.functional import normalize, resize, to_pil_image
46
46
from torchvision.models import resnet18
47
-
from torchcam.camsimport SmoothGradCAMpp
47
+
from torchcam.methodsimport SmoothGradCAMpp
48
48
49
49
model = resnet18(pretrained=True).eval()
50
50
cam_extractor = SmoothGradCAMpp(model)
@@ -131,7 +131,7 @@ This project is developed and maintained by the repo owner, but the implementati
<em>Source: <a href="https://www.youtube.com/watch?v=hZJN5BzKfxk">YouTube video</a> (activation maps created by <a href="https://frgfm.github.io/torch-cam/latest/cams.html#torchcam.cams.LayerCAM">Layer-CAM</a> with a pretrained <a href="https://pytorch.org/vision/stable/models.html#torchvision.models.resnet18">ResNet-18</a>)</em>
134
+
<em>Source: <a href="https://www.youtube.com/watch?v=hZJN5BzKfxk">YouTube video</a> (activation maps created by <a href="https://frgfm.github.io/torch-cam/latest/methods.html#torchcam.methods.LayerCAM">Layer-CAM</a> with a pretrained <a href="https://pytorch.org/vision/stable/models.html#torchvision.models.resnet18">ResNet-18</a>)</em>
135
135
</p>
136
136
137
137
@@ -182,24 +182,24 @@ In the table below, you will find a latency benchmark (forward pass not included
182
182
183
183
| CAM method | Arch | GPU mean (std) | CPU mean (std) |
0 commit comments