def run(self): self.face_recognition = face.Recognition() #self.srgan = LHSRGAN() self.srgan = LHFSRGAN() self.q.put(os.getpid()) self.thread_state = True while self.thread_state: msg = self.yoloq.get() #print(len(msg)) print("FaceRecognition~~~~~~~~~~~~~~~~~~~~~%d" % (self.yoloq.qsize())) self.yoloMsgProc(msg)
def sigint_handler(signum, frame): print("main-thread exit") global subs global publish publish.stop() subs.stop() sys.exit() if __name__ == '__main__': signal.signal(signal.SIGINT, sigint_handler) subs = FaceSubscriber("tcp://127.0.0.1:12347") subs.start() publish = FacePublisher("tcp://127.0.0.1:12354") publish.start() face_recognition = face.Recognition() # srgan = LHSRGAN() srgan = LHFSRGAN() thed = 0.6 facemsg = publish.facemsg path_exp = os.path.expanduser('./samples') classes = [path for path in os.listdir(path_exp) \ if os.path.isdir(os.path.join(path_exp, path))] classes.sort() nrof_classes = len(classes) while True: i = random.randint(0, nrof_classes - 1) class_name = classes[i] facedir = os.path.join(path_exp, class_name)
def __init__(self, recoq, faceq): Process.__init__(self) self.face_recognition = face.Recognition() self.state = True self.recoq = recoq self.faceq = faceq