Skip to content

Instantly share code, notes, and snippets.

@nvs-abhilash
nvs-abhilash / rotate_contour.py
Last active May 12, 2022 11:42
Helper function to resize and rotate contours using OpenCV
View rotate_contour.py
import cv2
import numpy as np
def cart2pol(x, y):
theta = np.arctan2(y, x)
rho = np.hypot(x, y)
return theta, rho
@mmmikael
mmmikael / mnist_siamese.py
Last active January 24, 2021 07:27
Keras example for siamese training on mnist
View mnist_siamese.py
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
np.random.seed(1337) # for reproducibility
import random
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers.core import *
from keras.optimizers import SGD, RMSprop