This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// macOS_GUI | |
// | |
// Created by Shawon Ashraf on 7/8/17. | |
// Copyright © 2017 Shawon Ashraf. All rights reserved. | |
// | |
import Cocoa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import math | |
import numpy as np | |
from scipy import spatial | |
import cv2 | |
# ============================================================================ | |
CAR_COLOURS = [ (0,0,255), (0,106,255), (0,216,255), (0,255,182), (0,255,76) | |
, (144,255,0), (255,255,0), (255,148,0), (255,0,178), (220,0,255) ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is useful for reading the contents of the ops generated by ruby. | |
# You can read any graph defination in pb/pbtxt format generated by ruby | |
# or by python and then convert it back and forth from human readable to binary format. | |
import tensorflow as tf | |
from google.protobuf import text_format | |
from tensorflow.python.platform import gfile | |
def pbtxt_to_graphdef(filename): | |
with open(filename, 'r') as f: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import cv2 | |
class BackGroundSubtractor: | |
# When constructing background subtractor, we | |
# take in two arguments: | |
# 1) alpha: The background learning factor, its value should | |
# be between 0 and 1. The higher the value, the more quickly | |
# your program learns the changes in the background. Therefore, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pygame.locals import KEYDOWN, K_ESCAPE, K_q | |
import pygame | |
import cv2 | |
import sys | |
camera = cv2.VideoCapture(1) | |
pygame.init() | |
pygame.display.set_caption("OpenCV camera stream on Pygame") | |
screen = pygame.display.set_mode([1280, 720]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import numpy as np | |
import time | |
N=10000 | |
K=4 | |
MAX_ITERS = 1000 | |
start = time.time() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.app import App | |
from kivy.clock import Clock | |
from kivy.lang import Builder | |
from kivy.properties import NumericProperty, ListProperty | |
from kivy.uix.widget import Widget | |
KV = ''' | |
#:import chain itertools.chain | |
#:import sin math.sin | |
#:import cos math.cos |