def run(self):
        while not self.kill_received:
             # get a task
            try:
                job = self.work_queue.get_nowait()
            except Queue.Empty:
                break
                
            dbrec3d_batch.register_processes();
            dbrec3d_batch.register_datatypes();
            
            start_time = time.time();
            dbrec3d_batch.set_stdout('logs/log_' + str(os.getpid())+ ".txt");

            dbrec3d_batch.init_process("bofKMeansSubsampleProcess");
            dbrec3d_batch.set_input_string(0, job.bof_path);
            dbrec3d_batch.set_input_string(1, job.starting_means_path);
            dbrec3d_batch.set_input_double(2, job.fraction);
            dbrec3d_batch.set_input_unsigned(3, job.max_it);
            dbrec3d_batch.set_input_string(4, job.file_out);
            dbrec3d_batch.run_process();
            
            dbrec3d_batch.clear();
            dbrec3d_batch.reset_stdout();
            print ("Runing time for worker:", self.name)
            print(time.time() - start_time);
 def run(self):
     while not self.kill_received:
          # get a task
         try:
             job = self.work_queue.get_nowait()
         except Queue.Empty:
             break
         
         start_time = time.time();
         dbrec3d_batch.set_stdout('logs/log_' + str(os.getpid())+ ".txt");
         
         dbrec3d_batch.init_process("bof_learn_category_codebook_salient_process");
         dbrec3d_batch.set_input_from_db(0,job.categories);
         dbrec3d_batch.set_input_unsigned(1, job.class_id);
         dbrec3d_batch.set_input_unsigned(2, job.num_means);
         dbrec3d_batch.set_input_double(3, job.fraction);
         dbrec3d_batch.set_input_unsigned(4, job.J);
         dbrec3d_batch.set_input_unsigned(5, job.max_it);
         dbrec3d_batch.set_input_float(6, job.top_p);
         dbrec3d_batch.set_input_string(7, job.class_mean_dir);
         dbrec3d_batch.run_process();
         
         
         dbrec3d_batch.clear();
         dbrec3d_batch.reset_stdout();
Ejemplo n.º 3
0
    def run(self):
        while not self.kill_received:
             # get a task
            try:
                job = self.work_queue.get_nowait()
            except Queue.Empty:
                break
            
            start_time = time.time();
            
            dbrec3d_batch.set_stdout('logs/log_' + str(os.getpid())+ ".txt");
            dbrec3d_batch.init_process("bofKMeansTrainProcess");
            dbrec3d_batch.set_input_string(0, job.bof_path);
            dbrec3d_batch.set_input_string(1, job.starting_means_path);
            dbrec3d_batch.set_input_int(2, job.scene_id);
            dbrec3d_batch.set_input_int(3, job.block_i);
            dbrec3d_batch.set_input_int(4, job.block_j);
            dbrec3d_batch.set_input_int(5, job.block_k);
            dbrec3d_batch.set_input_unsigned(6, job.max_it);
            dbrec3d_batch.set_input_string(7, job.file_out);
            dbrec3d_batch.run_process();
            
            dbrec3d_batch.clear();
            dbrec3d_batch.reset_stdout();
 
            print ("Runing time for worker:", self.name)
            print(time.time() - start_time);
    def run(self):
        while not self.kill_received:
             # get a task
            try:
                job = self.work_queue.get_nowait()
            except Queue.Empty:
                break
            
            start_time = time.time();
            
            dbrec3d_batch.set_stdout('logs/log_' + str(os.getpid())+ ".txt");

            dbrec3d_batch.init_process("bof_sample_statistics_process");
            dbrec3d_batch.set_input_from_db(0,job.categories);
            dbrec3d_batch.set_input_from_db(1,job.global_pca);
            dbrec3d_batch.set_input_unsigned(2, job.scene_id);
            dbrec3d_batch.set_input_string(3, job.file_out);
            dbrec3d_batch.run_process();
            
            dbrec3d_batch.clear();
            dbrec3d_batch.reset_stdout();

 
            print ("Runing time for worker:", self.name)
            print(time.time() - start_time);
Ejemplo n.º 5
0
  def run(self):
    while not self.kill_received:
      # get a task
      try:
        job = self.work_queue.get_nowait()
      except Queue.Empty:
        break
      
      start_time = time.time();
      #dbrec3d_batch.set_stdout('logs/log_' + str(os.getpid())+ ".txt");
      
#      file_in = str(job.pcl_dir) + "/object_" + str(job.object_id) + ".pcd"; 
#      file_out = str(job.pcl_dir) + "/fpfh_object_" + str(job.object_id) + ".pcd";
    
#      file_in = str(job.pcl_dir) + "/boxm_scili.pcd"; 
#      file_out = str(job.pcl_dir) + "/fpfh_boxm_scili.pcd"; 

      file_in = str(job.pcl_dir) + "/mesh_0.ply"; 
      file_out = str(job.pcl_dir) + "/fpfh_mesh_0.pcd"; 

      dbrec3d_batch.init_process("pcl_compute_fphf_process");
      dbrec3d_batch.set_input_string(0, file_in);
      dbrec3d_batch.set_input_double(1, job.radius);
      dbrec3d_batch.set_input_string(2, file_out);
      dbrec3d_batch.run_process();
      
      dbrec3d_batch.clear();
      #dbrec3d_batch.reset_stdout();
      print ("Runing time for worker:", self.name)
      print(time.time() - start_time);
Ejemplo n.º 6
0
    def run(self):
        while not self.kill_received:
             # get a task
            try:
                job = self.work_queue.get_nowait()
            except Queue.Empty:
                break
            
            start_time = time.time();
            
            time.sleep(10);
            
            #dbrec3d_batch.set_stdout('logs/log_' + str(os.getpid())+ ".txt");
            dbrec3d_batch.init_process("bofMakeClusterIdSceneProcess");
            dbrec3d_batch.set_input_string(0, job.bof_path);
            dbrec3d_batch.set_input_from_db(1, job.codebook);
            dbrec3d_batch.set_input_int(2, job.scene_id);
            dbrec3d_batch.set_input_int(3, job.block_i);
            dbrec3d_batch.set_input_int(4, job.block_j);
            dbrec3d_batch.set_input_int(5, job.block_k);
            dbrec3d_batch.run_process();
            
            dbrec3d_batch.clear();
            #dbrec3d_batch.reset_stdout();
 
            print ("Runing time for worker:", self.name)
            print(time.time() - start_time);
    def run(self):
        while not self.kill_received:
             # get a task
            try:
                job = self.work_queue.get_nowait()
            except Queue.Empty:
                break
            
            start_time = time.time();
            
            dbrec3d_batch.set_stdout('logs/log_' + str(os.getpid())+ ".txt");

            dbrec3d_batch.init_process("bofKMeansOnVectorProcess");
            dbrec3d_batch.set_input_string(0, job.cm_i_file);
            dbrec3d_batch.set_input_from_db(1, job.CM_set);
            dbrec3d_batch.set_input_unsigned(2, job.max_it);
            dbrec3d_batch.set_input_string(3, job.fm_i_file);
            dbrec3d_batch.run_process();
            
            dbrec3d_batch.clear();
            dbrec3d_batch.reset_stdout();

 
            print ("Runing time for worker:", self.name)
            print(time.time() - start_time);
  def run(self):
    while not self.kill_received:
      # get a task
      try:
        job = self.work_queue.get_nowait()
      except Queue.Empty:
        break
      
      start_time = time.time();
      #dbrec3d_batch.set_stdout('logs/log_' + str(os.getpid())+ ".txt");
      
#      file_in = str(job.pcl_dir) + "/object_" + str(job.object_id) + ".pcd"; 
#      file_out = str(job.pcl_dir) + "/fpfh_object_" + str(job.object_id) + ".pcd";
    
#      file_in = str(job.pcl_dir) + "/boxm_scili.pcd"; 
#      file_out = str(job.pcl_dir) + "/fpfh_boxm_scili.pcd"; 
#      file_in="/Projects/pcl_dev/pcl/trunk/test/bun0.pcd"
      file_in = str(job.pcl_dir) + "/mesh_0.ply"; 
      file_out = str(job.pcl_dir) + "/spin_mesh_0.pcd"; 

      dbrec3d_batch.init_process("pcl_compute_spin_image_process");
      dbrec3d_batch.set_input_string(0, file_in);
      dbrec3d_batch.set_input_double(1, job.radius);
      dbrec3d_batch.set_input_int(2, job.width);
      dbrec3d_batch.set_input_double(3, job.sup_angle);
      dbrec3d_batch.set_input_int(4, job.num_neighbors);
      dbrec3d_batch.set_input_bool(5, job.radial);
      dbrec3d_batch.set_input_bool(6, job.angular);
      dbrec3d_batch.set_input_string(7, file_out);
      dbrec3d_batch.run_process();
      
      dbrec3d_batch.clear();
      #dbrec3d_batch.reset_stdout();
      print ("Runing time for worker:", self.name)
      print(time.time() - start_time);
 def run(self):
     while not self.kill_received:
          # get a task
         try:
             job = self.work_queue.get_nowait()
         except Queue.Empty:
             break
             
         start_time = time.time();    
         
         print("Save Scene");
         dbrec3d_batch.init_process("bofSaveCategorySceneRawProcess");
         dbrec3d_batch.set_input_string(0,job.bof_dir);
         dbrec3d_batch.set_input_int(1, job.scene_id);
         dbrec3d_batch.run_process();
         
         print ("Runing time for worker:", self.name)
         print(time.time() - start_time);
Ejemplo n.º 10
0
    def run(self):
        while not self.kill_received:
             # get a task
            try:
                job = self.work_queue.get_nowait()
            except Queue.Empty:
                break
            
            start_time = time.time();
            dbrec3d_batch.set_stdout('logs/log_' + str(os.getpid())+ ".txt");

            dbrec3d_batch.init_process("bofLearnCategoriesProcess");
            dbrec3d_batch.set_input_from_db(0, job.codebook);
            dbrec3d_batch.set_input_int(1, job.scene_id);
            dbrec3d_batch.set_input_string(2, job.bof_dir);
            dbrec3d_batch.set_input_string(3, job.path_out);
            dbrec3d_batch.run_process();
            
            dbrec3d_batch.clear();
            dbrec3d_batch.reset_stdout();
    def run(self):
        while not self.kill_received:
            # get a task
            try:
                job = self.work_queue.get_nowait()
            except Queue.Empty:
                break

            start_time = time.time()
            dbrec3d_batch.set_stdout("logs/log_" + str(os.getpid()) + ".txt")

            dbrec3d_batch.init_process("bof_learn_categories_salient_process")
            dbrec3d_batch.set_input_from_db(0, job.codebook)
            dbrec3d_batch.set_input_int(1, job.scene_id)
            dbrec3d_batch.set_input_float(2, job.top_p)
            dbrec3d_batch.set_input_from_db(3, job.categories)
            dbrec3d_batch.set_input_string(4, job.path_out)
            dbrec3d_batch.run_process()

            dbrec3d_batch.clear()
            dbrec3d_batch.reset_stdout()
Ejemplo n.º 12
0
    def run(self):
        while not self.kill_received:
             # get a task
            try:
                job = self.work_queue.get_nowait()
            except Queue.Empty:
                break
            
            start_time = time.time();
            dbrec3d_batch.set_stdout('logs/log_' + str(os.getpid())+ ".txt");

            dbrec3d_batch.init_process("bofClassifyProcess");
            dbrec3d_batch.set_input_from_db(0, job.codebook);
            dbrec3d_batch.set_input_from_db(1, job.p_xc);
            dbrec3d_batch.set_input_int(2, job.scene_id);
            dbrec3d_batch.set_input_string(3, job.bof_dir);
            dbrec3d_batch.set_input_string(4, job.path_out);
            dbrec3d_batch.run_process();
            
            dbrec3d_batch.clear();
            dbrec3d_batch.reset_stdout();
            print ("Runing time for worker:", self.name)
            print(time.time() - start_time);
import dbrec3d_batch;
import os;
import optparse;

dbrec3d_batch.register_processes();
dbrec3d_batch.register_datatypes();

class dbvalue:
  def __init__(self, index, type):
    self.id = index    # unsigned integer
    self.type = type   # string

#grad_scene_path = "/Users/isa/Experiments/boxm_scili_full/steerable_filters_alpha/steerable_gauss_3d_scene.xml"
#valid_scene_path = "/Users/isa/Experiments/boxm_scili_full/steerable_filters_alpha/valid_scene.xml"
#pcd_file = "/Users/isa/Experiments/pcl/tests/boxm_scili_full.pcd"

#Run k-means
pcl_dir = "/Users/isa/Experiments/pcl/tests"
xyznormal_file = pcl_dir + "/boxm_scili.pcd";
fpfh_file =pcl_dir + "/fpfh_boxm_scili.pcd"; 
means_file = pcl_dir + "/means_50_scili/lowest_sse_means.txt"
output_dir = pcl_dir + "/means_50_scili";

dbrec3d_batch.init_process("pcl_k_means_assign_process");
dbrec3d_batch.set_input_string(0, xyznormal_file);
dbrec3d_batch.set_input_string(1, fpfh_file);
dbrec3d_batch.set_input_string(2,  means_file);
dbrec3d_batch.set_input_string(3,  output_dir);

dbrec3d_batch.run_process();