Skip to content

Instantly share code, notes, and snippets.

View YodaEmbedding's full-sized avatar
♟️
1.e4. Your move.

Mateen Ulhaq YodaEmbedding

♟️
1.e4. Your move.
View GitHub Profile
@YodaEmbedding
YodaEmbedding / blockmatching.py
Created February 7, 2021 22:44
Block-matching motion vector estimation in python
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
@YodaEmbedding
YodaEmbedding / example.py
Last active April 20, 2021 09:05
Please see appendix (attached in the Canvas comment) for usage instructions
# 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
@YodaEmbedding
YodaEmbedding / README.md
Last active May 6, 2022 21:13
CompressAI Pytorch Lightning

CompressAI Pytorch Lightning example

@YodaEmbedding
YodaEmbedding / repair_modelnet.py
Created August 8, 2023 10:43
Repair ModelNet40 OFF files
"""
Repair ModelNet40.
Some of the files in ModelNet40 are broken, e.g.,
.. code-block:: bash
$ head -n 1 ModelNet40/chair/train/chair_0856.off
OFF6586 5534 0
@YodaEmbedding
YodaEmbedding / latex_unicode_symbols.json
Last active December 8, 2023 10:39
LaTeX Unicode symbols
{
"0": "0",
"1": "1",
"2": "2",
"3": "3",
"4": "4",
"5": "5",
"6": "6",
"7": "7",
"8": "8",
@YodaEmbedding
YodaEmbedding / generate_vimeo90k_npy_dataset.py
Last active February 26, 2024 06:54
Generate Vimeo90K NumPy dataset
import argparse
from pathlib import Path
import numpy as np
import torch
from compressai.datasets import Vimeo90kDataset
from torch.utils.data import DataLoader
from torchvision import transforms
MESSAGE = """
@YodaEmbedding
YodaEmbedding / .clang-format
Last active April 22, 2024 10:30
.clang-format for Rust style (rustfmt)
AccessModifierOffset: -2
AlignAfterOpenBracket: BlockIndent # New in v14. For earlier clang-format versions, use AlwaysBreak instead.
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: DontAlign
AlignOperands: false
AlignTrailingComments: false
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false