Example #1
0
frame_var = StringVar()
frame_var.set(" | Freq:")
frame_label = Label(master, textvariable=frame_var, font="Verdana 10 bold")
frame_label.pack(side=LEFT)
FSIZE = [("L", 6), ("M", 4), ("H", 3)]
w1 = IntVar()
w1.set(FSIZE[0][1])  # initialize
previous_freq = w1.get()
for text, mode in FSIZE:
    b = Radiobutton(master, text=text, variable=w1, value=mode)
    b.pack(side=LEFT)

import heartbeat
import host_guest_comm
window_size_hr = 6
hb = heartbeat.Heartbeat(1024, window_size_hr, 100, "vic.log", 10, 100)
monitoring_items = ["heart_rate", "app_mode", "frame_size", "timeslice"]
comm = host_guest_comm.DomU(monitoring_items)

ap = argparse.ArgumentParser()
ap.add_argument("-v", "--video", help="path to the video file")
ap.add_argument("-a",
                "--min-area",
                type=int,
                default=500,
                help="minimum area size")
args = vars(ap.parse_args())

# COLORS=np.array([[5,200,250]])
CLASSES = [
    "background", "aeroplane", "bicycle", "bird", "boat", "bottle", "bus",
Example #2
0
 def ResetHeartbeat (self):
   if self.heartbeat:
     self.heartbeat.Stop( )
     self.heartbeat.remove_from_connection( )
   self.heartbeat = heartbeat.Heartbeat(self.bus, self)
   print "Set up HEARTBEAT!", self.heartbeat
Example #3
0
import imutils
import time
import cv2
import os
import socket
import sys
import threading
import copy
from imutils.video import FileVideoStream

import heartbeat
shm_id = int(os.environ['VIC_SHM_ID'])
window_size_hr = 5
print('		creating hb')
ts = time.time()
hb = heartbeat.Heartbeat(shm_id, window_size_hr, 100, "vic.log", 10, 100)
print('		time took to create hb', time.time() - ts)

import threading
from queue import Queue

mycam = FoscamCamera('65.114.169.151', 88, 'admin', 'admin', daemon=False)
# mycam = FoscamCamera('65.114.169.139',88,'arittenbach','8mmhamcgt16!',daemon=False)
mycam.ptz_reset()
vs = VideoStream(
    'rtsp://*****:*****@65.114.169.151:88/videoMain').start()  # realvid
# vs = VideoStream('rtsp://*****:*****@65.114.169.139:88/videoMain').start() # realvid
# vs= FileVideoStream("walkman.mp4").start() # outvid

net = cv2.dnn.readNetFromCaffe("MobileNetSSD_deploy.prototxt.txt",
                               "MobileNetSSD_deploy.caffemodel")
Example #4
0
        car[i - 20, :, :, :] = frame
    elif i >= 140:
        no_car[i - 140, :, :, :] = frame
vs.stop()
car = np.concatenate((car, np.flipud(car)), axis=0)

# create heartbeat
import heartbeat
window_size_hr = 5
sharedmem_id_for_heartbeat = 1024
buffer_depth = 100
log_name = "heartbeat.log"
min_heart_rate = 10  # not used in this demo
max_heart_rate = 100  # not used in this demo
hb = heartbeat.Heartbeat(sharedmem_id_for_heartbeat, window_size_hr,
                         buffer_depth, log_name, min_heart_rate,
                         max_heart_rate)

# establish communication with Dom0
import domU_comm
monitoring_items = ["heart_rate", "frame_size"]
comm = domU_comm.DomU(monitoring_items)

# prepare object detation neural network
net = cv2.dnn.readNetFromCaffe("MobileNetSSD_deploy.prototxt.txt",
                               "MobileNetSSD_deploy.caffemodel")

with Client(xen_bus_path="/dev/xen/xenbus") as c:
    # synching with Dom0 with xenstore
    domu_id = c.read("domid".encode())
    key_path_hash_frame_number_entry = ('/local/domain/' + domu_id.decode() +