Skip to content

Instantly share code, notes, and snippets.

View ducha-aiki's full-sized avatar

Dmytro Mishkin ducha-aiki

View GitHub Profile
@ducha-aiki
ducha-aiki / README.md
Created October 5, 2026 21:11
pydegensac F threshold Pareto report: fixed SIFT/SNN 0.8, current and historical cores

pydegensac fixed-SNN 0.8 threshold Pareto report archive

Full report, twelve primary raw sweeps, four validation probes, six analyses, all PNG/SVG figures, and frozen measurement/analysis sources are preserved in report.zip.base64.txt. Individual SVG figures, exhaustive Markdown tables and analysis JSONs are also available alongside this README.

Decode the retained ZIP after downloading the raw base64 text:

base64 --decode report.zip.base64.txt > pydegensac-fixed-snn08-report.zip
# macOS alternative: base64 -D -i report.zip.base64.txt -o pydegensac-fixed-snn08-report.zip
shasum -a 256 -c archive-sha256.txt
@ducha-aiki
ducha-aiki / deformable_conv2d.py
Created February 20, 2026 17:29
Pure-PyTorch implementation of deform_conv2d matching torchvision.ops.deform_conv2d.
"""
Pure-PyTorch implementation of deform_conv2d matching torchvision.ops.deform_conv2d.
Implements both DCNv1 (mask=None) and DCNv2 (mask provided) as described in:
- Deformable Convolutional Networks (https://arxiv.org/abs/1703.06211)
- Deformable ConvNets v2 (https://arxiv.org/abs/1811.11168)
"""
from typing import Optional, Tuple
@ducha-aiki
ducha-aiki / svd_crash.cc
Created May 25, 2022 21:07
Minimal example to reproduce cv::SVD::solveZ crash
#include <opencv2/core.hpp>
int main(int argc, char** argv) {
double x[117][43] = {{-890.2075142966416, -91.49514585853208, -1519.470669123981, -4378.297874749891, 288.75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{
328.0247571268432, -1514.656408530106, -525.5454067319092, -4091.284249468227, 841.8749389648438, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{
0.4572510884940519, -0.04269169026717295, -0.8883123671621016, -4.565511104557279, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{
-774.7308902380352, -63.73590155633997, -1582.833433156421, -4813.378878037186, 0, 406.8749694824219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{
437.1122295425562, -1473.381008340528, -562.1952994931905, -4437.79235664477, 0, 931.874938964843
@ducha-aiki
ducha-aiki / grayscale-dilation-example.ipynb
Created December 4, 2019 16:16
Grayscale dilation in kornia
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ducha-aiki
ducha-aiki / spatial-grad-bug.ipynb
Created July 29, 2019 18:07
kornia spatial grad bug
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ducha-aiki
ducha-aiki / matplotlib-fig-no-margins.py
Created July 18, 2019 11:17
Save matplotlib no margins
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from PIL import Image
fname = '../../test-graf/img1.png'
img = Image.open(fname).convert('RGB')
img = np.array(img)
@ducha-aiki
ducha-aiki / pyrdown-test.ipynb
Created July 16, 2019 12:53
Pyrdown bugreport
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ducha-aiki
ducha-aiki / compact_bilinear_pooling.py
Created February 1, 2019 11:41 — forked from vadimkantorov/compact_bilinear_pooling.py
Compact Bilinear Pooling in PyTorch using the new FFT support
import torch
class CompactBilinearPooling(torch.nn.Module):
def __init__(self, input_dim1, input_dim2, output_dim, sum_pool = True):
super(CompactBilinearPooling, self).__init__()
self.output_dim = output_dim
self.sum_pool = sum_pool
generate_sketch_matrix = lambda rand_h, rand_s, input_dim, output_dim: torch.sparse.FloatTensor(torch.stack([torch.arange(input_dim, out = torch.LongTensor()), rand_h.long()]), rand_s.float(), [input_dim, output_dim]).to_dense()
self.sketch_matrix1 = torch.nn.Parameter(generate_sketch_matrix(torch.randint(output_dim, size = (input_dim1,)), 2 * torch.randint(2, size = (input_dim1,)) - 1, input_dim1, output_dim))
self.sketch_matrix2 = torch.nn.Parameter(generate_sketch_matrix(torch.randint(output_dim, size = (input_dim2,)), 2 * torch.randint(2, size = (input_dim2,)) - 1, input_dim2, output_dim))
@ducha-aiki
ducha-aiki / install_orbslam_stuff.sh
Created January 29, 2019 14:09
Install ORBSLAM + python bindings
#!/bin/bash
DIR1=$(pwd)
MAINDIR=$(pwd)/3rdparty
mkdir ${MAINDIR}
cd ${MAINDIR}
conda create -y -n "NavAgents" python=3.6
source activate NavAgents
conda install opencv -y
conda install pytorch torchvision -c pytorch -y
@ducha-aiki
ducha-aiki / res_article_hardnet
Created October 26, 2018 15:04
res_article_hardnet.m
hb_setup();
%%
res = rproc.read('scoresroot', ...
fullfile(hb_path, 'matlab', 'scores', 'default'));
norm_splits = {};
norms_path = fullfile(hb_path, 'matlab', 'data', 'best_normalizations.csv');
norms = readtable(norms_path, 'delimiter', ',');
norms.Properties.RowNames = norms.descriptor;