Example #1
0
import sys
sys.path.insert(0, '../dynamikontrol')

from dynamikontrol import Module
import time

module = Module(debug=True)

while True:
    print(module.motor.get_offset())

    time.sleep(2)

    module.motor.set_offset(17.5)
Example #2
0
from dynamikontrol import Module
import cv2
from deepface import DeepFace
from pathlib import Path
# 아래 링크에서 파일을 다운로드 받아, {HOME_FOLDER}/.deepface/weights 폴더에 복사하세요.
# https://drive.google.com/uc?id=1CPSeum3HpopfomUEK1gybeuIVoeJT_Eo
home = str(Path.home())
print('HOME_FOLDER is ', home)

my_img = 'db/brad/05.jpg'

cap = cv2.VideoCapture(0)

module = Module()
module.motor.angle(-85)

while cap.isOpened():
    ret, img = cap.read()
    if not ret:
        continue

    result = DeepFace.verify(img1_path=my_img,
                             img2_path=img,
                             enforce_detection=False)

    if result['verified']:
        text = 'Open'
        color = (0, 255, 0)
        module.motor.angle(85)
    else:
        text = 'Close'