|releasedate| | |license| | |doi| |
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
#!/usr/bin/env python3 | |
""" Generate text files for testing Evernote v10.x | |
Generates text files of different sizes. The text files have increasing numbers | |
of lines. The number of words per line is random, between min_words and | |
max_words. The text that provides the pool of words is The Gettysburg Address. | |
Text files are named ENtest500.txt, ENtest1000, ENtest1500, ENtest2000, ... | |
where the number portion represents the number of text lines in the file. | |
Author: Jeff Bass, https://github.com/jeffbass |
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
# Settings for imagenode.py picam motion detector | |
--- | |
node: | |
name: Driveway | |
queuemax: 50 | |
patience: 10 | |
stall_watcher: True | |
heartbeat: 10 | |
send_type: jpg | |
print_settings: False |
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
# Use subprocess.run() to list the number of imagehub_data images for each date | |
# | |
# Copyright (c) 2018 by Jeff Bass. | |
# License: MIT, see LICENSE for more details. | |
import os | |
import subprocess | |
def n_images(dir): | |
command = 'ls -l ' + dir + ' | wc -l' |
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
# this is an example method from the Librarian ChatBot class | |
# note that this is a simple example with a few hard coded imagenode names | |
def report_temperature(self, locations): | |
""" report temperature by location | |
This is a very awkward test matching of location and temperature. | |
Needs to be made much more sophistcated than if / else / etc. | |
Parameters: |
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
"""librarian: answer questions using imagehub event messages, images sensor data | |
Answers questions about currrent and past observations of imagenodes, including | |
inputs from PiCameras, USB Webcams, temperature sensors, etc. | |
Gathers image, sensor and event logs from imagehubs. Does analysis such as | |
object detection and classification on images. Monitors operational status of | |
imagenodes and imagehubs. Manages multiple modes of communications for queries | |
and alerts. |
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
"""data_tools: data tools including classes, methods and attributes | |
Provides a variety of classes to hold, transfer, analyze, transform and query | |
the various data in the data library and in the imagehubs accessible to the | |
librarian. | |
Copyright (c) 2018 by Jeff Bass. | |
License: MIT, see LICENSE for more details. | |
""" |
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
#imagehub.py snippet | |
# (all the imports, logging setup hidden for now) | |
settings = Settings() # get settings from YAML file | |
hub = ImageHub(settings) # start ImageWriter, Timers, etc. | |
# forever event loop: receive & process images and text from imagenodes | |
while True: | |
try: | |
with Patience(hub.patience): | |
text, image = hub.receive_next() | |
except Patience.Timeout: # if no timely message from any node |
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
"""test sending a jpg buffer and check type & size of buffer | |
A simple test program that creates an image, then converts it to a | |
jpg_buffer and checks the type(), ndim, size and shape of the jpg_buffer. | |
This program tests some imports and some OpenCV functions, as well. | |
Open Source Licensed under MIT License (MIT) | |
Copyright (c) 2020, Jeff Bass, [email protected] | |
""" |
NewerOlder