当前位置: 首页 > 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;如果同时翻转左边的两个硬币&…...

调用支付宝接口响应40004 SYSTEM_ERROR问题排查

在对接支付宝API的时候&#xff0c;遇到了一些问题&#xff0c;记录一下排查过程。 Body:{"datadigital_fincloud_generalsaas_face_certify_initialize_response":{"msg":"Business Failed","code":"40004","sub_msg…...

智慧医疗能源事业线深度画像分析(上)

引言 医疗行业作为现代社会的关键基础设施,其能源消耗与环境影响正日益受到关注。随着全球"双碳"目标的推进和可持续发展理念的深入,智慧医疗能源事业线应运而生,致力于通过创新技术与管理方案,重构医疗领域的能源使用模式。这一事业线融合了能源管理、可持续发…...

大语言模型如何处理长文本?常用文本分割技术详解

为什么需要文本分割? 引言:为什么需要文本分割?一、基础文本分割方法1. 按段落分割(Paragraph Splitting)2. 按句子分割(Sentence Splitting)二、高级文本分割策略3. 重叠分割(Sliding Window)4. 递归分割(Recursive Splitting)三、生产级工具推荐5. 使用LangChain的…...

稳定币的深度剖析与展望

一、引言 在当今数字化浪潮席卷全球的时代&#xff0c;加密货币作为一种新兴的金融现象&#xff0c;正以前所未有的速度改变着我们对传统货币和金融体系的认知。然而&#xff0c;加密货币市场的高度波动性却成为了其广泛应用和普及的一大障碍。在这样的背景下&#xff0c;稳定…...

Reasoning over Uncertain Text by Generative Large Language Models

https://ojs.aaai.org/index.php/AAAI/article/view/34674/36829https://ojs.aaai.org/index.php/AAAI/article/view/34674/36829 1. 概述 文本中的不确定性在许多语境中传达,从日常对话到特定领域的文档(例如医学文档)(Heritage 2013;Landmark、Gulbrandsen 和 Svenevei…...

Redis的发布订阅模式与专业的 MQ(如 Kafka, RabbitMQ)相比,优缺点是什么?适用于哪些场景?

Redis 的发布订阅&#xff08;Pub/Sub&#xff09;模式与专业的 MQ&#xff08;Message Queue&#xff09;如 Kafka、RabbitMQ 进行比较&#xff0c;核心的权衡点在于&#xff1a;简单与速度 vs. 可靠与功能。 下面我们详细展开对比。 Redis Pub/Sub 的核心特点 它是一个发后…...

基于Java Swing的电子通讯录设计与实现:附系统托盘功能代码详解

JAVASQL电子通讯录带系统托盘 一、系统概述 本电子通讯录系统采用Java Swing开发桌面应用&#xff0c;结合SQLite数据库实现联系人管理功能&#xff0c;并集成系统托盘功能提升用户体验。系统支持联系人的增删改查、分组管理、搜索过滤等功能&#xff0c;同时可以最小化到系统…...

python爬虫——气象数据爬取

一、导入库与全局配置 python 运行 import json import datetime import time import requests from sqlalchemy import create_engine import csv import pandas as pd作用&#xff1a; 引入数据解析、网络请求、时间处理、数据库操作等所需库。requests&#xff1a;发送 …...

【前端异常】JavaScript错误处理:分析 Uncaught (in promise) error

在前端开发中&#xff0c;JavaScript 异常是不可避免的。随着现代前端应用越来越多地使用异步操作&#xff08;如 Promise、async/await 等&#xff09;&#xff0c;开发者常常会遇到 Uncaught (in promise) error 错误。这个错误是由于未正确处理 Promise 的拒绝&#xff08;r…...

MyBatis中关于缓存的理解

MyBatis缓存 MyBatis系统当中默认定义两级缓存&#xff1a;一级缓存、二级缓存 默认情况下&#xff0c;只有一级缓存开启&#xff08;sqlSession级别的缓存&#xff09;二级缓存需要手动开启配置&#xff0c;需要局域namespace级别的缓存 一级缓存&#xff08;本地缓存&#…...