Skip to content
Snippets Groups Projects
Commit e13a3786 authored by Levecque Etienne's avatar Levecque Etienne
Browse files

fix: correct search upper bound

parent 316e9a94
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,7 @@ class JPEGPipeline:
def define_upper_bound(self):
self.upper_bound = np.zeros((self.quant_tbl.shape[0])).reshape(-1, 1, 1)
if self.target_is_dct:
self.upper_bound += np.linalg.norm(self.quant_tbl, axis=(1, 2), ord='fro', keepdims=True)
self.upper_bound += np.linalg.norm(self.quant_tbl / 2, axis=(1, 2), ord='fro', keepdims=True)
else:
self.upper_bound += 4
if not self.grayscale:
......@@ -204,7 +204,7 @@ class FloatPipeline(JPEGPipeline):
class ComposedPipeline:
def __init__(self, pipelines, backward_naive=True):
self.pipelines = pipelines
self.upper_bound = np.sum([pipe.upper_bound for pipe in pipelines], axis=0)
self.upper_bound = np.sum([pipe.upper_bound for pipe in pipelines], axis=0) + 1
if backward_naive:
self.backward_pipes = [
NaivePipeline(pipe.quality, pipe.target_is_dct, pipe.grayscale, return_int=False, return_rounded=False)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment