Esempio n. 1
0
def computeIDTFs(training_samples, VID_DIR, dataset):
    """
    Computes the IDTFs specifically used for constructing the GMM
    training_samples is a list of videos located at the VID_DIR directory.
    The IDT features are output in the GMM_dir.
    """
    if dataset == "UCF101":
        for video in training_samples:
            print(VID_DIR)
            print(video)
            # input('...')
            videoLocation = os.path.join(VID_DIR, video)
            featureOutput = os.path.join(
                GMM_dir,
                os.path.basename(video)[:-4] + ".features")
            print "Computing IDTF for %s" % (video)
            computeIDTF.extract(videoLocation, featureOutput, dataset)
            # input('...')
            print "complete."
    else:
        for video in training_samples:
            print(VID_DIR)
            print(video)
            # input('...')
            videoLocation = os.path.join(VID_DIR, video)
            featureOutput = os.path.join(GMM_dir,
                                         os.path.basename(video) + ".features")
            print "Computing IDTF for %s" % (video)
            computeIDTF.extract(videoLocation, featureOutput, dataset)
            # input('...')
            print "complete."
Esempio n. 2
0
def computeIDTFs(training_samples, VID_DIR):
    """
    Computes the IDTFs specifically used for constructing the GMM
    training_samples is a list of videos located at the VID_DIR directory.
    The IDT features are output in the GMM_dir.
    """
    for video in training_samples:
        videoLocation = os.path.join(VID_DIR,video)
        featureOutput = os.path.join(GMM_dir,os.path.basename(video)[:-4]+".features")
        print "Computing IDTF for %s" % (video)
        computeIDTF.extract(videoLocation, featureOutput)
        print "complete."  
Esempio n. 3
0
def computeIDTFs(training_samples, VID_DIR, IDT_DIR):
    """
    Computes the IDTFs specifically used for constructing the GMM
    training_samples is a list of videos located at the VID_DIR directory.
    The IDT features are output in the IDT_DIR.
    """
    for video in training_samples:
        video_file = os.path.join(VID_DIR,video)
        output_file = os.path.join(IDT_DIR,os.path.splitext(video)[0]+'.bin')
        print "Computing IDTF for %s" % (video)
        computeIDTF.extract(video_file, output_file)
        print "complete."  
Esempio n. 4
0
def computeIDTFs(training_samples, VID_DIR, IDT_DIR):
    """
    Computes the IDTFs specifically used for constructing the GMM
    training_samples is a list of videos located at the VID_DIR directory.
    The IDT features are output in the IDT_DIR.
    """
    for video in training_samples:
        video_file = os.path.join(VID_DIR, video)
        output_file = os.path.join(IDT_DIR,
                                   os.path.splitext(video)[0] + '.bin')
        print "Computing IDTF for %s" % (video)
        computeIDTF.extract(video_file, output_file)
        print "complete."
Esempio n. 5
0
def computeIDTFs(training_samples, VID_DIR):
    """
    Computes the IDTFs specifically used for constructing the GMM
    training_samples is a list of videos located at the VID_DIR directory.
    The IDT features are output in the GMM_dir.
    """
    for video in training_samples:
        videoLocation = os.path.join(VID_DIR, video)
        featureOutput = os.path.join(
            GMM_dir,
            os.path.basename(video)[:-4] + ".features")
        if os.path.exists(featureOutput):
            print "File exists: " + featureOutput
        else:
            print "Computing IDTF for %s" % (video)
            computeIDTF.extract(videoLocation, featureOutput)
            print "complete."
Esempio n. 6
0
def computeIDTFs(vid_list, TMP_FEATURES):
    """
    Computes the IDTFs specifically used for constructing the GMM
    vid_list list of videos in the format: ['vid_name'] [class#]

    The IDT features are output in TMP_FEATURES directory in Project_DIR

    Precondition: TMP_FEATURES directory does not yet exist.
    """
    os.makedirs(TMP_FEATURES)

    for line in vid_list:
        videoLocation = line.split()[0]
        featureOutput = os.path.join(TMP_FEATURES,os.path.basename(videoLocation).split('.')[0]+".features")
        print "Computing IDTF for %s" % (os.path.basename(videoLocation))
        computeIDTF.extract(videoLocation, featureOutput)
        print "complete."