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 sample_from_discretized_mix_logistic(l, nr_mix): | |
| ls = int_shape(l) | |
| xs = ls[:-1] + [3] | |
| # unpack parameters | |
| # N different logistic models | |
| logit_probs = l[:, :, :, :nr_mix] | |
| l = tf.reshape(l[:, :, :, nr_mix:], xs + [nr_mix * 3]) | |
| print("l:") | |
| print(l) | |
| # sample mixture indicator from softmax |
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 nltk | |
| from nltk.corpus import stopwords | |
| systems = ['cassandra', 'flume', 'hbase', 'hdfs', 'mapreduce', 'zookeeper'] | |
| def strip_redundant_info(line): | |
| begin_key = line.find(']') + 2 | |
| end_key = line.find('\n') - 2 |
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 nltk | |
| from nltk.corpus import stopwords | |
| def strip_redundant_info(line): | |
| begin_key = line.find(']') + 2 | |
| end_key = line.find('\n') - 2 | |
| # extract auto-generated string | |
| useful_description = line[begin_key:end_key + 1] |
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 the necessary packages | |
| from __future__ import print_function | |
| from imutils.object_detection import non_max_suppression | |
| from imutils import paths | |
| import numpy as np | |
| import argparse | |
| import imutils | |
| import cv2 | |
| # construct the argument parse and parse the arguments |
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 | |
| image = cv2.imread("games.jpg") | |
| upper = np.array([65, 65, 255]) | |
| lower = np.array([0, 0, 200]) | |
| mask = cv2.inRange(image, lower, upper) | |
| (_, cnts, _) = cv2.findContours(mask.copy(), cv2.RETR_EXTERNAL, |