def test_threaded_streamer(self): streamer = ThreadedStreamer(self.vision_model.batch_prediction, batch_size=8) single_predict = streamer.predict(self.input_batch) assert single_predict == self.single_output batch_predict = streamer.predict(self.input_batch * BATCH_SIZE) assert batch_predict == self.batch_output
def test_threaded_streamer(): streamer = ThreadedStreamer(vision_model.batch_prediction, batch_size=16) output_raw = vision_model.batch_prediction(input_batch) output = streamer.predict(input_batch) assert output_raw == output outputs_raw = vision_model.batch_prediction(input_batch * 55) outputs = streamer.predict(input_batch * 55) assert outputs_raw == outputs