xiadingZ / video-caption.pytorch

pytorch implementation of video captioning
MIT License
400 stars 128 forks source link

c3d feats extraction example #8

Closed dmandreev closed 6 years ago

dmandreev commented 6 years ago

Hello! Thank you for your work! Is c3d features currently not supported? I saw some traces in sources, but not sure. Could you please give any hints? Is these features have to be extracted as resnet features and later simply jointed?

xiadingZ commented 6 years ago

It supports. you can use video-classification-3d-cnn-pytorch to extract c3d features, then mean pool to get 2048 dim feature for each video

Sciroccogti commented 4 years ago

Hi! I do used the repo video-classification-3d-cnn-pytorch, but its output is a json. How can I use that with your codes?

Thank you for your work!

Sciroccogti commented 4 years ago

I used this to turn the json into npy:

import json
import numpy as np
import os

videos = json.load(open('./output.json', 'r'))

if not os.path.exists("data/3dfeature/"):
    os.makedirs("data/3dfeature/")

for video in videos:
    name = str(video["video"].split(".")[0])
    segments = video["clips"]
    feat = []
    for segment in segments:
        feat += segment["features"]
    np.save("data/3dfeature/" + name + ".npy", feat)