Skip to main content

Olympic sports tools package

Project description

olympic_sports_tools

This repo contains two scripts that help parsing the Olympic Sports dataset, from the following publication:

Juan Carlos Niebles, Chih-Wei Chen and Li Fei-Fei, "Modeling Temporal Structure of Decomposable Motion Segments for Activity Classification", ECCV 2010

Dataset's paper : http://vision.stanford.edu/documents/NieblesChenFei-Fei_ECCV2010.pdf

Dataset website : http://vision.stanford.edu/Datasets/OlympicSports/

The scripts are the following:

  1. parse_attributes.py (used to save a numpy array with some class-related attributes)

  2. convert_Olympic.py (used to convert the videos from .seq to .avi format)


Parsing class-related attributes

The class-related attributes are taken from the following publication:

J. Liu, B. Kuipers, S. Savarese, "Recognizing Human Actions by Attributes", CVPR 2011

Publication link : http://cvgl.stanford.edu/papers/cvpr11_liu_a.pdf

Technical report : http://www.cs.ucf.edu/%7Eliujg/papers/cvpr11_liu_a_tech_report.pdf

The unprocessed attributes are copied from Table 3 in the paper's technical report, and pasted in this file :

Olympic_Attributes.txt

We have 16 classes of the Olympic Sports dataset, and 40 attributes.

Then, we execute

from olympic_sports.parse_attributes import read_attributes
attributes, class_list, attribute_list = read_attributes()

and save the following 3 variables in the 'attributes.npz' file:

  • attributes : The attributes are stored in a numpy array of size 16x40, containing ones and zeros.

Values of 1 (integer) in the cell (i,j), mean that the i-th class has the j-th attribute.

Values of 0 (integer) mean that the i-th class does not have the j-th attribute.

  • attribute_names : List of the attribute names

  • class_names : List of the class names

You can see the correspondences in the saved Attributes_Olympic.png image.


Converting the videos from .seq to .avi format

To convert the videos of the dataset from .seq file format to .avi, we execute:

convert-olympic [path-seq-files]

This script will need a file named "video_Olympic.list", containing all the videos. This file already exists in this repo. If you want to create this on your own for a modified version of the dataset, you can execute the following command:

ls /path/to/your/dataset/*/*.seq > video_Olympic.list

Then using a text editor you can simply find and replace the substring of the exported directories, so that you only keep the class names and the video names in your final file (as in the already saved file). The folder location should be in the repo under olympic_sports/resources or in the enviroment directory.


Credits go to @psycharo, for his useful gist to read .seq files, that is used in this repo. https://gist.github.com/psycharo/7e6422a491d93e1e3219/

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

olympic_sports-0.0.1.tar.gz (128.3 kB view details)

Uploaded Source

File details

Details for the file olympic_sports-0.0.1.tar.gz.

File metadata

  • Download URL: olympic_sports-0.0.1.tar.gz
  • Upload date:
  • Size: 128.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.2 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10

File hashes

Hashes for olympic_sports-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c10dcc6a3d33989b903a9a3a93efa7dc5cf52733211b271214f11d34fecdec88
MD5 44cd097d47a992a3260240a753975039
BLAKE2b-256 b86efdde732b748d47bbbb7619b5eb3ef53a3701c378b1ce568a676aab9e69a2

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