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
const int MAX_STEPS = 200; | |
const float MAX_DEPTH = 20.0; | |
const float EPS = 0.0001; | |
const float DIFF_EPS = 0.0001; | |
const float VERT_FOV = radians(40.0); | |
const vec3 K_a = vec3(0.1, 0.3, 0.0); | |
const vec3 K_d = vec3(0.3, 0.7, 0.5); | |
const vec3 K_s = vec3(1.0, 1.0, 1.0); | |
const float K_shine = 4.0; |
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
use clap::{crate_name, crate_version, App, Arg}; | |
use indicatif::{ParallelProgressIterator, ProgressStyle}; | |
use murmur3::murmur3_x64_128; | |
use rayon::iter::{IntoParallelRefIterator, ParallelIterator}; | |
use std::fs::metadata; | |
use std::fs::File; | |
use std::io::prelude::*; | |
use std::sync::{Arc, Mutex}; | |
use walkdir::WalkDir; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 skimage | |
import numpy as np | |
LANDMARKS_SRC = np.array([[0.30392274, 0.29713595], | |
[0.68197238, 0.29713595], | |
[0.53872643, 0.57810357], | |
[0.38641786, 0.67528929], | |
[0.60154214, 0.76057500]]) |
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 argparse | |
import asyncio | |
import time | |
from concurrent.futures.thread import ThreadPoolExecutor | |
from functools import partial | |
from pathlib import Path | |
import uvloop | |
from PIL import Image |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from pathlib import Path | |
import shutil | |
from tqdm import tqdm | |
from joblib import Parallel, delayed | |
def pcopy(dir_in, dir_out, files_list, processes=8): | |
dir_in = Path(dir_in) | |
dir_out = Path(dir_out) | |
copy_list = [ |
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
def zigsaw(image, num_cuts, random_state=None, **kwargs): | |
"""Split and shuffle | |
Args: | |
image: Input image, currently, only RGB, uint8 images are supported. | |
num_cuts: number of cuts per side. Image is split `into num_cuts * num_cuts` pieces | |
random_state: | |
**kwargs: | |
Returns: | |
Image with reshuffled patches. | |
""" |
NewerOlder