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
""" | |
koda: b2 | |
skupina: b | |
calibration_num_letters: =calibration8 level, max_num_letters? | |
time_calibration_num_letters: average time of elapsed time | |
choice: int(bool(["results"]["choice"] == "hard")) | |
correct: ["results"]["expsolved"] | |
time: ["results"]["elapsedTime"] | |
""" |
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
def contains_sequence(array, sequence): | |
for idx in range(len(array)): | |
if idx + len(sequence) > len(array): | |
return False | |
if array[idx:idx+len(sequence)] == sequence: | |
return True | |
# Tests | |
tests = { | |
"contains_sequence": { |
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
function getCookie(name) { | |
var cookieValue = null; | |
if (document.cookie && document.cookie != '') { | |
var cookies = document.cookie.split(';'); | |
for (var i = 0; i < cookies.length; i++) { | |
var cookie = jQuery.trim(cookies[i]); | |
// Does this cookie string begin with the name we want? | |
if (cookie.substring(0, name.length + 1) == (name + '=')) { | |
cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); | |
break; |
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 | |
from sklearn.metrics import precision_recall_curve | |
import matplotlib.pyplot as pl | |
recall, precision, thresholds = precision_recall_curve(np.array(np_y_true), np.array(np_y_scores)) | |
pl.plot(recall, precision) | |
pl.xlabel('Recall') | |
pl.ylabel('Precision') | |
pl.ylim([0.0, 1.05]) | |
pl.xlim([0.0, 1.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 matplotlib.pyplot as pl | |
recall, precision, thresholds = precision_recall_curve(np.array(np_y_true), np.array(np_y_scores)) | |
pl.plot(recall, precision) | |
pl.xlabel('Recall') | |
pl.ylabel('Precision') | |
pl.ylim([0.0, 1.05]) | |
pl.xlim([0.0, 1.0]) | |
pl.title('Precision-Recall') | |
pl.savefig("{0}_{1}.png".format(kernel, k)) |
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 freenect import sync_get_depth as get_depth, sync_get_video as get_video | |
import cv2 | |
import time | |
import numpy as np | |
import pickle | |
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001) | |
def save_file(frame, idx): | |
cv2.imwrite("data/rgb{}.jpeg".format(idx), frame["rgb"]) |