def loadDataFromH5File(input_file, adjective_file):
   
    # Takes the input h5 file and converts into bolt object data
    all_bolt_data = utilities.convertH5ToBoltObjFile(input_file, None, False);
   
    # Inserts adjectives into the bolt_data  
    all_bolt_data_adj = utilities.insertAdjectiveLabels(all_bolt_data, "all_objects_majority4.pkl", adjective_file, True)

    return all_bolt_data_adj
def loadDataFromH5File(input_file, adjective_file):
   
    # Takes the input h5 file and converts into bolt object data
    all_bolt_data = utilities.convertH5ToBoltObjFile(input_file, None, False);
   
    # Inserts adjectives into the bolt_data  
    all_bolt_data_adj = utilities.insertAdjectiveLabels(all_bolt_data, "all_objects_majority4.pkl", adjective_file, True)
    
    return all_bolt_data_adj
def loadDataFromH5File(input_file, output_file, adjective_file):

    # Takes the input h5 file and converts into bolt object data
    all_bolt_data = utilities.convertH5ToBoltObjFile(input_file, None, False);

    # Inserts adjectives into the bolt_data  
    all_bolt_data_adj = utilities.insertAdjectiveLabels(all_bolt_data, output_file, adjective_file, False)

    # Load pickle file
    pca_dict = cPickle.load(open('pca.pkl', 'r'))

    all_feature_obj = BoltMotionObjToFeatureObj(all_bolt_data_adj, pca_dict) 

    cPickle.dump(all_feature_obj, open('aluminum_bar_701_01.pkl', 'w')) 
    import pdb; pdb.set_trace()
    return all_feature_obj
Esempio n. 4
0
def loadDataFromH5File(input_file, output_file, adjective_file):

    # Takes the input h5 file and converts into bolt object data
    all_bolt_data = utilities.convertH5ToBoltObjFile(input_file, None, False)

    # Inserts adjectives into the bolt_data
    all_bolt_data_adj = utilities.insertAdjectiveLabels(
        all_bolt_data, output_file, adjective_file, False)

    # Load pickle file
    pca_dict = cPickle.load(open('pca.pkl', 'r'))

    all_feature_obj = BoltMotionObjToFeatureObj(all_bolt_data_adj, pca_dict)

    cPickle.dump(all_feature_obj, open('aluminum_bar_701_01.pkl', 'w'))
    import pdb
    pdb.set_trace()
    return all_feature_obj
def build_feature_objects(bolt_data, output_file, adjective_file, electrode_pca_dict):

    # Inserts adjectives into the bolt_data  
    all_bolt_data_adj = utilities.insertAdjectiveLabels(bolt_data, output_file, adjective_file, False)

    if electrode_pca_dict == None:
        print "Building Train Set"
        pca_dict = extract_features.fit_electrodes_pca(all_bolt_data_adj)
    else:
        pca_dict = electrode_pca_dict
        print "Building Test Set"
    
    # Load pickle file
    #pca_dict = cPickle.load(open('pca.pkl', 'r'))

    all_feature_obj = BoltMotionObjToFeatureObj(all_bolt_data_adj, pca_dict) 

    cPickle.dump(all_feature_obj, open(output_file, 'w')) 

    return pca_dict