【人工智能学习之HDGCN18关键点修改】

【人工智能学习之HDGCN18关键点修改】

  • 训练部分
  • 修改部分

训练部分

请参考文章:【人工智能学习之HDGCN训练自己的数据集】

修改部分

在这里插入图片描述
参考源码中25关键点的区域划分,我们将18关键点划分为:

头部:

  • 鼻子
  • 左眼和左耳
  • 右眼和右耳

上肢:

  • 左肩、左肘、左腕
  • 右肩、右肘、右腕

下肢:

  • 左髋、左膝、左踝
  • 右髋、右膝、右踝

躯干:

  • 颈部、左右肩、左右髋

对于【人工智能学习之HDGCN训练自己的数据集】中模型移植与修改部分,我的修改内容如下:
HDhierarchy.py:

from audioop import reverse
import sys
import numpy as npsys.path.extend(['../'])num_node = 18import numpy as npdef edge2mat(link, num_node):A = np.zeros((num_node, num_node))for i, j in link:A[j, i] = 1return Adef normalize_digraph(A):Dl = np.sum(A, 0)h, w = A.shapeDn = np.zeros((w, w))for i in range(w):if Dl[i] > 0:Dn[i, i] = Dl[i] ** (-1)AD = np.dot(A, Dn)return ADdef get_spatial_graph(num_node, hierarchy):A = []for i in range(len(hierarchy)):A.append(normalize_digraph(edge2mat(hierarchy[i], num_node)))A = np.stack(A)return Adef get_spatial_graph_original(num_node, self_link, inward, outward):I = edge2mat(self_link, num_node)In = normalize_digraph(edge2mat(inward, num_node))Out = normalize_digraph(edge2mat(outward, num_node))A = np.stack((I, In, Out))return Adef normalize_adjacency_matrix(A):node_degrees = A.sum(-1)degs_inv_sqrt = np.power(node_degrees, -0.5)norm_degs_matrix = np.eye(len(node_degrees)) * degs_inv_sqrtreturn (norm_degs_matrix @ A @ norm_degs_matrix).astype(np.float32)def get_graph(num_node, edges):I = edge2mat(edges[0], num_node)Forward = normalize_digraph(edge2mat(edges[1], num_node))Reverse = normalize_digraph(edge2mat(edges[2], num_node))A = np.stack((I, Forward, Reverse))return A  # 3, 25, 25def get_hierarchical_graph(num_node, edges):A = []for edge in edges:A.append(get_graph(num_node, edge))A = np.stack(A)return Adef get_groups(dataset='NTU', CoM=18):groups = []if dataset == 'NTU':if CoM == 2:groups.append([2])groups.append([1, 21])groups.append([13, 17, 3, 5, 9])groups.append([14, 18, 4, 6, 10])groups.append([15, 19, 7, 11])groups.append([16, 20, 8, 12])groups.append([22, 23, 24, 25])## Center of mass : 21elif CoM == 21:groups.append([21])groups.append([2, 3, 5, 9])groups.append([4, 6, 10, 1])groups.append([7, 11, 13, 17])groups.append([8, 12, 14, 18])groups.append([22, 23, 24, 25, 15, 19])groups.append([16, 20])## Center of Mass : 1elif CoM == 1:groups.append([1])groups.append([2, 13, 17])groups.append([14, 18, 21])groups.append([3, 5, 9, 15, 19])groups.append([4, 6, 10, 16, 20])groups.append([7, 11])groups.append([8, 12, 22, 23, 24, 25])elif CoM == 18:# 头部groups.append([1])  # 鼻子groups.append([15, 17])  # 左眼和左耳groups.append([16, 18])  # 右眼和右耳# 上肢groups.append([3, 4, 5])  # 左肩、左肘、左腕groups.append([6, 7, 8])  # 右肩、右肘、右腕# 下肢groups.append([9, 10, 11])  # 左髋、左膝、左踝groups.append([12, 13, 14])  # 右髋、右膝、右踝# 躯干groups.append([2, 3, 6, 9, 12])  # 颈部、左右肩、左右髋else:raise ValueError()return groupsdef get_edgeset(dataset='NTU', CoM=18):groups = get_groups(dataset=dataset, CoM=CoM)for i, group in enumerate(groups):group = [i - 1 for i in group]groups[i] = groupidentity = []forward_hierarchy = []reverse_hierarchy = []for i in range(len(groups) - 1):self_link = groups[i] + groups[i + 1]self_link = [(i, i) for i in self_link]identity.append(self_link)forward_g = []for j in groups[i]:for k in groups[i + 1]:forward_g.append((j, k))forward_hierarchy.append(forward_g)reverse_g = []for j in groups[-1 - i]:for k in groups[-2 - i]:reverse_g.append((j, k))reverse_hierarchy.append(reverse_g)edges = []for i in range(len(groups) - 1):edges.append([identity[i], forward_hierarchy[i], reverse_hierarchy[-1 - i]])return edgesclass Graph:def __init__(self, CoM=18, labeling_mode='spatial'):self.num_node = num_nodeself.CoM = CoMself.A = self.get_adjacency_matrix(labeling_mode)def get_adjacency_matrix(self, labeling_mode=None):if labeling_mode is None:return self.Aif labeling_mode == 'spatial':A = get_hierarchical_graph(num_node, get_edgeset(dataset='NTU', CoM=self.CoM)) # L, 3, 25, 25else:raise ValueError()return A, self.CoM

以及网络的部分修改:
hd_gcn.py:

import torch
import torch.nn as nn
import mathimport numpy as npfrom einops import rearrange, repeatfrom net.HDhierarchy import get_groupsdef import_class(name):components = name.split('.')mod = __import__(components[0])for comp in components[1:]:mod = getattr(mod, comp)return moddef conv_branch_init(conv, branches):weight = conv.weightn = weight.size(0)k1 = weight.size(1)k2 = weight.size(2)nn.init.normal_(weight, 0, math.sqrt(2. / (n * k1 * k2 * branches)))if conv.bias is not None:nn.init.constant_(conv.bias, 0)def conv_init(conv):if conv.weight is not None:nn.init.kaiming_normal_(conv.weight, mode='fan_out')if conv.bias is not None:nn.init.constant_(conv.bias, 0)def bn_init(bn, scale):nn.init.constant_(bn.weight, scale)nn.init.constant_(bn.bias, 0)def weights_init(m):classname = m.__class__.__name__if classname.find('Conv') != -1:if hasattr(m, 'weight'):nn.init.kaiming_normal_(m.weight, mode='fan_out')if hasattr(m, 'bias') and m.bias is not None and isinstance(m.bias, torch.Tensor):nn.init.constant_(m.bias, 0)elif classname.find('BatchNorm') != -1:if hasattr(m, 'weight') and m.weight is not None:m.weight.data.normal_(1.0, 0.02)if hasattr(m, 'bias') and m.bias is not None:m.bias.data.fill_(0)class TemporalConv(nn.Module):def __init__(self, in_channels, out_channels, kernel_size, stride=1, dilation=1):super(TemporalConv, self).__init__()pad = (kernel_size + (kernel_size - 1) * (dilation - 1) - 1) // 2self.conv = nn.Conv2d(in_channels,out_channels,kernel_size=(kernel_size, 1),padding=(pad, 0),stride=(stride, 1),dilation=(dilation, 1),bias=False)self.bias = nn.Parameter(torch.zeros(1, out_channels, 1, 1), requires_grad=True)self.bn = nn.BatchNorm2d(out_channels)def forward(self, x):x = self.conv(x) + self.biasx = self.bn(x)return xclass MultiScale_TemporalConv(nn.Module):def __init__(self,in_channels,out_channels,kernel_size=5,stride=1,dilations=[1,2],residual=True,residual_kernel_size=1):super().__init__()assert out_channels % (len(dilations) + 2) == 0, '# out channels should be multiples of # branches'# Multiple branches of temporal convolutionself.num_branches = len(dilations) + 2branch_channels = out_channels // self.num_branchesif type(kernel_size) == list:assert len(kernel_size) == len(dilations)else:kernel_size = [kernel_size] * len(dilations)# Temporal Convolution branchesself.branches = nn.ModuleList([nn.Sequential(nn.Conv2d(in_channels,branch_channels,kernel_size=1,padding=0),nn.BatchNorm2d(branch_channels),nn.ReLU(inplace=True),TemporalConv(branch_channels,branch_channels,kernel_size=ks,stride=stride,dilation=dilation),)for ks, dilation in zip(kernel_size, dilations)])# Additional Max & 1x1 branchself.branches.append(nn.Sequential(nn.Conv2d(in_channels, branch_channels, kernel_size=1, padding=0),nn.BatchNorm2d(branch_channels),nn.ReLU(inplace=True),nn.MaxPool2d(kernel_size=(3, 1), stride=(stride, 1), padding=(1, 0)),nn.BatchNorm2d(branch_channels)))self.branches.append(nn.Sequential(nn.Conv2d(in_channels, branch_channels, kernel_size=1, padding=0, stride=(stride, 1)),nn.BatchNorm2d(branch_channels)))# Residual connectionif not residual:self.residual = lambda x: 0elif (in_channels == out_channels) and (stride == 1):self.residual = lambda x: xelse:self.residual = TemporalConv(in_channels, out_channels, kernel_size=residual_kernel_size, stride=stride)# initializeself.apply(weights_init)def forward(self, x):branch_outs = []for tempconv in self.branches:out = tempconv(x)branch_outs.append(out)out = torch.cat(branch_outs, dim=1)out += self.residual(x)return outclass residual_conv(nn.Module):def __init__(self, in_channels, out_channels, kernel_size=5, stride=1):super(residual_conv, self).__init__()pad = int((kernel_size - 1) / 2)self.conv = nn.Conv2d(in_channels, out_channels, kernel_size=(kernel_size, 1), padding=(pad, 0),stride=(stride, 1))self.bn = nn.BatchNorm2d(out_channels)self.relu = nn.ReLU(inplace=True)conv_init(self.conv)bn_init(self.bn, 1)def forward(self, x):x = self.bn(self.conv(x))return xclass EdgeConv(nn.Module):def __init__(self, in_channels, out_channels, k):super(EdgeConv, self).__init__()self.k = kself.conv = nn.Sequential(nn.Conv2d(in_channels*2, out_channels, kernel_size=1, bias=False),nn.BatchNorm2d(out_channels),nn.LeakyReLU(inplace=True, negative_slope=0.2))for m in self.modules():if isinstance(m, nn.Conv2d):conv_init(m)elif isinstance(m, nn.BatchNorm2d):bn_init(m, 1)def forward(self, x, dim=4): # N, C, T, Vif dim == 3:N, C, L = x.size()passelse:N, C, T, V = x.size()x = x.mean(dim=-2, keepdim=False) # N, C, Vx = self.get_graph_feature(x, self.k)x = self.conv(x)x = x.max(dim=-1, keepdim=False)[0]if dim == 3:passelse:x = repeat(x, 'n c v -> n c t v', t=T)return xdef knn(self, x, k):inner = -2 * torch.matmul(x.transpose(2, 1), x) # N, V, Vxx = torch.sum(x**2, dim=1, keepdim=True)pairwise_distance = - xx - inner - xx.transpose(2, 1)idx = pairwise_distance.topk(k=k, dim=-1)[1] # N, V, kreturn idxdef get_graph_feature(self, x, k, idx=None):N, C, V = x.size()if idx is None:idx = self.knn(x, k=k)device = x.get_device()idx_base = torch.arange(0, N, device=device).view(-1, 1, 1) * Vidx = idx + idx_baseidx = idx.view(-1)x = rearrange(x, 'n c v -> n v c')feature = rearrange(x, 'n v c -> (n v) c')[idx, :]feature = feature.view(N, V, k, C)x = repeat(x, 'n v c -> n v k c', k=k)feature = torch.cat((feature - x, x), dim=3)feature = rearrange(feature, 'n v k c -> n c v k')return featureclass AHA(nn.Module):def __init__(self, in_channels, num_layers, CoM):super(AHA, self).__init__()self.num_layers = num_layersgroups = get_groups(dataset='NTU', CoM=CoM)for i, group in enumerate(groups):group = [i - 1 for i in group]groups[i] = groupinter_channels = in_channels // 4self.layers = [groups[i] + groups[i + 1] for i in range(len(groups) - 1)]self.conv_down = nn.Sequential(nn.Conv2d(in_channels, inter_channels, kernel_size=1),nn.BatchNorm2d(inter_channels),nn.ReLU(inplace=True))self.edge_conv = EdgeConv(inter_channels, inter_channels, k=3)self.aggregate = nn.Conv1d(inter_channels, in_channels, kernel_size=1)self.sigmoid = nn.Sigmoid()def forward(self, x):N, C, L, T, V = x.size()x_t = x.max(dim=-2, keepdim=False)[0]x_t = self.conv_down(x_t)x_sampled = []for i in range(self.num_layers):s_t = x_t[:, :, i, self.layers[i]]s_t = s_t.mean(dim=-1, keepdim=True)x_sampled.append(s_t)x_sampled = torch.cat(x_sampled, dim=2)att = self.edge_conv(x_sampled, dim=3)att = self.aggregate(att).view(N, C, L, 1, 1)out = (x * self.sigmoid(att)).sum(dim=2, keepdim=False)return outclass HD_Gconv(nn.Module):def __init__(self, in_channels, out_channels, A, adaptive=True, residual=True, att=False, CoM=18):super(HD_Gconv, self).__init__()self.num_layers = A.shape[0]self.num_subset = A.shape[1]self.att = attinter_channels = out_channels // (self.num_subset + 1)self.adaptive = adaptiveif adaptive:self.PA = nn.Parameter(torch.from_numpy(A.astype(np.float32)), requires_grad=True)else:raise ValueError()self.conv_down = nn.ModuleList()self.conv = nn.ModuleList()for i in range(self.num_layers):self.conv_d = nn.ModuleList()self.conv_down.append(nn.Sequential(nn.Conv2d(in_channels, inter_channels, kernel_size=1),nn.BatchNorm2d(inter_channels),nn.ReLU(inplace=True)))for j in range(self.num_subset):self.conv_d.append(nn.Sequential(nn.Conv2d(inter_channels, inter_channels, kernel_size=1),nn.BatchNorm2d(inter_channels)))self.conv_d.append(EdgeConv(inter_channels, inter_channels, k=5))self.conv.append(self.conv_d)if self.att:self.aha = AHA(out_channels, num_layers=self.num_layers, CoM=CoM)if residual:if in_channels != out_channels:self.down = nn.Sequential(nn.Conv2d(in_channels, out_channels, 1),nn.BatchNorm2d(out_channels))else:self.down = lambda x: xelse:self.down = lambda x: 0self.bn = nn.BatchNorm2d(out_channels)# 7개 conv layerself.relu = nn.ReLU(inplace=True)for m in self.modules():if isinstance(m, nn.Conv2d):conv_init(m)elif isinstance(m, nn.BatchNorm2d):bn_init(m, 1)bn_init(self.bn, 1e-6)def forward(self, x):A = self.PAout = []for i in range(self.num_layers):y = []x_down = self.conv_down[i](x)for j in range(self.num_subset):z = torch.einsum('n c t u, v u -> n c t v', x_down, A[i, j])z = self.conv[i][j](z)y.append(z)y_edge = self.conv[i][-1](x_down)y.append(y_edge)y = torch.cat(y, dim=1)out.append(y)out = torch.stack(out, dim=2)if self.att:out = self.aha(out)else:out = out.sum(dim=2, keepdim=False)out = self.bn(out)out += self.down(x)out = self.relu(out)return outclass TCN_GCN_unit(nn.Module):def __init__(self, in_channels, out_channels, A, stride=1, residual=True, adaptive=True,kernel_size=5, dilations=[1, 2], att=True, CoM=18):super(TCN_GCN_unit, self).__init__()self.gcn1 = HD_Gconv(in_channels, out_channels, A, adaptive=adaptive, att=att, CoM=CoM)self.tcn1 = MultiScale_TemporalConv(out_channels, out_channels, kernel_size=kernel_size, stride=stride, dilations=dilations,residual=False)self.relu = nn.ReLU(inplace=True)if not residual:self.residual = lambda x: 0elif (in_channels == out_channels) and (stride == 1):self.residual = lambda x: xelse:self.residual = residual_conv(in_channels, out_channels, kernel_size=1, stride=stride)def forward(self, x):y = self.relu(self.tcn1(self.gcn1(x)) + self.residual(x))return yclass Model(nn.Module):def __init__(self, num_class=2, num_point=18, num_person=1, graph=None, graph_args=dict(), in_channels=3,drop_out=0, adaptive=True):super(Model, self).__init__()if graph is None:raise ValueError()else:Graph = import_class(graph)self.graph = Graph(**graph_args)A, CoM = self.graph.Aself.dataset = 'NTU' if num_point == 18 else 'UCLA'self.num_class = num_classself.num_point = num_pointself.data_bn = nn.BatchNorm1d(num_person * in_channels * num_point)base_channels = 64self.l1 = TCN_GCN_unit(3, base_channels, A, residual=False, adaptive=adaptive, att=False, CoM=CoM)self.l2 = TCN_GCN_unit(base_channels, base_channels, A, adaptive=adaptive, CoM=CoM)self.l3 = TCN_GCN_unit(base_channels, base_channels, A, adaptive=adaptive, CoM=CoM)self.l4 = TCN_GCN_unit(base_channels, base_channels, A, adaptive=adaptive, CoM=CoM)self.l5 = TCN_GCN_unit(base_channels, base_channels*2, A, stride=2, adaptive=adaptive, CoM=CoM)self.l6 = TCN_GCN_unit(base_channels*2, base_channels*2, A, adaptive=adaptive, CoM=CoM)self.l7 = TCN_GCN_unit(base_channels*2, base_channels*2, A, adaptive=adaptive, CoM=CoM)self.l8 = TCN_GCN_unit(base_channels*2, base_channels*4, A, stride=2, adaptive=adaptive, CoM=CoM)self.l9 = TCN_GCN_unit(base_channels*4, base_channels*4, A, adaptive=adaptive, CoM=CoM)self.l10 = TCN_GCN_unit(base_channels*4, base_channels*4, A, adaptive=adaptive, CoM=CoM)self.fc = nn.Linear(base_channels*4, num_class)nn.init.normal_(self.fc.weight, 0, math.sqrt(2. / num_class))bn_init(self.data_bn, 1)if drop_out:self.drop_out = nn.Dropout(drop_out)else:self.drop_out = lambda x: xdef forward(self, x):N, C, T, V, M = x.size()x = rearrange(x, 'n c t v m -> n (m v c) t')x = self.data_bn(x)x = rearrange(x, 'n (m v c) t -> (n m) c t v', m=M, v=V)x = self.l1(x)x = self.l2(x)x = self.l3(x)x = self.l4(x)x = self.l5(x)x = self.l6(x)x = self.l7(x)x = self.l8(x)x = self.l9(x)x = self.l10(x)# N*M,C,T,Vc_new = x.size(1)x = x.view(N, M, c_new, -1)x = x.mean(3).mean(1)x = self.drop_out(x)return self.fc(x) 

最后我们编写训练所需的yaml配置文件:

work_dir: ./work_dir/recognition/kinetics_skeleton/HD_GCN# feeder
feeder: feeder.feeder.Feeder
train_feeder_args:random_choose: Truerandom_move: Truewindow_size: 30data_path: C:/WorkFiles/company_server_SSH/st-gcn-master/dataset/HDdataset/train_data.npylabel_path: C:/WorkFiles/company_server_SSH/st-gcn-master/dataset/HDdataset/train_label.pkl
test_feeder_args:data_path: C:/WorkFiles/company_server_SSH/st-gcn-master/dataset/HDdataset/val_data.npylabel_path: C:/WorkFiles/company_server_SSH/st-gcn-master/dataset/HDdataset/val_label.pkl# model
model: net.hd_gcn.Model
model_args:in_channels: 3num_class: 2num_person: 1graph: net.HDhierarchy.Graphgraph_args:labeling_mode: 'spatial'CoM: 18# training
device: [0]
batch_size: 64
test_batch_size: 64#optim
base_lr: 0.01
step: [20, 40, 60, 80]
num_epoch: 100

另外有一点需要注意,如果训练数据集出现的人数是多人的话,需要修改相应的num_person,否则data_bn会报一个batch_normal维度不匹配的错误。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/63444.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

ARCGIS国土超级工具集1.2更新说明

ARCGIS国土超级工具集V1.2版本,功能已增加至47 个。在V1.1的基础上修复了若干使用时发现的BUG,新增了"矢量分割工具"菜单,同时增加及更新了了若干功能,新工具使用说明如下: 一、勘测定界工具栏更新界址点成果…

华为OD --- 流浪地球

华为OD --- 流浪地球 题目独立实现基本思路代码实现 其他答案实现思路代码实现 题目 独立实现 基本思路 1、首先把题目给出的启动机器初始化成数组, 2、用for循环模拟每隔1s更新这个初始化数组的前后两个机器. (源码中的updateTimeCount函数) 3、for循环每次循环后会检查当前…

DataOps驱动数据集成创新:Apache DolphinScheduler SeaTunnel on Amazon Web Services

引言 在数字化转型的浪潮中,数据已成为企业最宝贵的资产之一。DataOps作为一种文化、流程和实践的集合,旨在提高数据管道的质量和效率,从而加速数据从源头到消费的过程。白鲸开源科技,作为DataOps领域的领先开源原生公司&#xf…

【硬件IIC】stm32单片机利用硬件IIC驱动OLED屏幕

之前操作OLED屏幕都是用GPIO模拟IIC去驱动,最近打算用硬件IIC去驱动,于是写下这个demo,在这个过程中遇到一点小坑,记录一下,本文章非小白教程,所以只突出踩到的坑点,文章中涉及到的OLED也是网上资料写烂的&…

python如何自动加空格

首先,需要进行打开的一个pycharm的软件,可进行双击的打开该软件。 可以看到的是在当前的打开的文件中,格式相对较乱一下。格式不对会格式错误。 然后点击菜单栏中的“code”。 在弹出的下拉菜单中选择“reformat code”选项。 可以看到的是在…

【开源免费】基于SpringBoot+Vue.JS网上订餐系统(JAVA毕业设计)

本文项目编号 T 018 ,文末自助获取源码 \color{red}{T018,文末自助获取源码} T018,文末自助获取源码 目录 一、系统介绍二、演示录屏三、启动教程四、功能截图五、文案资料5.1 选题背景5.2 国内外研究现状5.3 可行性分析 六、核心代码6.1 新…

答题考试系统v1.6.1高级版源码分享+uniapp+搭建测试环境

一.系统介绍 一款基于FastAdminThinkPHPUniapp开发的小程序答题考试系统,支持多种试题类型、多种试题难度、练题、考试、补考模式,提供全部前后台无加密源代码,支持私有化部署 二.测试环境 系统环境:CentOS、 运行环境&#x…

经典电荷泵/Charge pump——1998.JSSC

电路结构 工作原理 M3 and M4 are the series switches, and M5, M6 switch to the highest voltage. If M5 and M6 are missing, having a large capacitor is of absolute necessity, because must always stay between 2 Vin and 2Vin - Uj to avoid switching on the vert…

Swin transformer 论文阅读记录 代码分析

该篇文章,是我解析 Swin transformer 论文原理(结合pytorch版本代码)所记,图片来源于源paper或其他相应博客。 代码也非原始代码,而是从代码里摘出来的片段,配上简单数据,以便理解。 当然&…

GPT-Omni 与 Mini-Omni2:创新与性能的结合

近年来,随着人工智能技术的飞速发展,各种模型和平台应运而生,以满足从个人用户到企业级应用的多样化需求。在这一领域,GPT-Omni 和 Mini-Omni2 是两款备受瞩目的技术产品,它们凭借独特的设计和强大的功能,在…

龙迅#LT7911E适用于EDP/DP/TPYE-C转MIPIDSI应用,支持图像处理功能,内置I2C,主应用副屏显示,投屏领域!

1. 描述 LT7911E 是一款高性能 eDP 转 MIPI D-PHY 转换器,旨在将 eDP 源连接到 MIPI 显示面板。 LT7911E 集成了一个符合 eDP1.4 标准的接收器,支持 1.62Gbps 至 5.67Gbps 的输入数据,以 270Mbps 的递增步长,以及一个 2 端口 D…

C语言——实现求出最大值

问题描述&#xff1a;利用C语言自定义函数求出一维数组里边最大的数字 //利用函数找最大数#include<stdio.h>int search(int s[9]) //查找函数 {int i , max s[0] , max_xia 0;for(i0;i<9;i){if(s[i] > max){max_xia i;max s[max_xia];}}return max; } in…

解锁 draw.io 流程图制作工具Docker私有化部署(2/2)

一、draw.io 流程图制作工具简介 &#xff08;一&#xff09;基础介绍 draw.io 是一款备受青睐的开源流程图软件&#xff0c;它有着诸多优点。首先&#xff0c;其界面十分整洁有序&#xff0c;完全没有广告的干扰&#xff0c;并且所有功能都是免费向用户开放的&#xff0c;这一…

[HNCTF 2022 Week1]baby_rsa

源代码&#xff1a; from Crypto.Util.number import bytes_to_long, getPrime from gmpy2 import * from secret import flag m bytes_to_long(flag) p getPrime(128) q getPrime(128) n p * q e 65537 c pow(m,e,n) print(n,c) # 62193160459999883112594854240161159…

docker run命令大全

docker run命令大全 基本语法常用选项基础选项资源限制网络配置存储卷和挂载环境变量重启策略其他高级选项示例总结docker run 命令是 Docker 中最常用和强大的命令之一,用于创建并启动一个新的容器。该命令支持多种选项和参数,可以满足各种使用场景的需求。以下是 docker ru…

Flink2.0未来趋势中需要注意的一些问题

手机打字&#xff0c;篇幅不长&#xff0c;主要讲一下FFA中关于Flink2.0的未来趋势&#xff0c;直接看重点。 Flink Forward Asia 2024主会场有一场关于Flink2.0的演讲&#xff0c;很精彩&#xff0c;官方也发布了一些关于Flink2.0的展望和要解决的问题。 1.0时代和2.0时代避免…

智能座舱进阶-应用框架层-Jetpack主要组件

Jetpack的分类 1. DataBinding&#xff1a;以声明方式将可观察数据绑定到界面元素&#xff0c;通常和ViewModel配合使用。 2. Lifecycle&#xff1a;用于管理Activity和Fragment的生命周期&#xff0c;可帮助开发者生成更易于维护的轻量级代码。 3. LiveData: 在底层数据库更…

PowerMILL 客制化宏 - 变量

从PowerMILL2012起&#xff0c;命令起始支持变量。支持变量将使宏命令更加灵活和功能强大。可以对变量做一些运算而不依赖其它语言。 当前支持有变量类型为&#xff1a; INT&#xff1b; REAL&#xff1b; STRING&#xff1b; ENTITY&#xff1b; ARRAY LIST; OBJECT; 以下就…

arcgis for js实现地图截图、地图打印

地图截图 效果 实现 复制运行即可 要实现复杂的截图保存可以参考 官网案例 <!DOCTYPE html> <html lang"zn"><head><meta charset"UTF-8" /><meta http-equiv"X-UA-Compatible" content"IEedge" />…

【BUG】记一次context canceled的报错

文章目录 案例分析gorm源码解读gin context 生命周期context什么时候cancel的什么时候context会被动cancel掉呢&#xff1f; 野生协程如何处理 案例分析 报错信息 {"L":"ERROR","T":"2024-12-17T11:11:33.0050800","file"…