Skip to content

Instantly share code, notes, and snippets.

View booiljung's full-sized avatar

Booil Jung booiljung

View GitHub Profile
def left_right_crop(img, size):
if isinstance(size, numbers.Number):
size = (int(size), int(size))
else:
assert len(size) == 2, "Please provide only two dimensions (h, w) for size."
w, h = img.size
crop_h, crop_w = size
if crop_w > w or crop_h > h:
raise ValueError("Requested crop size {} is bigger than input size {}".format(size, (h, w)))
# https://www.facebook.com/groups/pythonkorea/permalink/2257134351036380/
class Interface:
def __init__():
pass
def __method__():
pass
class A(Interface):
def __init__(para1):