All Projects → prideout → clumpy

prideout / clumpy

Licence: MIT License
create or transform numpy images from the command line

Programming Languages

C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to clumpy

Tiny Renderer
A tiny sotfware 3D renderer in 100 lines of Python
Stars: ✭ 120 (+215.79%)
Mutual labels:  numpy, computer-graphics
numpythia
The interface between PYTHIA and NumPy
Stars: ✭ 33 (-13.16%)
Mutual labels:  numpy
robot
Functions and classes for gradient-based robot motion planning, written in Ivy.
Stars: ✭ 29 (-23.68%)
Mutual labels:  numpy
polystores
A library for performing hyperparameter optimization
Stars: ✭ 48 (+26.32%)
Mutual labels:  numpy
npyjs
Read numpy .npy files in JavaScript
Stars: ✭ 28 (-26.32%)
Mutual labels:  numpy
Python-notes
Python related technologies used in work: crawler, data analysis, timing tasks, RPC, page parsing, decorator, built-in functions, Python objects, multi-threading, multi-process, asynchronous, redis, mongodb, mysql, openstack, etc.
Stars: ✭ 104 (+173.68%)
Mutual labels:  numpy
Neo
Deep learning library in python from scratch
Stars: ✭ 36 (-5.26%)
Mutual labels:  numpy
Python-camp
No description or website provided.
Stars: ✭ 34 (-10.53%)
Mutual labels:  numpy
ampscan
ampscan is an open-source Python package for analysis and visualisation of digitised surface scan data, specifically for applications within Prosthetics and Orthotics (P&O), with an aim to improve evidence-based clinical practice towards improved patient outcomes.
Stars: ✭ 14 (-63.16%)
Mutual labels:  numpy
Data-Science-Tutorials
Python Tutorials for Data Science
Stars: ✭ 104 (+173.68%)
Mutual labels:  numpy
ESA
Easy SimAuto (ESA): An easy-to-use Power System Analysis Automation Environment atop PowerWorld Simulator Automation Server (SimAuto)
Stars: ✭ 26 (-31.58%)
Mutual labels:  numpy
numpngw
Functions that create PNG and animated PNG files from numpy arrays.
Stars: ✭ 49 (+28.95%)
Mutual labels:  numpy
sparse dot
Python wrapper for Intel Math Kernel Library (MKL) matrix multiplication
Stars: ✭ 38 (+0%)
Mutual labels:  numpy
NPY-for-Fortran
A FORTRAN module to write Numpy's *.npy and *.npz files
Stars: ✭ 30 (-21.05%)
Mutual labels:  numpy
StudyNotes
学习笔记
Stars: ✭ 17 (-55.26%)
Mutual labels:  computer-graphics
go-icp cython
Go-ICP for globally optimal 3D pointset registration
Stars: ✭ 79 (+107.89%)
Mutual labels:  computer-graphics
Introduction-to-Python-Programming
Lectures in Big Data Institute, Seoul National University
Stars: ✭ 24 (-36.84%)
Mutual labels:  numpy
Fourier-Transform
An implementation of the Fourier Transform using Python
Stars: ✭ 43 (+13.16%)
Mutual labels:  numpy
get-started-with-JAX
The purpose of this repo is to make it easy to get started with JAX, Flax, and Haiku. It contains my "Machine Learning with JAX" series of tutorials (YouTube videos and Jupyter Notebooks) as well as the content I found useful while learning about the JAX ecosystem.
Stars: ✭ 229 (+502.63%)
Mutual labels:  numpy
mLib
Research Library used in the Visual Computing Lab
Stars: ✭ 80 (+110.53%)
Mutual labels:  computer-graphics

Build Status GitHub license

This tool can manipulate or generate large swaths of image data stored in numpy files. It's a sandbox for implementing operations in C++ that are either slow or non-existent in pillow, scikit-image, or the SciPy ecosystem.

Since it's just a command line tool, it doesn't contain any FFI messiness. Feel free to contribute by adding your own command, but keep it simple! Add a cc file to the commands folder and make a pull request.

This is just a toy library. For serious C++ applications you might want to look at xtensor (which can read / write npy files) and xtensor-io. To achieve huge speed-ups with numpy, see numba.


Build and run clumpy.

cmake -H. -B.release -GNinja && cmake --build .release
alias clumpy=$PWD/.release/clumpy
clumpy help

Generate two octaves of simplex noise and combine them.

clumpy generate_simplex 500x250 0.5 16.0 0 noise1.npy
clumpy generate_simplex 500x250 1.0 8.0  0 noise2.npy

python <<EOL
import numpy as np; from PIL import Image
noise1, noise2 = np.load("noise1.npy"), np.load("noise2.npy")
result = np.clip(np.abs(noise1 + noise2), 0, 1)
Image.fromarray(np.uint8(result * 255), "L").show()
EOL


Create a distance field with a random shape.

clumpy generate_dshapes 500x250 1 0 shapes.npy
clumpy visualize_sdf shapes.npy rgb shapeviz.npy

python <<EOL
import numpy as np; from PIL import Image
Image.fromarray(np.load('shapeviz.npy'), 'RGB').show()
EOL


Create a 2x2 atlas of distance fields, each with 5 random shapes.

for i in {1..4}; do clumpy generate_dshapes 250x125 5 $i shapes$i.npy; done
for i in {1..4}; do clumpy visualize_sdf shapes$i.npy shapes$i.npy; done

python <<EOL
import numpy as np; from PIL import Image
a, b, c, d = (np.load('shapes{}.npy'.format(i)) for i in [1,2,3,4])
img = np.vstack(((np.hstack((a,b)), np.hstack((c,d)))))
Image.fromarray(img, 'RGB').show()
EOL


Create a nice distribution of ~20k points, cull points that overlap certain areas, and plot them. Do all this in less than a second and use only one thread.

clumpy bridson_points 500x250 2 0 coords.npy
clumpy generate_dshapes 500x250 1 0 shapes.npy
clumpy cull_points coords.npy shapes.npy culled.npy
clumpy splat_points culled.npy 500x250 u8disk 1 1.0 splats.npy

python <<EOL
import numpy as np; from PIL import Image
Image.fromarray(np.load("splats.npy"), "L").show()
EOL


You may wish to invoke clumpy from within Python using os.system or subprocess.Popen .

Here's an example that generates 240 frames of an advection animation with ~12k points, then brightens up the last frame and displays it. This entire script takes about 1 second to execute and uses only one core (3.1 GHz Intel Core i7).

from numpy import load
from PIL import Image
from os import system

def clumpy(cmd):
    result = system('./clumpy ' + cmd)
    if result: raise Exception("clumpy failed with: " + cmd)

clumpy('generate_simplex 1000x500 1.0 8.0 0 potential.npy')
clumpy('curl_2d potential.npy velocity.npy')
clumpy('bridson_points 1000x500 5 0 pts.npy')
clumpy('advect_points pts.npy velocity.npy 30 1 0.95 240 anim.npy')
Image.fromarray(load("000anim.npy"), "L").point(lambda p: p * 2).show()


Create a visualization of pendulum's phase space.

clumpy pendulum_phase 4000x2000 0.9 2 5 field.npy
clumpy bridson_points 4000x2000 20 0 pts.npy
clumpy advect_points pts.npy field.npy 2.5 5 0.99 400 phase.npy

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].