Skip to content

rakhimovv/voronoi-interp-torch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

voronoi-interp-torch

If you only know a few random pixels of an image, you can fill in the rest using nearest neighbors. This can result in cool animations as you gradually add more and more pixels at random.

The original version of this project written in Go.

This version is differentiable using PyTorch and CUDA.

Example

Here is an example output:

demo

Given that the function is differentiable you can also optimize the color values of the cells instead of using the original ones:

opt

Usage

Install python module: ./setup.sh

Example:

import torch
from voronoi_interp_torch import voronoi_interpolate

coords = torch.randint(0, 100, size=(100, 2)).cuda()
values = torch.rand(100, 3).cuda()
result = voronoi_interpolate(coords, values, H=100, W=100)

Demo where backprop is tested.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published