retinaface数据集制作

news/2024/10/24 7:27:24/

*项目需要,第一次接触,简单做个记录,无脑代码

  • 用labelme做的标记,按照顺序:五个点+一个bbox
  • 生成.json的文件
  • 下面代码将json标记的文件夹转为Retinaface训练集的label.txt
import os
import jsondata_dir = 'train标注\\'
all_json = os.listdir(data_dir)with open("train.txt","w") as f:for j_name in all_json:f.write(j_name + '\n')j = open(data_dir + j_name, encoding='utf-8'info = json.load(j)x1 = info['shapes'][5]['points'][0][0]y1 = info['shapes'][5]['points'][0][1]x2 = info['shapes'][5]['points'][1][0]y2 = info['shapes'][5]['points'][1][1]w = str(round(x2 - x1, 2))h = str(round(y2 - y1, 2))x1 = str(round(x1, 2))y1 = str(round(y1, 2))d1x = str(round(info['shapes'][0]['points'][0][0], 2))d1y = str(round(info['shapes'][0]['points'][0][1], 2))d2x = str(round(info['shapes'][1]['points'][0][0], 2))d2y = str(round(info['shapes'][1]['points'][0][1], 2))d3x = str(round(info['shapes'][2]['points'][0][0], 2))d3y = str(round(info['shapes'][2]['points'][0][1], 2))d4x = str(round(info['shapes'][3]['points'][0][0], 2))d4y = str(round(info['shapes'][3]['points'][0][1], 2))d5x = str(round(info['shapes'][4]['points'][0][0], 2))d5y = str(round(info['shapes'][4]['points'][0][1], 2))label = x1 + ' ' + y1 + ' ' + w + ' ' + h + ' ' + d1x + ' ' + d1y + ' ' + '0.0' + ' ' + d2x + ' ' + d2y + ' ' + '0.0' + ' ' + d3x + ' ' + d3y + ' ' + '0.0' + ' ' + d4x + ' ' + d4y + ' ' + '0.0' + ' ' + d5x + ' ' + d5y + ' ' + '0.0' + ' ' + '1'f.write(label + '\n')
  • 标记顺序不一样就改索引
  • 最后的1是置信度,因为数据特殊直接写了1

在这里插入图片描述

`


http://www.ppmy.cn/news/130806.html

相关文章

数学建模学习笔记(二十二)灰色预测(下下)GM(2,1)

GM(2,1) 理论推导: 例子: matlab代码: clc,clear x0[41,49,61,78,96,104]; nlength(x0); x1cumsum(x0); a_x0diff(x0); a_x0[0,a_x0] for i2:nz(i)0.5*(x1(i)x1(i-1)); end B[-x0(2:end),-z(2:end)…

matlab DGM(2,1)模型

DGM(2,1)模型 clc,clear; x0[2.874 3.278 3.39 3.679 3.77 3.8]; nlength(x0); a_x0diff(x0); B[-x0(2:end),ones(n-1,1)]; uB\a_x0syms x(t) d2xdiff(x,2);dxdiff(x);xdsolve(d2xu(1)*dxu(2),x(0)x0(1),dx(0)x0(1)); xtvpa(x,6) yucesubs(x,t,[0:n-1])…

【O文件介绍】

介绍RINEX格式的观测值文件,文件头如下 3.00 OBSERVATION DATA M (MIXED) RINEX VERSION / TYPE Bnx2Rnx igs 20170102 00:06:26UTCPGM / RUN BY / DATE Source 083720170101000000.bnx …

Diablo II中的各种hacks

Game hacks,也就是通常所说的游戏作弊软件。在网络游戏时代,也许是因为针对传奇这类游戏的作弊软件大都利用WPE之类的抓包工具来制作,因此hacks又叫外挂。不过Diablo的hacks绝大多数是和游戏代码紧密结合在一起的,也许应该叫内挂才…

游戏外挂检测和反检测

关于游戏外挂检测和反检测(真正的防封技术)在网上找到篇关于游戏外挂检测和反检测的文章拿来跟断点的朋友分享。详细文章见附件,这里写些简介。 一:内存探测法 服务器发送个Paket检测游戏内存,然后返回服务器…

通俗易懂:非线性与线性的区别是什么?

文章来源-公众号:有限元仿真分析 非线性是自然界复杂性的典型性质之一,那么你对非线性了解多少呢?以下可见一斑: 什么是非线性 非线性(non-linear),即 变量之间的数学关系,不是直线而是曲线、曲面、或不确…

【YBT2023寒假Day1 B】不跪模样(树链剖分)(线段树)

不跪模样 题目链接&#xff1a;YBT2023寒假Day1 B 题目大意 给你一棵有根数&#xff0c;点有点权&#xff0c;两种操作&#xff1a; 对于所有 x 子树内与 x 距离不超过 2 的点&#xff0c;将其点权加 v。 询问 x 子树中&#xff0c;满足 i<j 且 i,j 的 LCA 是 x 的数对 (…

Matlab实验(二)

Matlab实验&#xff08;二&#xff09; 1.求积分 f(x,y)(x.*cos(xy.*y)); dblquad(f,0,pi,0,2*pi)ans -3.42672.求常微分方程的数值解 syms y; dsolve(D2y2*Dyy0,y(0)0,Dy(0)1)ans t*exp(-t)3.试求下面齐次方程的基础解系。 %调用代码 A[6 1 4 -7 -3;-2 -7 -8 6 0;-4 5 1 -…