Skip to content
Snippets Groups Projects
Commit 90f7e4db authored by Marie Generali's avatar Marie Generali :worried:
Browse files

do not return temperature

parent 7413d906
No related branches found
No related tags found
No related merge requests found
......@@ -454,9 +454,7 @@ class GlobalHTADecoder(Module):
-1, 1, features_size[2], features_size[3]
)
temperature = self.temperature
return output, preds, hidden_predict, cache, weights, temperature
return output, preds, hidden_predict, cache, weights
def generate_enc_mask(self, batch_reduced_size, total_size, device):
"""
......
......@@ -2,7 +2,6 @@
import os
import pickle
from itertools import pairwise
from pathlib import Path
import cv2
......@@ -21,7 +20,7 @@ from dan.predict.attention import (
plot_attention,
split_text_and_confidences,
)
from dan.utils import read_image
from dan.utils import pairwise, read_image
class DAN:
......
# -*- coding: utf-8 -*-
from itertools import tee
import cv2
import numpy as np
import torch
......@@ -206,3 +208,13 @@ def round_floats(float_list, decimals=2):
Round list of floats with fixed decimals
"""
return [np.around(num, decimals) for num in float_list]
def pairwise(iterable):
"""
Not necessary when using 3.10. See https://docs.python.org/3/library/itertools.html#itertools.pairwise.
"""
# pairwise('ABCDEFG') --> AB BC CD DE EF FG
a, b = tee(iterable)
next(b, None)
return zip(a, b)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment