handpose_datasets_v2 数据集发布

handpose_datasets_v2 数据集发布

开源项目相关地址

https://gitcode.net/EricLee/handpose_x

  • 兼容数据集 handpose_datasets_v1,增加左右手属性"handType": “Left” or “Right”,具体参看项目v2数据集示例。
  • handpose_datasets_v2 数据总量为 38w+。
注意:
 1> 该数据集包括网络图片进行制作(如有侵权请联系删除),
 2> 项目使用该数据集请注明出处:
     项目:https://gitcode.net/EricLee/handpose_x
     作者:Eric.Lee
  • handpose_datasets_v2 例子如下图:
    请添加图片描述

  • 数据集读取脚本为:read_datasets.py,并需要相应更改脚本中的数据集路径。

#-*-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_v2/"

    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"]
                    hand_str = "hand"
                    if "handType" in msg.keys():
                        hand_str = "hand" + msg["handType"] + "_v2"
                        cv2.putText(img_, hand_str, (2,25),cv2.FONT_HERSHEY_DUPLEX, 0.8, (55, 0, 220),5)
                        cv2.putText(img_, hand_str, (2,25),cv2.FONT_HERSHEY_DUPLEX, 0.8, (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_str, 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)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值