def main(self): """ :return: """ while True: data = time.time() data = ray.put(data) if self.wait: pype.push_wait(self.server, self.output_queues[0]) self.server.push.remote(data, self.output_queues)
def main(self): """ :return: """ size = (int(self.camera_width * self.scale), int(self.camera_height * self.scale)) while True: ret, frame = self.video_data.read() if ret: frame = cv2.resize(frame, size) data = { "frame": frame, "time": '{}_{}'.format(time.ctime(), time.time()), "stream_name": self.stream_name } data = ray.put(data) if ret is True: if self.wait: pype.push_wait(self.server, self.output_queues[0]) self.server.push.remote(data, self.output_queues) else: break
def f(server, input_name, output_name): while True: pype.pull_wait(server, input_name) data = ray.get(server.pull.remote(input_name))[0] pype.push_wait(server, output_name) server.push.remote(data, output_name)
def start(server, output_name): n_data = 10000 data = np.random.randint(0, 10, (n_data)) for i in range(100): pype.push_wait(server, output_name) server.push.remote(data, output_name)