Action/Interaction Recognition (ECCV '14, CVPR '15) - Validation Data
Evaluation metrics
On the file ChalearnLAPEvaluation.py there are some methods for evaluation. The first important script allows to export the labels of a set of samples into a ground truth folder, to be used to get the final ovelap value. Let's assume that you use the sequences 1 to 3 for validation purposes, and have a folder valSamples with the files Seq01.zip to Seq03.zip as you downloaded from the training data set. We can create a ground truth folder gtData using:
>> from ChalearnLAPEvaluation import exportGT_Action
>> exportGT_Action(valSamples,gtData)
This method exports the label files and data files for each sample in the valSample folder to the gtData folder. This new ground truth folder will be used by evaluation methods.
For each sample, we need to store the actions predictions in a CSV file in the same format that labels are provided, that is, a line for each action instance with the actionID, the initial frame and the final frame. This file must be named as Seqxx_predictions.csv. To make it easy, the class ActionSample allows to store this information for a given sample. Following the example from last section, we can store the predictions for sample using:
>> from ChalearnLAPSample import ActionSample
>> actionSample = ActionSample("SeqXX.zip")
Now, if our predictions are that we have the action 1 from frame 102 to 203 and action 5 from frame 250 to 325, and we want to store predictions in a certain foldervalPredict, we can use the following code:
>> actionSample = ActionSample("SeqXX.zip")
>> actionSample.exportPredictions(([1,102,203], [5,250,325]),valPredict)
Assuming previous defined paths and objects, to evaluate the overlap for a single labeled sample prediction, that is, prediction for a sample from a set where labels are provided, we can use:
>> overlap=actionSample.evaluate(gtData)
Finally, to obtain the final score for all the predictions, in the same way performed in the Codalab platform, we use:
>> from ChalearnLAPEvaluation import exportGT_Action
>> score=evalAction(valPredict,gtData)