Skip to content

Instantly share code, notes, and snippets.

@nvs-abhilash
nvs-abhilash / rotate_contour.py
Last active April 2, 2024 15:06
Helper function to resize and rotate contours using OpenCV
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
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