Skip to main content

Pytorch implementation of skeleton transformer module

Project description

Skeleton Transformer Module in Pytorch

Pytorch implementation of "skeleton transformer module", which is mentioned in Skeleton-based Action Recognition with Convolutional Neural Networks.

Install

You can install this module from PyPI.

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

skeletorch-0.1.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

skeletorch-0.1.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file skeletorch-0.1.1.tar.gz.

File metadata

  • Download URL: skeletorch-0.1.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.8

File hashes

Hashes for skeletorch-0.1.1.tar.gz
Algorithm Hash digest
SHA256 01e818bf947234b0525dff5c22ef62006081917d26a7772aa2793da9321b27ac
MD5 c271001a5564d82099d9a05526aad90f
BLAKE2b-256 b6d63a693f043e3ec382839c50828295b6de7a854f60d07a62cb8d23fea5b04a

See more details on using hashes here.

File details

Details for the file skeletorch-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: skeletorch-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.8

File hashes

Hashes for skeletorch-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d24c9c1cd03ad25f3f512d1cbc57ffde14e71d3efe8b63d3b7dbeb21f2a22679
MD5 e5e2c44e7a7d90b98ae89bf32dcce84a
BLAKE2b-256 2c5fcfe8e7b2c996c75e34db475fc45e0160ebdec6b410a104b2fdff3001ee62

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page