Metadata-Version: 2.1
Name: skeletorch
Version: 0.1.1
Summary: Pytorch implementation of skeleton transformer module
Home-page: https://github.com/Yutsuro/skeleton-transformer-Pytorch
Author: Yutsuro
Author-email: Yuki@utsu.ro
License: MIT
Keywords: Skeleton-Transformer Python Pytorch Action-Recognition Skeleton Pose-Estimation
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: filelock (==3.9.0)
Requires-Dist: mpmath (==1.2.1)
Requires-Dist: networkx (==3.0)
Requires-Dist: numpy (==1.24.1)
Requires-Dist: Pillow (==9.3.0)
Requires-Dist: sympy (==1.11.1)
Requires-Dist: torch (==2.0.0+cu117)
Requires-Dist: torchaudio (==2.0.1+cu117)
Requires-Dist: torchvision (==0.15.1+cu117)
Requires-Dist: typing-extensions (==4.4.0)
Requires-Dist: urllib3 (==1.26.13)

# Skeleton Transformer Module in Pytorch



Pytorch implementation of "skeleton transformer module", which is mentioned in [Skeleton-based Action Recognition with Convolutional Neural Networks](https://arxiv.org/abs/1704.07595).



## Install



You can install this module from [PyPI](https://pypi.org/project/skeletorch/0.1.0/).



```sh

pip install skeletorch

```



## How to use



### Module



#### skeletorch.SkeletonTransformer



##### Parameters:



All parameters are required.



**timesteps:** Timesteps of input time-series data (equal to number of frames, mentioned as 'T' in the paper)  

**kpts_dim:** Dimentions of keypoints (usually 2 (x, y) or 3 (x, y, z))  

**input_kpts_num:** Number of joints in original keypoints (mentioned as 'N' in the paper)  

**output_dim:** Dimentions of output (mentioned as 'M' in the paper)



##### Input:



**x:** 2-dimentional tensor of shape (timesteps, input_kpts_num*kpts_dim)



## Example        



```python

import torch

from skeletorch import SkeletonTransformer



# parameters

timesteps = 20

kpts_dim = 3

input_kpts_num = 17

output_dim = 10



# input (the size is (20, 51) in this example)

x = torch.Tensor(torch.randn(timesteps, kpts_dim*input_kpts_num))



# make layer

layer = SkeletonTransformer(timesteps, kpts_dim, input_kpts_num, output_dim)



layer(x)

```



Of course you can use this module in your Pytorch network.



## Keras implementation



We also have Keras implementation of this module:  

[https://github.com/Yutsuro/skeleton-transformer-Keras](https://github.com/Yutsuro/skeleton-transformer-Keras)
