data_generator.reset() print('Predict data time: %.3f s' % (time.time() - start_time)) del model2 # Save to .corpus print 'Create corpus' sys.stdout.flush() save_corpus(CORPUS_FILE,X_data_gap) # Create inverted index print 'Create inverted index' sys.stdout.flush() smhHelper.createInvertedIndex(CORPUS_FILE,INVERT_INDEX_FILE) # Create model print 'Create model' start_time = time.time() smhHelper.createModel(CORPUS_FILE,INVERT_INDEX_FILE,MODEL_FILE) print('Create model time: %.3f s' % (time.time() - start_time)) sys.stdout.flush() # Create ranking file start_time = time.time() Y_data = selectModels.selectModels(NUM_CLASSES,MODEL_FILE,INVERT_INDEX_FILE,TOTAL_IMAGES) print('Select models time: %.3f s' % (time.time() - start_time)) sys.stdout.flush() # Evaluate MAPP start_time = time.time() execfile('rankingImages.py') print('ranking images time: %.3f s' % (time.time() - start_time)) sys.stdout.flush()
import sys sys.path.append('../common/') import smhHelper smhHelper.createModel('google.corpus', 'google.ifs', 'google.model')