Skip to content

Commit

Permalink
Don't compute saliency maps in NSS if there are no fixations on the i…
Browse files Browse the repository at this point in the history
…mage

Signed-off-by: Matthias Kümmmerer <[email protected]>
  • Loading branch information
matthias-k committed Jan 27, 2024
1 parent 1a6d965 commit 1a3f25c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pysaliency/saliency_map_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,10 @@ def CC(self, stimuli, other, verbose=False):
def NSSs(self, stimuli, fixations, verbose=False):
values = np.empty(len(fixations.x))
for n, s in enumerate(tqdm(stimuli, disable=not verbose)):
smap = self.saliency_map(s).copy()
inds = fixations.n == n
if not inds.sum():
continue
smap = self.saliency_map(s).copy()
values[inds] = NSS(smap, fixations.x_int[inds], fixations.y_int[inds])

return values
Expand Down

0 comments on commit 1a3f25c

Please sign in to comment.