From 86b26eda20fd91b59529400ceeb6a4d34dfcb02d Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Tue, 27 Jul 2021 08:26:55 +0300 Subject: [PATCH] [~] Refactor --- python/tasks/mlb_player.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/python/tasks/mlb_player.py b/python/tasks/mlb_player.py index 8847ce4..436e846 100644 --- a/python/tasks/mlb_player.py +++ b/python/tasks/mlb_player.py @@ -1350,7 +1350,13 @@ def kernel_20(o_18): (77, 255, 222), (77, 196, 255), (77, 135, 255), (191, 255, 77), (77, 255, 77), (77, 222, 255), (255, 156, 127), (0, 127, 255), (255, 127, 77), (0, 77, 255), (255, 77, 36)] - t1 = o_18['t2']['t7'][0]['keypoints'] + t1 = numpy.array(o_18['t2']['t7'][0]['keypoints']).reshape(17, -1) t2 = o_18['t2']['t6'][0] - t3 = o_18['t2']['t1'][0]['image_canvas'] + t3 = o_18['t2']['t1'][0]['image_canvas'].copy() assert o_18['t2']['t7'][0]['image_id'] == os.path.split(o_18['t2']['t1'][0]['image_name'])[1] + + for i, o2 in enumerate(p_color): + o1 = t1[i, :] + cv2.circle(t3, tuple(o1[:2]), 3, o2, -1) + cv2.imwrite('output.jpg', cv2.cvtColor(t3, cv2.COLOR_RGB2BGR)) + cv2.imwrite('output-v2.jpg', cv2.cvtColor(t2, cv2.COLOR_RGB2BGR))