from pushbullet import PushBullet # Inisialisasi variabel counter, label dan tanggal inc = 0 label = "Init" intercept = [None, None] frameIntercept = [None, None, None, None, None, None, None, None] frameCount = 0 # Token untuk PushBullet token = 'o.ddpV3vtIXKx3vRVPbeoDaI2rsyGzHAvx' # Setting untuk PushBullet p = PushBullet(token) devices = p.getDevices() contacts = p.getContacts() # Fungsi untuk mendeteksi apakah memakai masker def deteksi_masker(frame, faceNet, maskNet): (h, w) = frame.shape[:2] blob = cv2.dnn.blobFromImage(frame, 1.0, (224, 224), (104.0, 177.0, 123.0)) faceNet.setInput(blob) detections = faceNet.forward() faces = [] locs = [] preds = [] for i in range(0, detections.shape[2]):
import sys import json import os from pushbullet import PushBullet from requests.exceptions import HTTPError if __name__ == '__main__': p = PushBullet("L0Wtxg0coFfVW4majBbORq3sS3xkQmTF") devices = p.getDevices() # Get a list of contacts contacts = p.getContacts() # Send a note #p.pushNote(devices[0]["iden"], 'Hello world', 'Test body') p.pushFile(devices[0]["iden"], "take-photo-test5.jpg", "This is a test file", open("/home/pi/RPiWebCam/Test/take-photo-test5.jpg", "rb")) #note = p.pushNote(args.device, args.title, " ".join(args.body)) #if args.json: # print(json.dumps(note)) # return #if args.device and args.device[0] == '#': # print("Note broadcast to channel %s" % (args.device)) #elif not args.device: # print("Note %s sent to all devices" % (note["iden"])) #else: # print("Note %s sent to %s" % (note["iden"], note["target_device_iden"]))