Skip to content

Instantly share code, notes, and snippets.

View swarathesh's full-sized avatar

Chandra Swarathesh Addanki swarathesh

View GitHub Profile
#Min Steps in Infinite GridBookmark Suggest Edit
import math as mat
def maxsteps(x,y):
steps =0
cov = (x[0],y[0])
n = len(x)
for i in range(1,n):
diffX = mat.fabs(cov[0]-x[i])
diffy = mat.fabs(cov[1]-y[i])
@swarathesh
swarathesh / cvhw3.py
Created September 29, 2018 15:22
Computer vision assesment
from tkinter import *
from tkinter import ttk
from PIL import ImageTk,Image
from tkinter.filedialog import askopenfilename
import cv2
import uuid
import time
import tkinter
import PIL.Image, PIL.ImageTk
from PIL import Image
def create_cnn( height, width, depth, filters=(16, 32, 64), regress=False):
filters = np.asarray(filters)
input_shape = (height, width, depth)
chanDim = -1
inputs = Input(shape=input_shape)
def create_mlp(dim, regress=False):
model = Sequential()
model.add(Dense(8, input_dim=dim, activation="relu"))
model.add(Dense(4, activation="relu"))
if regress:
model.add(Dense(1, activation="linear"))