Skip to main content

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/

Release files for olympic-sports 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for olympic-sports 0.0.2
File Size Uploaded
olympic_sports-0.0.2.tar.gz 128.6 kB Details

Release files / olympic_sports-0.0.2.tar.gz

Download URL olympic_sports-0.0.2.tar.gz
Size 128.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7a851de619c2ecd016ef48782dfc7f4d2ff480c5870a5eb2f1d740d46d13823d
BLAKE2b-256 checksum
How to use checksums
ec3685024b08f1821c08020092c9e6774235b10e2b1e1b9060a80b7cbe618ca9
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page