Last active
April 21, 2020 04:39
-
-
Save ferreirafabio/60323a87ba80c052ab272ff769149577 to your computer and use it in GitHub Desktop.
full example for executing the pipeline in the py-video-features package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from videofeatures import Pipeline, ActivityNetDataset, TwentyBNDataset, ResNetFeatures, SIFTFeatures, VGGFeatures, SURFFeatures | |
import configparser | |
_base_dir = "./output" | |
config = configparser.ConfigParser() | |
config.read('config.ini') | |
train_dir = config['GULP']['train_data_gulp'] | |
valid_dir = config['GULP']['valid_data_gulp'] | |
twentybn_train = ArmarDataset(batch_size=20, train_dir=train_dir, valid_dir=valid_dir).getDataLoader(train=True) | |
resnet = ResNetFeatures() | |
pipeline = Pipeline(dataset=twentybn_train, extractor=resnet, base_dir=_base_dir) | |
features, labels = pipeline.extractFeatures() | |
fisher_vector_gmm = pipeline.trainFisherVectorGMM(features) | |
fisher_vectors, labels = pipeline.computeFisherVectors(features=features, labels=labels, fv_gmm=fisher_vector_gmm) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I'm having some trouble gulping a custom dataset for extractor. Do you have an example on how to do it?