From 2ad050ad1d9255ddf2ba2b2daed309d365255aaa Mon Sep 17 00:00:00 2001 From: willgraf <7930703+willgraf@users.noreply.github.com> Date: Sat, 3 Aug 2019 12:47:08 -0700 Subject: [PATCH] bugfix: Check if prediction output is list or np.array (#49) --- redis_consumer/consumers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/redis_consumer/consumers.py b/redis_consumer/consumers.py index aea448df..84bd1a44 100644 --- a/redis_consumer/consumers.py +++ b/redis_consumer/consumers.py @@ -602,7 +602,10 @@ def _consume(self, redis_hash): post_funcs = hvals.get('postprocess_function', '').split(',') # image[:-1] is targeted at a two semantic head panoptic model # TODO This may need to be modified and generalized in the future - image = self.postprocess(image[:-1], post_funcs, True) + if isinstance(image, list): + image = self.postprocess(image[:-1], post_funcs, True) + else: + image = self.postprocess(image, post_funcs, True) # Save the post-processed results to a file _ = timeit.default_timer()