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

FreiHAND (handposeX-json 格式)数据集-release >> DataBall

FreiHAND (handposeX-json 格式)数据集-release

注意:

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

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

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

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

FreiHAND 数据集官方项目地址:https://github.com/lmb-freiburg/freihand

handposeX-json 格式 项目地址:GitHub - XIAN-HHappy/handpose_x_plus

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

一、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],······]}]}

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

二、脚本运行

cd script/FreiHANDpython read_handposex_json.py

read_handposex_json.py具体实现如下,简洁明了:

#-*-coding:utf-8-*-
# date:2024-02-23
# Author: XIAN
# function: handposeX json 格式读取数据标签
import sys
sys.path.append("./")
import os
import cv2
import json
import numpy as np
import random
'''
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_ssdef 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_)
if __name__ == '__main__':path_root = "datasets/"path_s_image = "{}/image/".format(path_root)path_s_label = "{}/label/".format(path_root)triangles_index = np.load("../../config/triangles_index.npy").reshape(-1,3)out_cnt = 0hand_cnt = 0for f_ in os.listdir(path_s_image):path_img = path_s_image + f_path_json = path_s_label + f_.replace(".jpg",".json")with open(path_json, 'r', encoding='utf-8') as file:data_json = json.load(file)hands_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_)out_cnt += 1print("--------->>>imgs_num : [{}] , hands_num: [{}]".format(out_cnt,hand_cnt))key_id = cv2.waitKey(0)cv2.imwrite("f1.jpg",stk_)if key_id == 27:break

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

数据可以如此美好!

相关文章:

FreiHAND (handposeX-json 格式)数据集-release >> DataBall

FreiHAND (handposeX-json 格式)数据集-release 注意: 1)为了方便使用,按照 handposeX json 自定义格式存储 2)使用常见依赖库进行调用,降低数据集使用难度。 3)部分数据集获取请加入:DataBall-X数据球(free) 4)完…...

【Rust中级教程】2.8. API设计原则之灵活性(flexible) Pt.4:显式析构函数的问题及3种解决方案

喜欢的话别忘了点赞、收藏加关注哦(加关注即可阅读全文),对接下来的教程有兴趣的可以关注专栏。谢谢喵!(・ω・) 说句题外话,这篇文章一共5721个字,是我截至目前写的最长的一篇文章&a…...

LabVIEW Browser.vi 库说明

browser.llb 库位于C:\Program Files (x86)\National Instruments\LabVIEW 2019\vi.lib\Platform目录,它是 LabVIEW 平台下用于与网络浏览器相关操作的重要库。该库为 LabVIEW 开发者提供了一系列工具,用于实现网页浏览控制、网页数据获取与交互等功能&a…...

promise的方法有哪些?【JavaScript】

Promise对象在JavaScript中是一种处理异步操作的方式,它提供了一组方法来管理和控制异步操作的结果。以下是一些常用的Promise方法: 以下是对 constructor(executor)‌、then(onFulfilled, onRejected)、catch(onRejected)‌、 finally(onFin…...

基于模仿学习(IL)的端到端自动驾驶发展路径

基于模仿学习(IL)的端到端自动驾驶发展路径 1. 核心论文解析 (1) UniAD:感知-规划一体化 核心思想:首次提出将感知任务(如目标检测、车道线识别、轨迹预测)与规划任务集成到统一的端到端框架中&#xff…...

第1篇:SOLR 简介与源码环境搭建

第1篇:SOLR 简介与源码环境搭建 1.1 SOLR 是什么? Apache SOLR 是一个基于 Apache Lucene 的高性能开源搜索平台。它不仅继承了 Lucene 强大的全文搜索能力,还通过封装和扩展,提供了企业级的功能,比如分布式搜索(SolrCloud)、RESTful API、动态 Schema 管理等。自 200…...

Docker 搭建 Redis 数据库

Docker 搭建 Redis 数据库 前言一、准备工作二、创建 Redis 容器的目录结构三、启动 Redis 容器1. 通过 redis.conf 配置文件设置密码2. 通过 Docker 命令中的 requirepass 参数设置密码 四、Host 网络模式与 Port 映射模式五、检查 Redis 容器状态六、访问 Redis 服务总结 前言…...

MySQL 连表查询:原理、语法与优化

目录 引言 什么是连表查询? 连表查询的类型 1. 内连接(INNER JOIN) 2. 左连接(LEFT JOIN) 3. 右连接(RIGHT JOIN) 4. 全连接(FULL JOIN) 5. 交叉连接(…...

实战技巧:如何快速提高网站收录的权威性?

快速提高网站收录的权威性是一个系统性的工作,涉及内容质量、网站结构、外部链接、用户体验等多个方面。以下是一些实战技巧,可以帮助你快速提升网站收录的权威性: 一、提升内容质量 原创性: 确保网站内容具备高质量与原创性&a…...

vue语法v-model例子单选题和多选题

<template><!-- 单选框 --><input type"radio" v-model"danxuan" value"a"><label for"a">a</label><input type"radio" v-model"danxuan" value"b"><label fo…...

计算机网络面试知识点总结

目录 1. 计算机网络的基本知识点2. OSI 七层模型3. TCP/IP 四层模型4. TCP 和 UDP4.1 TCP 协议4.2 TCP 流量控制4.3 TCP 拥塞控制4.4 TCP 三次握手4.5 TCP 四次挥手4.6 TCP 粘包问题4.7 TCP Socket交互流程4.8 UDP 协议以及和 TCP 协议的不同 5. HTTP协议5.1 HTTP 请求方法以及…...

JVM生产环境问题定位与解决实战(二):JConsole、VisualVM到MAT的高级应用

生产问题定位指南&#xff1a;几款必备的可视化工具 引言 在上一篇文章中&#xff0c;详细的介绍了JDK自带的一系列命令行工具&#xff0c;&#xff0c;如jps、jmap、jstat、jstack以及jcmd等&#xff0c;这些工具为排查和诊断Java虚拟机&#xff08;JVM&#xff09;问题提供…...

c++入门-------命名空间、缺省参数、函数重载

C系列 文章目录 C系列前言一、命名空间二、缺省参数2.1、缺省参数概念2.2、 缺省参数分类2.2.1、全缺省参数2.2.2、半缺省参数 2.3、缺省参数的特点 三、函数重载3.1、函数重载概念3.2、构成函数重载的条件3.2.1、参数类型不同3.2.2、参数个数不同3.2.3、参数类型顺序不同 前言…...

Lua语言入门(自用)

全局与非全局 在lua语言当中没有被local表示的是全局变量 反之则是本地变量(仅仅作用在某个文件,函数,或者代码块) 下面是实例代码和运行结果 --hello.luaA 10;--这样就是全局变量,然后这个编译器如果是大写就是默认的全局变量 local b 3;--这样就是局部变量--reference.…...

大数据开发平台的框架

根据你的需求&#xff0c;以下是从 GitHub 推荐的 10 个可以实现大数据开发平台的项目&#xff1a; 1. Apache Spark Apache Spark 是一个开源的分布式计算框架&#xff0c;适用于大规模数据处理和分析。它提供了强大的数据处理能力&#xff0c;支持实时数据处理、机器学习和…...

X86_64位下的GS寄存器

在 64 位模式下&#xff0c;段机制通常&#xff08;但不是完全&#xff09;被禁用&#xff0c;从而创建一个平坦的 64 位线性地址空间。处理器将 CS、DS、ES、SS 的段基地址视为零&#xff0c;从而创建一个与有效地址相等的线性地址。FS 和 GS 段是例外。这些段寄存器&#xff…...

#6【TIP2023】Dif-Fusion

📜 Dif-Fusion: Toward High Color Fidelity in Infrared and Visible Image Fusion With Diffusion Models 🍸 源码:https://github.com/GeoVectorMatrix/Dif-Fusion 🍺 前向扩散过程 前向过程看成是逐步加噪的Markov链,在每一个时间步 t t t ,...

科普:“git“与“github“

Git与GitHub的关系可以理解为&#xff1a;Git是一种软件工具&#xff0c;而GitHub则是一个在线平台&#xff0c;它们是“一家子”。二者的关联最直接体现在你通过Git在GitHub仓库中clone软件包到你的机器中来。 具体来说&#xff1a; 一、Git 定义&#xff1a;Git是一个开源的…...

unplugin-vue-components,unplugin-auto-import,借用ai去学习

好的&#xff0c;我现在需要帮助用户理解他们提供的这段Vite配置代码。用户之前已经询问过关于ElementPlusResolver的导入问题&#xff0c;现在他们展示了在vite.config.ts中使用该解析器的具体配置。我需要逐步分析这段代码&#xff0c;并解释每个部分的作用。 首先&#xff…...

蓝桥杯 2013 省 B 翻硬币

题目背景 小明正在玩一个“翻硬币”的游戏。 题目描述 桌上放着排成一排的若干硬币。我们用 * 表示正面&#xff0c;用 o 表示反面&#xff08;是小写字母&#xff0c;不是零&#xff09;&#xff0c;比如可能情形是 **oo***oooo&#xff0c;如果同时翻转左边的两个硬币&…...

深入剖析AI大模型:大模型时代的 Prompt 工程全解析

今天聊的内容&#xff0c;我认为是AI开发里面非常重要的内容。它在AI开发里无处不在&#xff0c;当你对 AI 助手说 "用李白的风格写一首关于人工智能的诗"&#xff0c;或者让翻译模型 "将这段合同翻译成商务日语" 时&#xff0c;输入的这句话就是 Prompt。…...

【Oracle APEX开发小技巧12】

有如下需求&#xff1a; 有一个问题反馈页面&#xff0c;要实现在apex页面展示能直观看到反馈时间超过7天未处理的数据&#xff0c;方便管理员及时处理反馈。 我的方法&#xff1a;直接将逻辑写在SQL中&#xff0c;这样可以直接在页面展示 完整代码&#xff1a; SELECTSF.FE…...

云启出海,智联未来|阿里云网络「企业出海」系列客户沙龙上海站圆满落地

借阿里云中企出海大会的东风&#xff0c;以**「云启出海&#xff0c;智联未来&#xff5c;打造安全可靠的出海云网络引擎」为主题的阿里云企业出海客户沙龙云网络&安全专场于5.28日下午在上海顺利举办&#xff0c;现场吸引了来自携程、小红书、米哈游、哔哩哔哩、波克城市、…...

【Linux】C语言执行shell指令

在C语言中执行Shell指令 在C语言中&#xff0c;有几种方法可以执行Shell指令&#xff1a; 1. 使用system()函数 这是最简单的方法&#xff0c;包含在stdlib.h头文件中&#xff1a; #include <stdlib.h>int main() {system("ls -l"); // 执行ls -l命令retu…...

鸿蒙中用HarmonyOS SDK应用服务 HarmonyOS5开发一个生活电费的缴纳和查询小程序

一、项目初始化与配置 1. 创建项目 ohpm init harmony/utility-payment-app 2. 配置权限 // module.json5 {"requestPermissions": [{"name": "ohos.permission.INTERNET"},{"name": "ohos.permission.GET_NETWORK_INFO"…...

tree 树组件大数据卡顿问题优化

问题背景 项目中有用到树组件用来做文件目录&#xff0c;但是由于这个树组件的节点越来越多&#xff0c;导致页面在滚动这个树组件的时候浏览器就很容易卡死。这种问题基本上都是因为dom节点太多&#xff0c;导致的浏览器卡顿&#xff0c;这里很明显就需要用到虚拟列表的技术&…...

CMake控制VS2022项目文件分组

我们可以通过 CMake 控制源文件的组织结构,使它们在 VS 解决方案资源管理器中以“组”(Filter)的形式进行分类展示。 🎯 目标 通过 CMake 脚本将 .cpp、.h 等源文件分组显示在 Visual Studio 2022 的解决方案资源管理器中。 ✅ 支持的方法汇总(共4种) 方法描述是否推荐…...

Web 架构之 CDN 加速原理与落地实践

文章目录 一、思维导图二、正文内容&#xff08;一&#xff09;CDN 基础概念1. 定义2. 组成部分 &#xff08;二&#xff09;CDN 加速原理1. 请求路由2. 内容缓存3. 内容更新 &#xff08;三&#xff09;CDN 落地实践1. 选择 CDN 服务商2. 配置 CDN3. 集成到 Web 架构 &#xf…...

初学 pytest 记录

安装 pip install pytest用例可以是函数也可以是类中的方法 def test_func():print()class TestAdd: # def __init__(self): 在 pytest 中不可以使用__init__方法 # self.cc 12345 pytest.mark.api def test_str(self):res add(1, 2)assert res 12def test_int(self):r…...

ABAP设计模式之---“简单设计原则(Simple Design)”

“Simple Design”&#xff08;简单设计&#xff09;是软件开发中的一个重要理念&#xff0c;倡导以最简单的方式实现软件功能&#xff0c;以确保代码清晰易懂、易维护&#xff0c;并在项目需求变化时能够快速适应。 其核心目标是避免复杂和过度设计&#xff0c;遵循“让事情保…...