-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Matthias Kümmmerer <[email protected]>
- Loading branch information
1 parent
a49c464
commit e146c0c
Showing
5 changed files
with
70 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from .deepgaze import DeepGazeII, DeepGazeIII, FeatureExtractor | ||
from .deepgaze2e import deepgaze2e | ||
from .deepgaze1 import DeepGazeI | ||
from .deepgaze2e import DeepGazeIIE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from collections import OrderedDict | ||
|
||
import torch | ||
import torch.nn as nn | ||
|
||
from torch.utils import model_zoo | ||
|
||
from .features.alexnet import RGBalexnet | ||
from .modules import FeatureExtractor, Finalizer, DeepGazeII as TorchDeepGazeII | ||
|
||
|
||
class DeepGazeI(TorchDeepGazeII): | ||
"""DeepGaze I model | ||
Kümmerer, M., Theis, L., & Bethge, M. (2015). Deep Gaze I: Boosting Saliency Prediction with Feature Maps Trained on ImageNet. ICLR Workshop Track. http://arxiv.org/abs/1411.1045 | ||
""" | ||
def __init__(self, pretrained=True): | ||
features = RGBalexnet() | ||
feature_extractor = FeatureExtractor(features, ['1.features.10']) | ||
|
||
readout_network = nn.Sequential(OrderedDict([ | ||
('conv0', nn.Conv2d(256, 1, (1, 1), bias=False)), | ||
])) | ||
|
||
super().__init__( | ||
features=feature_extractor, | ||
readout_network=readout_network, | ||
downsample=2, | ||
readout_factor=4, | ||
saliency_map_factor=4, | ||
) | ||
|
||
if pretrained: | ||
raise NotImplementedError() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.