Skip to content

Commit

Permalink
[fix] modify pixel calculations to use resized image for KMAC per pix…
Browse files Browse the repository at this point in the history
…el computation
  • Loading branch information
sarhakor authored and fracape committed Nov 13, 2024
1 parent 2cc6946 commit e925499
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions compressai_vision/pipelines/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,14 @@ def acc_kmac_and_pixels_info(self, mname, kmac, pixels): # for image task

def calc_kmac_per_pixels_image_task(self): # for video task
# multiplication
self.kmac_per_pixels = {k: (v / self.pixels[k]) for k, v in self.kmacs.items()}
self.kmac_per_pixels = {
k: (v / self.pixels["nn_part_1"]) for k, v in self.kmacs.items()
}

def calc_kmac_per_pixels_video_task(self, nbframes, ori_nbframes): # for video task
# multiplication
self.kmac_per_pixels = {
k: (v * nbframes) / (self.pixels[k] * ori_nbframes)
k: (v * nbframes) / (self.pixels["nn_part_1"] * ori_nbframes)
for k, v in self.kmacs.items()
}

Expand Down

0 comments on commit e925499

Please sign in to comment.