# 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)
Raw data
{
"_id": null,
"home_page": "https://github.com/Yutsuro/skeleton-transformer-Pytorch",
"name": "skeletorch",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "Skeleton-Transformer Python Pytorch Action-Recognition Skeleton Pose-Estimation",
"author": "Yutsuro",
"author_email": "Yuki@utsu.ro",
"download_url": "https://files.pythonhosted.org/packages/b6/d6/3a693f043e3ec382839c50828295b6de7a854f60d07a62cb8d23fea5b04a/skeletorch-0.1.1.tar.gz",
"platform": null,
"description": "# Skeleton Transformer Module in Pytorch\r\n\r\n\r\n\r\nPytorch implementation of \"skeleton transformer module\", which is mentioned in [Skeleton-based Action Recognition with Convolutional Neural Networks](https://arxiv.org/abs/1704.07595).\r\n\r\n\r\n\r\n## Install\r\n\r\n\r\n\r\nYou can install this module from [PyPI](https://pypi.org/project/skeletorch/0.1.0/).\r\n\r\n\r\n\r\n```sh\r\n\r\npip install skeletorch\r\n\r\n```\r\n\r\n\r\n\r\n## How to use\r\n\r\n\r\n\r\n### Module\r\n\r\n\r\n\r\n#### skeletorch.SkeletonTransformer\r\n\r\n\r\n\r\n##### Parameters:\r\n\r\n\r\n\r\nAll parameters are required.\r\n\r\n\r\n\r\n**timesteps:** Timesteps of input time-series data (equal to number of frames, mentioned as 'T' in the paper) \r\n\r\n**kpts_dim:** Dimentions of keypoints (usually 2 (x, y) or 3 (x, y, z)) \r\n\r\n**input_kpts_num:** Number of joints in original keypoints (mentioned as 'N' in the paper) \r\n\r\n**output_dim:** Dimentions of output (mentioned as 'M' in the paper)\r\n\r\n\r\n\r\n##### Input:\r\n\r\n\r\n\r\n**x:** 2-dimentional tensor of shape (timesteps, input_kpts_num*kpts_dim)\r\n\r\n\r\n\r\n## Example \r\n\r\n\r\n\r\n```python\r\n\r\nimport torch\r\n\r\nfrom skeletorch import SkeletonTransformer\r\n\r\n\r\n\r\n# parameters\r\n\r\ntimesteps = 20\r\n\r\nkpts_dim = 3\r\n\r\ninput_kpts_num = 17\r\n\r\noutput_dim = 10\r\n\r\n\r\n\r\n# input (the size is (20, 51) in this example)\r\n\r\nx = torch.Tensor(torch.randn(timesteps, kpts_dim*input_kpts_num))\r\n\r\n\r\n\r\n# make layer\r\n\r\nlayer = SkeletonTransformer(timesteps, kpts_dim, input_kpts_num, output_dim)\r\n\r\n\r\n\r\nlayer(x)\r\n\r\n```\r\n\r\n\r\n\r\nOf course you can use this module in your Pytorch network.\r\n\r\n\r\n\r\n## Keras implementation\r\n\r\n\r\n\r\nWe also have Keras implementation of this module: \r\n\r\n[https://github.com/Yutsuro/skeleton-transformer-Keras](https://github.com/Yutsuro/skeleton-transformer-Keras)\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Pytorch implementation of skeleton transformer module",
"version": "0.1.1",
"split_keywords": [
"skeleton-transformer",
"python",
"pytorch",
"action-recognition",
"skeleton",
"pose-estimation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2c5fcfe8e7b2c996c75e34db475fc45e0160ebdec6b410a104b2fdff3001ee62",
"md5": "e5e2c44e7a7d90b98ae89bf32dcce84a",
"sha256": "d24c9c1cd03ad25f3f512d1cbc57ffde14e71d3efe8b63d3b7dbeb21f2a22679"
},
"downloads": -1,
"filename": "skeletorch-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e5e2c44e7a7d90b98ae89bf32dcce84a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 3866,
"upload_time": "2023-04-19T17:25:28",
"upload_time_iso_8601": "2023-04-19T17:25:28.884187Z",
"url": "https://files.pythonhosted.org/packages/2c/5f/cfe8e7b2c996c75e34db475fc45e0160ebdec6b410a104b2fdff3001ee62/skeletorch-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b6d63a693f043e3ec382839c50828295b6de7a854f60d07a62cb8d23fea5b04a",
"md5": "c271001a5564d82099d9a05526aad90f",
"sha256": "01e818bf947234b0525dff5c22ef62006081917d26a7772aa2793da9321b27ac"
},
"downloads": -1,
"filename": "skeletorch-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "c271001a5564d82099d9a05526aad90f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3667,
"upload_time": "2023-04-19T17:25:31",
"upload_time_iso_8601": "2023-04-19T17:25:31.104313Z",
"url": "https://files.pythonhosted.org/packages/b6/d6/3a693f043e3ec382839c50828295b6de7a854f60d07a62cb8d23fea5b04a/skeletorch-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-19 17:25:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "Yutsuro",
"github_project": "skeleton-transformer-Pytorch",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "skeletorch"
}