Spaces:
Runtime error
Runtime error
Minor updates
Browse files- gradcam/__pycache__/utils.cpython-38.pyc +0 -0
- gradcam/app.py +2 -1
- gradcam/utils.py +1 -1
gradcam/__pycache__/utils.cpython-38.pyc
DELETED
Binary file (2.77 kB)
|
|
gradcam/app.py
CHANGED
@@ -4,7 +4,8 @@ import torch
|
|
4 |
|
5 |
import utils
|
6 |
|
7 |
-
clip_model = "RN50x4"
|
|
|
8 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
9 |
model, preprocess = clip.load(clip_model, device=device, jit=False)
|
10 |
model.eval()
|
|
|
4 |
|
5 |
import utils
|
6 |
|
7 |
+
#clip_model = "RN50x4"
|
8 |
+
clip_model = "RN50x64"
|
9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
10 |
model, preprocess = clip.load(clip_model, device=device, jit=False)
|
11 |
model.eval()
|
gradcam/utils.py
CHANGED
@@ -5,7 +5,7 @@ import torch.nn.functional as F
|
|
5 |
import matplotlib.cm
|
6 |
from PIL import Image
|
7 |
|
8 |
-
|
9 |
class Hook:
|
10 |
"""Attaches to a module and records its activations and gradients."""
|
11 |
|
|
|
5 |
import matplotlib.cm
|
6 |
from PIL import Image
|
7 |
|
8 |
+
# Adapted from: https://colab.research.google.com/github/kevinzakka/clip_playground/blob/main/CLIP_GradCAM_Visualization.ipynb
|
9 |
class Hook:
|
10 |
"""Attaches to a module and records its activations and gradients."""
|
11 |
|