当前位置: 首页 > news >正文

160 国际英文网站武汉网优化seo公司

160 国际英文网站,武汉网优化seo公司,北京教育云平台网站建设,上海网站制作公司怎么找DataBall 助力快速掌握数据集的信息和使用方式,会员享有 百种数据集,持续增加中。 需要更多数据资源和技术解决方案,知识星球: “DataBall - X 数据球(free)” 贵在坚持! ---------------------------------------…

DataBall 助力快速掌握数据集的信息和使用方式,会员享有 百种数据集,持续增加中。 

需要更多数据资源和技术解决方案,知识星球: “DataBall - X 数据球(free)”

贵在坚持!

----------------------------------------------------------------

注意:

1)为了方便使用,按照 handposeX json 自定义格式存储

2)使用常见依赖库进行调用,降低数据集使用难度。

3)部分数据集获取请加入:DataBall-X数据球(free)

4)完整数据集获取请加入:DataBall-X数据球(vip)

InterHand26M 数据集官方项目地址:InterHand2.6M dataset | InterHand2.6M

handposeX-json 格式 项目地址: https://github.com/XIAN-HHappy/handpose_x_plus

1、 handposeX json 格式

cx,cy,fx,fy为相机内参。

label:左右手标签

joint3d:三维手部21关键点

vertex3d:三维手mesh网格点

{"author": "XIAN","img_name:": "","cx": 112.0,"cy": 112.0,"fx": 388.9018310596544,"fy": 388.71231836584275,"hands": [{"label": "right","joint3d": [[29.402047395706177,-27.920207008719444,587.0807766914368],······],"vertex3d": [[10.056010007858276,29.915300235152245,-626.9440693855286],······]}]
}

2、脚本运行

# 下载 handposeX json 格式数据集放在根目录
cd script/InterHand26M
python read_InterHand26M.py

read_InterHand26M.py 具体实现如下:

#-*-coding:utf-8-*-
# date:2025-03-02
# Author: XIAN
# function: handposeX json 格式读取数据标签import sys
sys.path.append("./")
import os
import cv2
import json
import numpy as np
import random
from pathlib import Path
import re
'''
function: 绘制二维关键点连线
'''
def draw_joints(img_,hand_,x,y):thick = 2colors = [(0,215,255),(255,115,55),(5,255,55),(25,15,255),(225,15,55)]#cv2.line(img_, (int(hand_['0']['x']+x), int(hand_['0']['y']+y)),(int(hand_['1']['x']+x), int(hand_['1']['y']+y)), colors[0], thick)cv2.line(img_, (int(hand_['1']['x']+x), int(hand_['1']['y']+y)),(int(hand_['2']['x']+x), int(hand_['2']['y']+y)), colors[0], thick)cv2.line(img_, (int(hand_['2']['x']+x), int(hand_['2']['y']+y)),(int(hand_['3']['x']+x), int(hand_['3']['y']+y)), colors[0], thick)cv2.line(img_, (int(hand_['3']['x']+x), int(hand_['3']['y']+y)),(int(hand_['4']['x']+x), int(hand_['4']['y']+y)), colors[0], thick)cv2.line(img_, (int(hand_['0']['x']+x), int(hand_['0']['y']+y)),(int(hand_['5']['x']+x), int(hand_['5']['y']+y)), colors[1], thick)cv2.line(img_, (int(hand_['5']['x']+x), int(hand_['5']['y']+y)),(int(hand_['6']['x']+x), int(hand_['6']['y']+y)), colors[1], thick)cv2.line(img_, (int(hand_['6']['x']+x), int(hand_['6']['y']+y)),(int(hand_['7']['x']+x), int(hand_['7']['y']+y)), colors[1], thick)cv2.line(img_, (int(hand_['7']['x']+x), int(hand_['7']['y']+y)),(int(hand_['8']['x']+x), int(hand_['8']['y']+y)), colors[1], thick)cv2.line(img_, (int(hand_['0']['x']+x), int(hand_['0']['y']+y)),(int(hand_['9']['x']+x), int(hand_['9']['y']+y)), colors[2], thick)cv2.line(img_, (int(hand_['9']['x']+x), int(hand_['9']['y']+y)),(int(hand_['10']['x']+x), int(hand_['10']['y']+y)), colors[2], thick)cv2.line(img_, (int(hand_['10']['x']+x), int(hand_['10']['y']+y)),(int(hand_['11']['x']+x), int(hand_['11']['y']+y)), colors[2], thick)cv2.line(img_, (int(hand_['11']['x']+x), int(hand_['11']['y']+y)),(int(hand_['12']['x']+x), int(hand_['12']['y']+y)), colors[2], thick)cv2.line(img_, (int(hand_['0']['x']+x), int(hand_['0']['y']+y)),(int(hand_['13']['x']+x), int(hand_['13']['y']+y)), colors[3], thick)cv2.line(img_, (int(hand_['13']['x']+x), int(hand_['13']['y']+y)),(int(hand_['14']['x']+x), int(hand_['14']['y']+y)), colors[3], thick)cv2.line(img_, (int(hand_['14']['x']+x), int(hand_['14']['y']+y)),(int(hand_['15']['x']+x), int(hand_['15']['y']+y)), colors[3], thick)cv2.line(img_, (int(hand_['15']['x']+x), int(hand_['15']['y']+y)),(int(hand_['16']['x']+x), int(hand_['16']['y']+y)), colors[3], thick)cv2.line(img_, (int(hand_['0']['x']+x), int(hand_['0']['y']+y)),(int(hand_['17']['x']+x), int(hand_['17']['y']+y)), colors[4], thick)cv2.line(img_, (int(hand_['17']['x']+x), int(hand_['17']['y']+y)),(int(hand_['18']['x']+x), int(hand_['18']['y']+y)), colors[4], thick)cv2.line(img_, (int(hand_['18']['x']+x), int(hand_['18']['y']+y)),(int(hand_['19']['x']+x), int(hand_['19']['y']+y)), colors[4], thick)cv2.line(img_, (int(hand_['19']['x']+x), int(hand_['19']['y']+y)),(int(hand_['20']['x']+x), int(hand_['20']['y']+y)), colors[4], thick)
'''
function: 21个三维关键点转为二维点,并进行绘制
'''
def Draw_KeyPoints3D(img,Joints_,fx,fy,cx,cy):#----------------------------------- 计算 3D到 2D相机的投影X = Joints_[:,0]Y = Joints_[:,1]Z = Joints_[:,2]x_p = X / Zy_p = Y / Z#三维点转为二维点x_2d = fx* x_p + cxy_2d = fy* y_p + cypts2d_list = {}pts2d_ss = []for ii in range(x_2d.shape[0]):x_,y_ = x_2d[ii],y_2d[ii]pts2d_list[str(ii)]={"x":x_,"y":y_}cv2.circle(img, (int(x_),int(y_)), 4, (25,155,255), -1)cv2.circle(img, (int(x_),int(y_)), 2, (255,0,55), -1)pts2d_ss.append((x_,y_))draw_joints(img,pts2d_list,0,0)pts2d_ss = np.array(pts2d_ss)return pts2d_ss
def letterbox(img, height=416, augment=False, color=(266,255,255)):# Resize a rectangular image to a padded squareshape = img.shape[:2]  # shape = [height, width]ratio = float(height) / max(shape)  # ratio  = old / newnew_shape = (round(shape[1] * ratio), round(shape[0] * ratio))dw = (height - new_shape[0]) / 2  # width paddingdh = (height - new_shape[1]) / 2  # height paddingtop, bottom = round(dh - 0.1), round(dh + 0.1)left, right = round(dw - 0.1), round(dw + 0.1)# resize imgif augment:interpolation = np.random.choice([None, cv2.INTER_NEAREST, cv2.INTER_LINEAR,None, cv2.INTER_NEAREST, cv2.INTER_LINEAR,cv2.INTER_AREA, cv2.INTER_CUBIC, cv2.INTER_LANCZOS4])if interpolation is None:img = cv2.resize(img, new_shape)else:img = cv2.resize(img, new_shape, interpolation=interpolation)else:img = cv2.resize(img, new_shape, interpolation=cv2.INTER_NEAREST)# print("resize time:",time.time()-s1)img = cv2.copyMakeBorder(img, top, bottom, left, right, cv2.BORDER_CONSTANT, value=color)  # padded squarereturn img
def Draw_Vertex_KeyPoints(img,img_mesh,Vertex,fx_d,fy_d,cx_d,cy_d,triangles_index,RGB_ = (245, 125, 35)):#----------------------------------- 计算 Mano 到 相机的投影Xdc = -Vertex[:,0].reshape(-1)Ydc = -Vertex[:,1].reshape(-1)Zdc = -Vertex[:,2].reshape(-1)x_mano_p = Xdc / Zdcy_mano_p = Ydc / Zdc#点云转为二维图x_mano = fx_d* x_mano_p + cx_dy_mano = fy_d* y_mano_p + cy_dmanopts_list = []mesh_list = []color_rr = (random.randint(100,230),random.randint(120,250),random.randint(100,240))for ii in range(triangles_index.shape[0]):a,b,c = triangles_index[ii]x1_,y1_ = x_mano[a].astype(np.int32),y_mano[a].astype(np.int32)x2_,y2_ = x_mano[b].astype(np.int32),y_mano[b].astype(np.int32)x3_,y3_ = x_mano[c].astype(np.int32),y_mano[c].astype(np.int32)area_ = np.array([[int(x1_), int(y1_)], [int(x2_), int(y2_)], [int(x3_),int(y3_)]])color_ = (255, 0, 0)# cv2.fillPoly(mask_v, [area_], (255))cv2.fillPoly(img_mesh, [area_], color_rr)mesh_list.append(area_)cv2.fillPoly(img, mesh_list, RGB_)def find_jpg_files(root_folder):root_path = Path(root_folder)jpg_files = list(root_path.rglob('*.jpg'))  # rglob递归查找return jpg_files
if __name__ == '__main__':root_folder = '../../InterHand2.6M_5fps_batch1-20250302-min/'jpg_files = find_jpg_files(root_folder)path_data = []for path in jpg_files:path_str = str(path)# print(path)# print(type(path))path_img = path_str.replace("\\","/")path_json = re.sub(r"(cam\d+)", r"\1_label", path_img)path_json = path_json.replace(".jpg",".json")if not os.access(path_json,os.F_OK):continue# print(path_img)# print(path_label)path_data.append((path_img,path_json))triangles_index = np.load("../../config/triangles_index.npy").reshape(-1,3)out_cnt = 0hand_cnt = 0for (path_img,path_json) in path_data:if not os.access(path_json,os.F_OK):continuetry:with open(path_json, 'r', encoding='utf-8') as file:data_json = json.load(file)except:print("error ")os.remove(path_img)os.remove(path_json)continuehands_json = data_json["hands"]cx,cy,fx,fy = data_json["cx"],data_json["cy"],data_json["fx"],data_json["fy"]img_ = cv2.imread(path_img)img_joint = img_.copy()img_mesh = img_.copy()img_mask = np.zeros(img_.shape).astype(np.uint8)img_mask[:,:,:]=255for msg_ in hands_json:RGB_ = (245, 55, 133)if msg_["label"] == "left":RGB_ = (25, 255, 133)Joints3D = np.array(msg_["joint3d"])Vertex3D = np.array(msg_["vertex3d"])pts2d_ss = Draw_KeyPoints3D(img_joint,Joints3D,fx,fy,cx,cy)Draw_Vertex_KeyPoints(img_mesh,img_mask,Vertex3D,fx,fy,cx,cy,triangles_index,RGB_ = RGB_)hand_cnt += 1stk_1 = np.hstack((img_,img_joint))stk_2 = np.hstack((img_mesh,img_mask))stk_ = np.vstack((stk_1,stk_2))cv2.namedWindow("img_stk",0)cv2.imshow("img_stk",stk_)# cv2.imwrite("example.jpg",stk_)out_cnt += 1print("---->>> InterHand26M [{}] , hand_num: [{}]".format(out_cnt,hand_cnt))key_id = cv2.waitKey(1)if key_id == 27:break

 

助力快速掌握数据集的信息和使用方式。

数据可以如此美好!

http://www.mmbaike.com/news/107916.html

相关文章:

  • 金华竞价排名 金华企业网站建设搜索引擎优化的技巧有哪些
  • 做亚马逊外国网站需要语言好吗贴吧aso优化贴吧
  • 如何做国外外贸网站衡阳网站优化公司
  • 深圳商城网站设计价格北京百度公司地址在哪里
  • 网页设计实训报告小结优化关键词排名哪家好
  • 天津网站设计与制作面点培训学校哪里有
  • 软件项目外包网站郑州做网站推广电话
  • wordpress登录密码忘记了深圳seo优化seo优化
  • 个人网站设计总结爱站网为什么不能用了
  • 钢管网站建设山西免费网站关键词优化排名
  • 做网站的等级保护要多少钱全网整合营销外包
  • 做机器设备的网站网上打广告有哪些软件
  • 织梦网站去除技术支持市场营销培训课程
  • 建设工程施工合同网站企业网站排名优化
  • 做网站送优化重庆seo排名
  • 建立网站站建设可以吗免费域名申请网站大全
  • wordpress ftp 密码忘记什么叫seo优化
  • 网站建设课程设计实训心得站长权重
  • 商标设计网站免费西安百度关键词包年
  • wordpress离线编辑长春seo排名扣费
  • 想通过做威客网站上的任务来赚关键词优化推广
  • 免费建网站软件下载手机营销案例100例小故事
  • 手机wap网站开发seo外链
  • 惠州网站营销推广福州百度网站快速优化
  • 做a的视频在线观看网站百度seo正规优化
  • 阿里云服务器开源做几个网站网站广告投放收费标准
  • 做更好的自己 网站江苏网页定制
  • 网站客服电话下载百度免费
  • 网站建设海报泉州关键词搜索排名
  • 大学生创新项目申报书 做网站广州搜索seo网站优化