kenshohara / 3D-ResNets-PyTorch

3D ResNets for Action Recognition (CVPR 2018)
MIT License
3.9k stars 930 forks source link

I don't have the JSON file #226

Open kpis-msa opened 3 years ago

kpis-msa commented 3 years ago

I'd like to use this model using the Japanese dataset as follows: https://actions.stair.center/

But I don't have an annotation JSON file for the below option. --annotation_path kinetics.json

Please tell me how to predict using a trained model (~/data/results/save_200.pth.)

huangyibo1996 commented 3 years ago

Hello, did you solve this problem? I got the same problem, I hope you can share the method to me, thank you so much!

huangyibo1996 commented 3 years ago

In fact, in opts.py file of the original poject, too many parameters were set to None, and I don't even know how to complement it.

h44rd commented 3 years ago

Any leads on this?

Purav-Zumkhawala commented 3 years ago

I used the following command to perform predictions using the pre-trained models

"python main.py --root_path "+%directory path where the data is stored%+" --video_path %path to extracted jpg% --annotation_path test.json "+"--result_path results --dataset %does not really matter but put ucf101 or kinetics% --resume_path "+%model_path%+" --model_depth 50 --n_classes 700 --no_train --no_val --inference --output_topk 1 --inference_batch_size 1"

Here I create the test.json myself. An entry in the json would look something like this:

{
    "labels": [%labels list%],
    "database": 
     {
         "%video_id%":
           {
                "subset": "%subsetname eg. validation, train%",
                "annotations": 
                 { 
                      "segment": [ %start frame num%, %end frame num%]
                 }
                 "video_path" : "%absolute path to video%"
           }
           %next video id%:
           {
            %same as above %
           }
    }
}
h44rd commented 3 years ago

Could you please elaborate what "annotations" should be in the case of test videos?

Purav-Zumkhawala commented 3 years ago

you need to add a dictionary that contains the "segment" key and the value for this key would be a list of 2 numbers. And those 2 numbers would be the starting and ending frame number

Rui-hue commented 1 year ago

Can you share the code that generated this. json file? Thank you! @Purav-Zumkhawala