Esempio n. 1
0
def set_up():
    # Init repository with one file.
    remove_dir(_FLAGS, _TEST_DIR)
    mkdirs(_FLAGS, _TEST_DIR)
    init_repository(_FLAGS, _TEST_DIR)
    chdir(_TEST_DIR)
    create_file(_FLAGS, _TEST_FILE)
    commit_changes(_FLAGS, "Test file added.")

    # Create branches.
    create_branch(_FLAGS, _UPSTREAM)
    switch_branch(_UPSTREAM)

    create_branch(_FLAGS, _DEBIAN)
    switch_branch(_DEBIAN)
    mkdirs(_FLAGS, path.dirname(_TEST_DEBIAN_FILE))
    create_file(_FLAGS, _TEST_DEBIAN_FILE)
    commit_changes(_FLAGS, "Test debian file added.")

    # Commit ignored file and config.
    switch_branch(_RELEASE)
    create_file(_FLAGS, _IGNORE_FILE)
    create_file(_FLAGS, _TEST_FILE2)
    execute_with(action=Action.CONFIG)
    commit_changes(_FLAGS, "Ignored file added.")
Esempio n. 2
0
import dlib
import numpy as np

import concurrent_track
import encrypt
import ioutil
from vision import *
from NetworkProtocol import *
import websocketclient
from demo_config import Config
from framebuffer import FaceFrameBuffer

LOG = ioutil.getLogger(__name__)

if Config.WRITE_PICTURE_DEBUG:
    ioutil.remove_dir(Config.WRITE_PICTURE_DEBUG_PATH)
    ioutil.create_dir(Config.WRITE_PICTURE_DEBUG_PATH)
    track_frame_id = 0
DETECT_TRACK_RATIO = 10
FrameTuple = namedtuple('FrameTuple', ['frame', 'fid'])


class RecognitionRequestUpdate(object):
    def __init__(self, recognition_frame_id, location):
        self.recognition_frame_id = recognition_frame_id
        self.location = location


class FaceTransformation(object):
    def _launch_openface(self):
        import subprocess