diff --git a/handpose_datasets/2021-02-01_13-52-49_284.jpg b/handpose_datasets/2021-02-01_13-52-49_284.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4ecb400e6c650ee2fcaff31f5dff5c501f6119b2 Binary files /dev/null and b/handpose_datasets/2021-02-01_13-52-49_284.jpg differ diff --git a/handpose_datasets/2021-02-01_13-52-49_284.json b/handpose_datasets/2021-02-01_13-52-49_284.json new file mode 100644 index 0000000000000000000000000000000000000000..3bdcfba8ed02d503bc64586bcc7775cf87f9406f --- /dev/null +++ b/handpose_datasets/2021-02-01_13-52-49_284.json @@ -0,0 +1,100 @@ +{ + "maker": "Eric.Lee", + "date": "2021-02-01", + "info": [ + { + "bbox": [ + 0.0, + 0.0, + 0.0, + 0.0 + ], + "pts": { + "0": { + "x": 69, + "y": 120 + }, + "1": { + "x": 49, + "y": 113 + }, + "2": { + "x": 36, + "y": 100 + }, + "3": { + "x": 27, + "y": 90 + }, + "4": { + "x": 22, + "y": 79 + }, + "5": { + "x": 47, + "y": 78 + }, + "6": { + "x": 42, + "y": 68 + }, + "7": { + "x": 37, + "y": 59 + }, + "8": { + "x": 34, + "y": 51 + }, + "9": { + "x": 58, + "y": 78 + }, + "10": { + "x": 53, + "y": 66 + }, + "11": { + "x": 49, + "y": 54 + }, + "12": { + "x": 46, + "y": 44 + }, + "13": { + "x": 66, + "y": 81 + }, + "14": { + "x": 64, + "y": 69 + }, + "15": { + "x": 63, + "y": 58 + }, + "16": { + "x": 61, + "y": 47 + }, + "17": { + "x": 74, + "y": 86 + }, + "18": { + "x": 76, + "y": 78 + }, + "19": { + "x": 78, + "y": 71 + }, + "20": { + "x": 80, + "y": 63 + } + } + } + ] +} \ No newline at end of file diff --git a/handpose_datasets/2021-02-01_13-52-50_378.jpg b/handpose_datasets/2021-02-01_13-52-50_378.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4504dd88985515e3e0e4971804ea83714914d39e Binary files /dev/null and b/handpose_datasets/2021-02-01_13-52-50_378.jpg differ diff --git a/handpose_datasets/2021-02-01_13-52-50_378.json b/handpose_datasets/2021-02-01_13-52-50_378.json new file mode 100644 index 0000000000000000000000000000000000000000..89209becb44dc79ccffb9b57b75ab66b871b0623 --- /dev/null +++ b/handpose_datasets/2021-02-01_13-52-50_378.json @@ -0,0 +1,100 @@ +{ + "maker": "Eric.Lee", + "date": "2021-02-01", + "info": [ + { + "bbox": [ + 0.0, + 0.0, + 0.0, + 0.0 + ], + "pts": { + "0": { + "x": 62, + "y": 52 + }, + "1": { + "x": 40, + "y": 64 + }, + "2": { + "x": 31, + "y": 78 + }, + "3": { + "x": 24, + "y": 90 + }, + "4": { + "x": 17, + "y": 104 + }, + "5": { + "x": 29, + "y": 90 + }, + "6": { + "x": 24, + "y": 106 + }, + "7": { + "x": 19, + "y": 120 + }, + "8": { + "x": 17, + "y": 132 + }, + "9": { + "x": 40, + "y": 95 + }, + "10": { + "x": 36, + "y": 113 + }, + "11": { + "x": 36, + "y": 127 + }, + "12": { + "x": 33, + "y": 139 + }, + "13": { + "x": 52, + "y": 95 + }, + "14": { + "x": 48, + "y": 113 + }, + "15": { + "x": 48, + "y": 125 + }, + "16": { + "x": 43, + "y": 137 + }, + "17": { + "x": 64, + "y": 95 + }, + "18": { + "x": 62, + "y": 109 + }, + "19": { + "x": 59, + "y": 118 + }, + "20": { + "x": 55, + "y": 127 + } + } + } + ] +} \ No newline at end of file diff --git a/handpose_datasets/2021-02-01_13-52-53_532.jpg b/handpose_datasets/2021-02-01_13-52-53_532.jpg new file mode 100644 index 0000000000000000000000000000000000000000..33eadbe360913feb41a2b13fdf8ab973ac7abdb3 Binary files /dev/null and b/handpose_datasets/2021-02-01_13-52-53_532.jpg differ diff --git a/handpose_datasets/2021-02-01_13-52-53_532.json b/handpose_datasets/2021-02-01_13-52-53_532.json new file mode 100644 index 0000000000000000000000000000000000000000..77b50b5533fe28d866fd57aaf9dea8432857cd30 --- /dev/null +++ b/handpose_datasets/2021-02-01_13-52-53_532.json @@ -0,0 +1,100 @@ +{ + "maker": "Eric.Lee", + "date": "2021-02-01", + "info": [ + { + "bbox": [ + 0.0, + 0.0, + 0.0, + 0.0 + ], + "pts": { + "0": { + "x": 127, + "y": 69 + }, + "1": { + "x": 95, + "y": 141 + }, + "2": { + "x": 87, + "y": 189 + }, + "3": { + "x": 103, + "y": 252 + }, + "4": { + "x": 111, + "y": 284 + }, + "5": { + "x": 55, + "y": 229 + }, + "6": { + "x": 47, + "y": 316 + }, + "7": { + "x": 47, + "y": 364 + }, + "8": { + "x": 55, + "y": 396 + }, + "9": { + "x": 79, + "y": 236 + }, + "10": { + "x": 111, + "y": 324 + }, + "11": { + "x": 150, + "y": 364 + }, + "12": { + "x": 190, + "y": 380 + }, + "13": { + "x": 119, + "y": 229 + }, + "14": { + "x": 142, + "y": 308 + }, + "15": { + "x": 174, + "y": 340 + }, + "16": { + "x": 206, + "y": 364 + }, + "17": { + "x": 150, + "y": 221 + }, + "18": { + "x": 166, + "y": 276 + }, + "19": { + "x": 182, + "y": 300 + }, + "20": { + "x": 206, + "y": 332 + } + } + } + ] +} \ No newline at end of file diff --git a/handpose_datasets/2021-02-01_13-52-55_721.jpg b/handpose_datasets/2021-02-01_13-52-55_721.jpg new file mode 100644 index 0000000000000000000000000000000000000000..184042fbb0ec23a3249ee56de61a51430b3fe25f Binary files /dev/null and b/handpose_datasets/2021-02-01_13-52-55_721.jpg differ diff --git a/handpose_datasets/2021-02-01_13-52-55_721.json b/handpose_datasets/2021-02-01_13-52-55_721.json new file mode 100644 index 0000000000000000000000000000000000000000..a64acce7731f3f87fb28bd119694e2fcc266beed --- /dev/null +++ b/handpose_datasets/2021-02-01_13-52-55_721.json @@ -0,0 +1,100 @@ +{ + "maker": "Eric.Lee", + "date": "2021-02-01", + "info": [ + { + "bbox": [ + 0.0, + 0.0, + 0.0, + 0.0 + ], + "pts": { + "0": { + "x": 32, + "y": 117 + }, + "1": { + "x": 46, + "y": 117 + }, + "2": { + "x": 61, + "y": 111 + }, + "3": { + "x": 79, + "y": 113 + }, + "4": { + "x": 96, + "y": 117 + }, + "5": { + "x": 57, + "y": 76 + }, + "6": { + "x": 67, + "y": 66 + }, + "7": { + "x": 77, + "y": 61 + }, + "8": { + "x": 90, + "y": 59 + }, + "9": { + "x": 46, + "y": 68 + }, + "10": { + "x": 53, + "y": 53 + }, + "11": { + "x": 63, + "y": 43 + }, + "12": { + "x": 71, + "y": 33 + }, + "13": { + "x": 32, + "y": 66 + }, + "14": { + "x": 32, + "y": 53 + }, + "15": { + "x": 36, + "y": 41 + }, + "16": { + "x": 42, + "y": 28 + }, + "17": { + "x": 24, + "y": 74 + }, + "18": { + "x": 18, + "y": 64 + }, + "19": { + "x": 15, + "y": 55 + }, + "20": { + "x": 20, + "y": 43 + } + } + } + ] +} \ No newline at end of file diff --git a/handpose_datasets/2021-02-01_13-52-59_987.jpg b/handpose_datasets/2021-02-01_13-52-59_987.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5491038f761e66a4d05d8e24aff62e94712d5a3c Binary files /dev/null and b/handpose_datasets/2021-02-01_13-52-59_987.jpg differ diff --git a/handpose_datasets/2021-02-01_13-52-59_987.json b/handpose_datasets/2021-02-01_13-52-59_987.json new file mode 100644 index 0000000000000000000000000000000000000000..e17758ad58768bb09cfba1bd977692bf68b74d23 --- /dev/null +++ b/handpose_datasets/2021-02-01_13-52-59_987.json @@ -0,0 +1,100 @@ +{ + "maker": "Eric.Lee", + "date": "2021-02-01", + "info": [ + { + "bbox": [ + 0.0, + 0.0, + 0.0, + 0.0 + ], + "pts": { + "0": { + "x": 6, + "y": 94 + }, + "1": { + "x": 21, + "y": 65 + }, + "2": { + "x": 35, + "y": 53 + }, + "3": { + "x": 42, + "y": 40 + }, + "4": { + "x": 50, + "y": 32 + }, + "5": { + "x": 68, + "y": 63 + }, + "6": { + "x": 60, + "y": 36 + }, + "7": { + "x": 39, + "y": 40 + }, + "8": { + "x": 27, + "y": 47 + }, + "9": { + "x": 64, + "y": 75 + }, + "10": { + "x": 50, + "y": 45 + }, + "11": { + "x": 27, + "y": 53 + }, + "12": { + "x": 29, + "y": 61 + }, + "13": { + "x": 56, + "y": 84 + }, + "14": { + "x": 40, + "y": 61 + }, + "15": { + "x": 25, + "y": 67 + }, + "16": { + "x": 29, + "y": 75 + }, + "17": { + "x": 46, + "y": 94 + }, + "18": { + "x": 31, + "y": 76 + }, + "19": { + "x": 19, + "y": 80 + }, + "20": { + "x": 29, + "y": 88 + } + } + } + ] +} \ No newline at end of file diff --git a/read_datasets.py b/read_datasets.py new file mode 100644 index 0000000000000000000000000000000000000000..cc17e2938d57ec7a503e26057fdda1d381669b98 --- /dev/null +++ b/read_datasets.py @@ -0,0 +1,44 @@ +#-*-coding:utf-8-*- +# date:2021-12-20 +# Author: Eric.Lee +## function: read datasets example + +import os +import json +import cv2 +from hand_data_iter.datasets import plot_box,draw_bd_handpose +import random + +if __name__ == "__main__": + path = "./handpose_datasets/" + + for f_ in os.listdir(path): + if ".jpg" in f_: + img_path = path +f_ + label_path = img_path.replace('.jpg','.json') + if not os.path.exists(label_path): + continue + img_ = cv2.imread(img_path) + + f = open(label_path, encoding='utf-8')#读取 json文件 + hand_dict_ = json.load(f) + f.close() + + hand_dict_ = hand_dict_["info"] + print("len hand_dict :",len(hand_dict_)) + if len(hand_dict_)>0: + for msg in hand_dict_: + bbox = msg["bbox"] + pts = msg["pts"] + print() + 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) + draw_bd_handpose(img_,pts,bbox[0],bbox[1]) + + for k_ in pts.keys(): + cv2.circle(img_, (int(pts[k_]['x']+bbox[0]),int(pts[k_]['y']+bbox[1])), 3, (255,50,155),-1) + + cv2.namedWindow("HandPose_Json",0) + cv2.imshow("HandPose_Json",img_) + cv2.waitKey(0)