Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import numpy as np | |
import imutils | |
import cv2 | |
import matplotlib.pyplot as plt | |
%matplotlib inline |
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
# Defined bounds using https://github.com/jrosebr1/imutils/blob/master/bin/range-detector | |
leaf_lower = (29, 0, 0) | |
leaf_upper = (255, 255, 128) | |
def leaf_mask(bgr_image): | |
frame = imutils.resize(bgr_image, width=500) | |
blurred = cv2.GaussianBlur(frame, (11, 11), 0) | |
hsv = cv2.cvtColor(blurred, cv2.COLOR_BGR2HSV) | |
# construct a mask for the color "green", then perform |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
module RequestSigning | |
extend ActiveSupport::Concern | |
included do | |
before_action :set_s3_direct_post, only: [:new] | |
end | |
def set_s3_direct_post | |
@s3_direct_post = AWS_S3_BUCKET.presigned_post(key: "uploads/#{SecureRandom.uuid}/${filename}", success_action_status: '201', acl: 'public-read') | |
end |
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
import json | |
import re | |
import requests | |
class Note(object): | |
def __init__(self, | |
host=None, | |
title='', | |
body='', | |
profile='', |
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
import io | |
import random | |
import picamera | |
from PIL import Image | |
from | |
import json | |
import re | |
import requests | |
global previous_frame |
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
import imutils | |
def motion(current_frame=None, previous_frame=None, avg=None, min_area=2000): | |
motion = False | |
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) | |
gray = cv2.GaussianBlur(gray, (21, 21), 0) | |
# if the average frame is None, initialize it | |
if avg is None: |