test.py
Go to the documentation of this file.
00001 #!/usr/bin/python
00002 import roslib; roslib.load_manifest('laser_camera_segmentation')
00003 
00004 print 'TEST script!!!'
00005 
00006 # Import Psyco if available
00007 try:
00008     import psyco
00009     psyco.full()
00010     print "Psyco loaded"
00011 except ImportError:
00012     pass
00013 
00014 import laser_camera_segmentation.processor as processor
00015 import laser_camera_segmentation.configuration as configuration       
00016         
00017 import time 
00018 
00019 def getTime():
00020     return '['+time.strftime("%H:%M:%S", time.localtime())+']'
00021         
00022         
00023 def generate_train_save():        
00024     #pc.load_data(id)
00025     #print getTime(), 'generate and save features...'   
00026     #pc.generate_save_features(True, True)  
00027     pc.load_data(id)
00028     print getTime(), 'train_and_save_Classifiers...'   
00029     pc.train_and_save_Classifiers()
00030 
00031 def print_test():
00032     print getTime(), 'testing:',pc.feature_type,'k=',pc.feature_neighborhood,'r=',pc.feature_radius
00033    
00034    
00035    
00036 print getTime(), 'start'    
00037         
00038         
00039 cfg = configuration.configuration('/home/martin/robot1_data/usr/martin/laser_camera_segmentation/labeling')
00040 #sc = scanner.scanner(cfg)
00041 pc = processor.processor(cfg)
00042 #generate all features and train Classifiers
00043 id = '2009Oct30_162400'
00044 
00045 
00046 
00047 #pc.classifier_training_size = 1000000000
00048 #pc.feature_neighborhood = 20
00049 #pc.feature_radius = 0.03
00050 #pc.feature_type = 'gaussian_histograms'
00051 #print_test()
00052 #generate_train_save()
00053 #pc.load_Classifiers()
00054 #pc.test_classifiers_on_testset()
00055 #pc.update_test_postprocessing_on_testset()
00056 
00057 labels, testresults = pc.load_classifier_and_test_on_dataset('all_post', id)
00058 print 'testresults', testresults
00059 import numpy as np
00060 print np.shape(labels)
00061 print labels
00062 
00063 import sys
00064 
00065 #sys.exit()
00066 
00067 
00068 
00069 print getTime(), 'done'
00070 
00071 
00072 
00073 


laser_camera_segmentation
Author(s): Martin Schuster, Advisor: Prof. Charlie Kemp, Lab: Healthcare Robotics Lab at Georgia Tech
autogenerated on Wed Nov 27 2013 11:56:44