-
大小: 4.28MB文件类型: .zip金币: 1下载: 0 次发布日期: 2023-11-18
- 语言: Python
- 标签:
资源简介
PyTorch实时多人姿态估计项目的实现
代码片段和文件信息
# !/usr/bin/env python3
# coding=utf-8
# author=dave.fang@outlook.com
# create=20171225
import cv2
import math
import torch
import torch.nn as nn
from torch import np
from torch.autograd import Variable
from utils import *
from scipy.ndimage.filters import gaussian_filter
# find connection in the specified sequence center 29 is in the position 15
limb_seq = [[2 3] [2 6] [3 4] [4 5] [6 7] [7 8] [2 9] [9 10]
[10 11] [2 12] [12 13] [13 14] [2 1] [1 15] [15 17]
[1 16] [16 18] [3 17] [6 18]]
# the middle joints heatmap correpondence
map_ids = [[31 32] [39 40] [33 34] [35 36] [41 42] [43 44] [19 20] [21 22]
[23 24] [25 26] [27 28] [29 30] [47 48] [49 50] [53 54] [51 52]
[55 56] [37 38] [45 46]]
# visualize
colors = [[255 0 0] [255 85 0] [255 170 0] [255 255 0] [170 255 0] [85 255 0] [0 255 0]
[0 255 85] [0 255 170] [0 255 255] [0 170 255] [0 85 255] [0 0 255] [85 0 255]
[170 0 255] [255 0 255] [255 0 170] [255 0 85]]
class PoseEstimation(nn.Module):
def __init__(self model_dict):
super(PoseEstimation self).__init__()
self.model0 = model_dict[‘block_0‘]
self.model1_1 = model_dict[‘block1_1‘]
self.model2_1 = model_dict[‘block2_1‘]
self.model3_1 = model_dict[‘block3_1‘]
self.model4_1 = model_dict[‘block4_1‘]
self.model5_1 = model_dict[‘block5_1‘]
self.model6_1 = model_dict[‘block6_1‘]
self.model1_2 = model_dict[‘block1_2‘]
self.model2_2 = model_dict[‘block2_2‘]
self.model3_2 = model_dict[‘block3_2‘]
self.model4_2 = model_dict[‘block4_2‘]
self.model5_2 = model_dict[‘block5_2‘]
self.model6_2 = model_dict[‘block6_2‘]
def forward(self x):
out1 = self.model0(x)
out1_1 = self.model1_1(out1)
out1_2 = self.model1_2(out1)
out2 = torch.cat([out1_1 out1_2 out1] 1)
out2_1 = self.model2_1(out2)
out2_2 = self.model2_2(out2)
out3 = torch.cat([out2_1 out2_2 out1] 1)
out3_1 = self.model3_1(out3)
out3_2 = self.model3_2(out3)
out4 = torch.cat([out3_1 out3_2 out1] 1)
out4_1 = self.model4_1(out4)
out4_2 = self.model4_2(out4)
out5 = torch.cat([out4_1 out4_2 out1] 1)
out5_1 = self.model5_1(out5)
out5_2 = self.model5_2(out5)
out6 = torch.cat([out5_1 out5_2 out1] 1)
out6_1 = self.model6_1(out6)
out6_2 = self.model6_2(out6)
return out6_1 out6_2
def make_layers(layer_dict):
layers = []
for i in range(len(layer_dict) - 1):
layer = layer_dict[i]
for k in layer:
v = layer[k]
if ‘pool‘ in k:
layers += [nn.MaxPool2d(kernel_size=v[0] stride=v[1] padding=v[2])]
else:
conv2d = nn.Conv2d(in_channels=v[
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-12-26 06:44 pytorch-pose-estimation-master\
文件 1157 2017-12-26 06:44 pytorch-pose-estimation-master\.gitignore
文件 842 2017-12-26 06:44 pytorch-pose-estimation-master\README.md
文件 1787007 2017-12-26 06:44 pytorch-pose-estimation-master\demo_pic.ipynb
文件 2425695 2017-12-26 06:44 pytorch-pose-estimation-master\demo_pic_detail.ipynb
文件 1799966 2017-12-26 06:44 pytorch-pose-estimation-master\demo_pic_func.ipynb
目录 0 2017-12-26 06:44 pytorch-pose-estimation-master\models\
文件 1157 2017-12-26 06:44 pytorch-pose-estimation-master\models\.gitignore
文件 15535 2017-12-26 06:44 pytorch-pose-estimation-master\pose_estimation.py
文件 1031 2017-12-26 06:44 pytorch-pose-estimation-master\utils.py
相关资源
- Python-在特征金字塔网络FPN的Pytorch实现
- Python-用PyTorch10实现FasterRCNN和MaskRCNN比
- Python-心脏核磁共振MRI图像分割
- Python-基于YOLOv3的行人检测
- Python-RLSeq2Seq用于SequencetoSequence模型的
- Python-PyTorch对卷积CRF的参考实现
- Python-高效准确的EAST文本检测器的一个
- Python-pytorch实现的人脸检测和人脸识别
- Python-UNet用于医学图像分割的嵌套UN
- Python-TensorFlow弱监督图像分割
- Python-基于tensorflow实现的用textcnn方法
- Python-Keras实现Inceptionv4InceptionResnetv1和
- Python-pytorch中文手册
- Python-FastSCNN的PyTorch实现快速语义分割
- Python-滑动窗口高分辨率显微镜图像分
- Python-使用MovieLens数据集训练的电影推
- Python-机器学习驱动的Web应用程序防火
- Python-subpixel利用Tensorflow的一个子像素
-
Python-汉字的神经风格转移Neuralst
y - Python-神经网络模型能够从音频演讲中
- Python-深度增强学习算法的PyTorch实现策
- Python-基于深度学习的语音增强使用
- Python-基于知识图谱的红楼梦人物关系
- Python-STGAN用于图像合成的空间变换生
- Python-利用GAN进行图片填充
- Python-基于50W携程出行攻略的顺承事件
- Python-在TensorFlow中实现实现图像卷积网
- Python-60DaysRLChallenge中文版强化学习6
- Python-一个非常简单的BiLSTMCRF模型用于
- Python-Tensorflow仿AlphaGo框架实现的AI围棋
评论
共有 条评论