CompressAI Pytorch Lightning example
View .clang-format
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
AccessModifierOffset: -2 | |
AlignAfterOpenBracket: AlwaysBreak | |
AlignConsecutiveMacros: false | |
AlignConsecutiveAssignments: false | |
AlignConsecutiveDeclarations: false | |
AlignEscapedNewlines: DontAlign | |
AlignOperands: false | |
AlignTrailingComments: false | |
AllowAllArgumentsOnNextLine: false | |
AllowAllConstructorInitializersOnNextLine: false |
View example.py
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
# example.py | |
from common import setup | |
import torch.nn.functional as F | |
args, model, data_module = setup() | |
test_data_loader = data_module.test_dataloader() | |
for batch in iter(test_data_loader): | |
inputs, targets = batch |
View blockmatching.py
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
import numpy as np | |
import numba | |
@numba.jit(nopython=True) | |
def estimate_flow_blockmatching(prev_img, next_img, block_size, search_window): | |
"""Estimate motion vectors using block matching. | |
Args: | |
prev_img: previous frame |