Skip to content

Instantly share code, notes, and snippets.

Avatar

Petteri Aimonen PetteriAimonen

View GitHub Profile
View interpolate.py
#!/usr/bin/python3
# Interpolate depth maps
from PIL import Image
import math
import random
contours = Image.open("contours.png")
contourspx = contours.load()
w, h = contours.size
View keybase.md

Keybase proof

I hereby claim:

  • I am petteriaimonen on github.
  • I am jpa (https://keybase.io/jpa) on keybase.
  • I have a public key ASDMJhsa2oINfygbEdRO47UU2yytVjRxUXZK3OH70zMwQgo

To claim this, I am signing this object:

View gist:8a05e7b908183251f55ea43d118b49b2
>>> class foobar: pass
...
>>> A = foobar()
>>> B = foobar()
>>> A.b = B
>>> B.a = A
>>> pickle.dumps(A)
"(i__main__\nfoobar\np0\n(dp1\nS'b'\np2\n(i__main__\nfoobar\np3\n(dp4\nS'a'\np5\ng0\nsbsb."
>>> newA = pickle.loads(pickle.dumps(A))
>>> newA.b