Skip to content

Instantly share code, notes, and snippets.

View w-garcia's full-sized avatar

Washington Garcia w-garcia

View GitHub Profile
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
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
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]
# 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
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,