Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to generate the annotation file like"example.csv" #3

Open
sucaohan opened this issue May 12, 2019 · 1 comment
Open

How to generate the annotation file like"example.csv" #3

sucaohan opened this issue May 12, 2019 · 1 comment

Comments

@sucaohan
Copy link

Hello,I have downloaded the JHMDB dataset,but I don't know how to generate the annotation file like"example.csv",can you tell me?

@agethen
Copy link
Owner

agethen commented May 15, 2019

Sorry for the late answer!

You will need to write your own script for that. The field id is the video name; actions is a collection of actions class ts te separated by ';', where ts is the start time and te the end time. Finally, length is the length of the video in seconds.

For many action recognition datasets, no ts or te are given, so you may just set them to 0.0 and the length of the video (in s).

Your code could look sth like this (python):

lines_annotation = [l.strip() for l in open( INPUT_FILE )]
output_file = open( OUTPUT_FILE, 'w' )

output_file.write( "id,actions,length\n" )
for l in lines_annotation:
  tokens = l.split( ... ) # Split by some character. Which one depends on dataset.
  video_name = tokens[ ... ]
  class_id = ...
  ts = ...
  te = ...
  len_in_s = ...
  output_file.write( video_name + "," + class_id + " " + ts +  " " + te + "," + len_in_s + "\n" )
output_file.close()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants