def __init__(self): setLogger('actionService') dotenv_path = '.env' load_dotenv(dotenv_path) self.queue = queue() self.channel = self.queue.createChannel() self.channel.queue_declare(queue=self.QUEUE_NAME) self.channel.basic_consume(self.callback, queue=self.QUEUE_NAME, no_ack=True) self.actionHandler = actionHandler()
def __init__(self): setLogger('SpeachToTextService') dotenv_path = '.env' load_dotenv(dotenv_path) os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = os.getenv('GOOGLE_APPLICATION_CREDENTIALS') self.queue = queue() self.channel = self.queue.createChannel() self.channel.queue_declare(queue=self.QUEUE_NAME) self.channel.basic_consume(self.callback, queue=self.QUEUE_NAME, no_ack=True) self.stt = stt()
def __init__(self): setLogger('HebTextToSpeachService') dotenv_path = '.env' load_dotenv(dotenv_path) self.queue = queue() self.channel = self.queue.createChannel() self.channel.queue_declare(queue=self.QUEUE_NAME) self.channel.basic_consume(self.callback, queue=self.QUEUE_NAME, no_ack=True) self.htts = htts() self.play = play() self.cache = cache()
def __init__(self): root = logging.getLogger() root.setLevel(logging.DEBUG) ch = logging.StreamHandler(sys.stdout) ch.setLevel(logging.DEBUG) handler = logging.FileHandler('logs/recordVoiceService.log') handler.setLevel(logging.INFO) root.addHandler(ch) root.addHandler(handler) self.record = record() self.queue = queue() self.channel = self.queue.createChannel() #self.channel.queue_declare(queue=self.QUEUE_NAME) # todo delete record folder self.deletePreviousRecords()
def __init__(self): setLogger('dialogFlowService') dotenv_path = '.env' load_dotenv(dotenv_path) os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = os.getenv( 'GOOGLE_APPLICATION_CREDENTIALS') self.queue = queue() self.channel = self.queue.createChannel() self.channel.queue_declare(queue=self.QUEUE_NAME) self.channel.basic_consume(self.callback, queue=self.QUEUE_NAME, no_ack=True) self.dialogflow = dialogflow() self.sessionLast = datetime.now() self.sessionId = str(uuid.uuid4())
def __init__(self): setLogger('translateService') dotenv_path = '.env' load_dotenv(dotenv_path) os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = os.getenv('GOOGLE_APPLICATION_CREDENTIALS') self.queue = queue() self.channel = self.queue.createChannel() self.channel.queue_declare(queue=self.QUEUE_NAME_H2E) self.channel.queue_declare(queue=self.QUEUE_NAME_E2H) self.channel.basic_consume(self.callback_h2e, queue=self.QUEUE_NAME_H2E, no_ack=True) self.channel.basic_consume(self.callback_e2h, queue=self.QUEUE_NAME_E2H, no_ack=True) self.translate = translate() self.cache = cache()
def __init__(self): setLogger('cameraService') self.queue = queue() self.channel = self.queue.createChannel() self.recognizer = cv2.face.LBPHFaceRecognizer_create() self.recognizer.read('resources/trainer/trainer.yml') cascadePath = "resources/haarcascade_frontalface_default.xml" self.faceCascade = cv2.CascadeClassifier(cascadePath); self.font = cv2.FONT_HERSHEY_SIMPLEX self.id = 0 # names related to ids: example ==> Marcelo: id=1, etc self.names = ['None', 'Amir', 'Anat', 'Ety', 'Ofek', 'Staav','Gefen'] # Initialize and start realtime video capture self.cam = cv2.VideoCapture(0) self.cam.set(3, 640) # set video widht self.cam.set(4, 480) # set video height # Define min window size to be recognized as a face self.minW = 0.1*self.cam.get(3) self.minH = 0.1*self.cam.get(4)
def get(self, text): uni_text = text.encode('utf-8') print(uni_text) self.queue = queue() channel = self.queue.createChannel() channel.basic_publish(self.EXCHANGE_NAME, self.QUEUE_NAME, uni_text)
def get(self, command): print(command) self.queue = queue() channel = self.queue.createChannel() channel.basic_publish(self.EXCHANGE_NAME, self.QUEUE_NAME, command)