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
auto dist = [n, &dists](size_t i, size_t j) { return dists[i * n + j]; } // dists is pre-calculated n x n distances matrix | |
auto index = seq(n); //[0,...,n-1] | |
std::vector<size_t> rho(n); | |
for (size_t i=0; i<n; ++i) { | |
rho[i] = std::count_if(index.begin(), index.end(), [&](size_t j) { return dist(i,j) < dist_cutoff; }); | |
} | |
std::vector<D> delta(n); | |
for (size_t i=0; i<n; ++i) { |
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
#!/usr/bin/python | |
import glob | |
import os | |
import sys | |
from PIL import Image | |
EXTS = 'jpg', 'jpeg', 'JPG', 'JPEG', 'gif', 'GIF', 'png', 'PNG' |