From ae1def1cc695129c7aff793ad3ee31b19c637b12 Mon Sep 17 00:00:00 2001 From: "Eric.Lee" Date: Fri, 15 Apr 2022 01:44:55 +0800 Subject: [PATCH] update read data --- read_datasets.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/read_datasets.py b/read_datasets.py index cc17e29..dde9f47 100644 --- a/read_datasets.py +++ b/read_datasets.py @@ -10,7 +10,7 @@ from hand_data_iter.datasets import plot_box,draw_bd_handpose import random if __name__ == "__main__": - path = "./handpose_datasets/" + path = "./handpose_datasets_v2/" for f_ in os.listdir(path): if ".jpg" in f_: @@ -30,10 +30,16 @@ if __name__ == "__main__": for msg in hand_dict_: bbox = msg["bbox"] pts = msg["pts"] - print() + hand_str = "hand" + if "handType" in msg.keys(): + hand_str = "hand" + msg["handType"] + "_v2" + cv2.putText(img_, hand_str, (5,35),cv2.FONT_HERSHEY_DUPLEX, 1.0, (55, 0, 220),5) + cv2.putText(img_, hand_str, (5,35),cv2.FONT_HERSHEY_DUPLEX, 1.0, (255, 50, 50),2) + + print(bbox) RGB = (random.randint(50,255),random.randint(50,255),random.randint(50,255)) - plot_box(bbox, img_, color=(RGB), label="hand", line_thickness=3) + plot_box(bbox, img_, color=(RGB), label=hand_str, line_thickness=3) draw_bd_handpose(img_,pts,bbox[0],bbox[1]) for k_ in pts.keys(): @@ -41,4 +47,4 @@ if __name__ == "__main__": cv2.namedWindow("HandPose_Json",0) cv2.imshow("HandPose_Json",img_) - cv2.waitKey(0) + cv2.waitKey(1) -- GitLab