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
# Mindmeld getting started | |
docker pull mindmeldworkbench/dep:latest | |
docker run -p 0.0.0.0:9200:9200 -p 0.0.0.0:7151:7151 -p 0.0.0.0:9300:9300 mindmeldworkbench/dep -ti -d | |
bash -c "$(curl -s https://devcenter.mindmeld.com/scripts/mindmeld_lite_init.sh)" | |
# download dependencies | |
mkdir emear | |
cd emear | |
virtualenv -p python3 . | |
source bin/activate |
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
What does {Nan Singh|name} get for {compensation|money}? | |
{susan|name} {earns|money} how much {day by day|time_recur} | |
Tell me who earned the {most|extreme} that has {been here|employment_action} {this year|sys_time}? | |
What is {Susan Ferguson|name} {earners|money} on a {on a monthly basis|time_recur} basis? | |
Ms.{Power|name}s {make|money} a lot {on a monthly basis|time_recur} | |
{incomes|money} {mia Brown|name} | |
What does {thelma petrowsky|name} {earner|money} {each day|time_recur} | |
Is {Leigh|name} being {paid|money} {40k|sys_number}? | |
What is {Samuel MacLenJulia Soto|name} {income|money} | |
What is Mrs.{Williams|name}'s {money|money}? |
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
{Jumil Turpin|name} {month to month|time_recur} {dollars|money} | |
What is {ivan|name}'s {hourly|time_recur} {salary|money} | |
Does {Lisa Galia|name} {earner|money} {6 figures|sys_number}? | |
Is {Nicole Fancett|name} being {paid|money} {$50k|sys_amount-of-money}? | |
How much does {Ivan Rogers|name} get {paid|money}? | |
Does {60,000|sys_number} exceed what {julia soto|name} {earns|money} {every year|time_recur}? | |
According to the {payroll|money}, how much does {Libby Fidelia|name} {earn|money}? | |
Describe {sophia theamstern|name}'s {pay|money} | |
How much {pay|money} does {Phil Close|name} bring in {every day|time_recur}? | |
What does {Rose Ivey|name}'s {make|money} look like? |
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
# Slides: | |
# https://cisco.box.com/s/brm0recnlq96ducqywrbn94ac39acel8 | |
# https://cisco.app.box.com/notes/474240338419?s=4yjprnc2gv1k0pchfxpnn8dtg23vff0a | |
# Solution 1: | |
@app.handle(intent='help') | |
def provide_help(request, responder): | |
""" | |
When the user asks for help, provide a help message |
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
def weighted_img(img, initial_img, α=0.8, β=1., λ=0.): | |
""" | |
`img` is the output of the hough_lines(), An image with lines drawn on it. | |
Should be a blank image (all black) with lines drawn on it. | |
`initial_img` should be the image before any processing. | |
The result image is computed as follows: | |
initial_img * α + img * β + λ |
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
def draw_lines(img, lines, color=[255, 0, 0], thickness=2): | |
""" | |
This function draws `lines` with `color` and `thickness`. | |
""" | |
imshape = img.shape | |
# these variables represent the y-axis coordinates to which the line will be extrapolated to | |
ymin_global = img.shape[0] | |
ymax_global = img.shape[0] | |
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
def hough_lines(img, rho, theta, threshold, min_line_len, max_line_gap): | |
""" | |
`img` should be the output of a Canny transform. | |
Returns an image with hough lines drawn. | |
""" | |
lines = cv2.HoughLinesP(img, rho, theta, threshold, np.array([]), minLineLength=min_line_len, maxLineGap=max_line_gap) | |
line_img = np.zeros((*img.shape, 3), dtype=np.uint8) | |
draw_lines(line_img, lines) |
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
def region_of_interest(img, vertices): | |
""" | |
Applies an image mask. | |
Only keeps the region of the image defined by the polygon | |
formed from `vertices`. The rest of the image is set to black. | |
""" | |
#defining a blank mask to start with | |
mask = np.zeros_like(img) | |
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
def canny(img, low_threshold, high_threshold): | |
"""Applies the Canny transform""" | |
return cv2.Canny(img, low_threshold, high_threshold) | |
# canny | |
minThreshold = 100 | |
maxThreshold = 200 | |
edgeDetectedImage = canny(gaussianBlur, minThreshold, maxThreshold) |
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
def gaussian_blur(img, kernel_size): | |
"""Applies a Gaussian Noise kernel""" | |
return cv2.GaussianBlur(img, (kernel_size, kernel_size), 0) | |
# apply gaussian blur | |
kernelSize = 5 | |
gaussianBlur = gaussian_blur(grayscaled, kernelSize) |
NewerOlder