This file contains hidden or 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, os, cv2 | |
| from keras.utils import to_categorical | |
| from keras.models import load_model | |
| #reads images from folder (images must be labeled 0.png, 1.png, etc...) | |
| def read_from_folder(folder, pattern, image_number, stop): | |
| images = [] | |
| while image_number < stop: | |
| path = folder + pattern + '/casc (' + str(image_number-119)+ ').png' | |
| img = cv2.imread(path, 0) |
This file contains hidden or 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, os, cv2 | |
| from keras.utils import to_categorical | |
| from keras.models import load_model | |
| #reads images from folder (images must be labeled 0.png, 1.png, etc...) | |
| def read_from_folder(folder, pattern, image_number, stop): | |
| images = [] | |
| while image_number < stop: | |
| path = folder + pattern + '/casc (' + str(image_number)+ ').png' | |
| import os; img_path = path; assert os.path.exists(img_path), img_path |
This file contains hidden or 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
| # CannyStill.py | |
| import cv3 | |
| import numpy as np | |
| import os | |
| ################################################################################################### | |
| def main(): | |
| imgOriginal = cv3.imread("image.jpg") # open image |
This file contains hidden or 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
| # C:\Users\Thursday>python keras_for_juggling4.py | |
| # Using TensorFlow backend. | |
| # Traceback (most recent call last): | |
| # File "keras_for_juggling4.py", line 81, in <module> | |
| # validation_data=(test_data, test_labels_one_hot)) | |
| # File "C:\Users\Thursday\Anaconda3\lib\site-packages\keras\models.py", line 963, in fit | |
| # validation_steps=validation_steps) | |
| # File "C:\Users\Thursday\Anaconda3\lib\site-packages\keras\engine\training.py", line 1637, in fit | |
| # batch_size=batch_size) | |
| # File "C:\Users\Thursday\Anaconda3\lib\site-packages\keras\engine\training.py", line 1483, in _standardize_user_data |
This file contains hidden or 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
| #Traceback (most recent call last): | |
| # File "jugtrack.py", line 51, in <module> | |
| # track = new_track | |
| #NameError: name 'new_track' is not defined | |
| import numpy as np | |
| import cv2 | |
| import math | |
| colors = [(255,0,0), (125,125,125), (0,255,0), (0,0,255), (125,125,0)] |
This file contains hidden or 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 | |
| import math | |
| colors = [(255,0,0), (125,125,125), (0,255,0), (0,0,255), (125,125,0)] | |
| new = 0 | |
| track = [] | |
| radius = 18 | |
| thickness = 5 | |
| cap = cv2.VideoCapture(0) | |
| for i in range(930): ret, img = cap.read() |
This file contains hidden or 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 tkinter import * #for widgets | |
| import tkinter as ttk #for widgets | |
| import time #for sending midi | |
| import rtmidi #for sending midi | |
| #from ttk import * | |
| midiout = rtmidi.MidiOut() | |
| available_ports = midiout.get_ports() | |
| if available_ports: |
This file contains hidden or 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 tracks any number of balls, so long as they are big enough | |
| # and fall into the 'white' color range well enough. glow balls | |
| # in darkness works | |
| # import the necessary packages | |
| import math | |
| from math import hypot | |
| from tkinter import * #for widgets | |
| import tkinter as ttk #for widgets | |
| from tkinter.scrolledtext import ScrolledText | |
| import time #for sending midi |
This file contains hidden or 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
| //YOU NEED AN IMAGE OF A CURSOR IN ORDER TO RUN THIS CODE: | |
| //https://cdn.pixabay.com/photo/2012/04/01/12/39/cursor-23231_960_720.png | |
| import gazetrack.*; | |
| import java.awt.Toolkit; | |
| PImage cursor; | |
| GazeTrack gazeTrack; |
This file contains hidden or 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
| { | |
| "text_prompts": { | |
| "0": [ | |
| "empty black void of space constellation stars by Beeple" | |
| ], | |
| "360": [ | |
| "astronaut in outerspace by Beeple" | |
| ], | |
| "720": [ | |
| "a bright sun with planets by Beeple" |
OlderNewer