Exemple #1
0
def texture_training(tclsf, image, exp_poly_path,texton_dict_path, name_of_category="mod", compute_textons=True):
  boxm2_batch.init_process("sdetTextureTrainingProcess");
  boxm2_batch.set_input_from_db(0,tclsf);
  boxm2_batch.set_input_bool(1,compute_textons);# compute textons
  boxm2_batch.set_input_from_db(2,image);
  boxm2_batch.set_input_string(3,exp_poly_path);
  boxm2_batch.set_input_string(4,name_of_category);
  boxm2_batch.set_input_string(5,texton_dict_path);
  boxm2_batch.run_process();
  # write out the texton dictionary on finish
  boxm2_batch.finish_process();
Exemple #2
0
def train_classifier(tclsf, poly_file, category_name, dictionary_name, compute_category_textons, finish_and_write_dictionary):
  boxm2_batch.init_process("sdetTextureTrainingProcess2");
  boxm2_batch.set_input_from_db(0,tclsf);
  if compute_category_textons:
    boxm2_batch.set_input_bool(1,1);  # compute the textons if this is the last polygon file for the category
  else:
    boxm2_batch.set_input_bool(1,0);
  boxm2_batch.set_input_string(2, poly_file);
  boxm2_batch.set_input_string(3, category_name);
  boxm2_batch.set_input_string(4, dictionary_name);
  boxm2_batch.run_process();
  (tclsf_id, tclsf_type)=boxm2_batch.commit_output(0);
  tclsf = dbvalue(tclsf_id, tclsf_type);
  if finish_and_write_dictionary:
    boxm2_batch.finish_process();
  return tclsf
Exemple #3
0
def texture_training(tclsf,
                     image,
                     exp_poly_path,
                     texton_dict_path,
                     name_of_category="mod",
                     compute_textons=True):
    boxm2_batch.init_process("sdetTextureTrainingProcess")
    boxm2_batch.set_input_from_db(0, tclsf)
    boxm2_batch.set_input_bool(1, compute_textons)  # compute textons
    boxm2_batch.set_input_from_db(2, image)
    boxm2_batch.set_input_string(3, exp_poly_path)
    boxm2_batch.set_input_string(4, name_of_category)
    boxm2_batch.set_input_string(5, texton_dict_path)
    boxm2_batch.run_process()
    # write out the texton dictionary on finish
    boxm2_batch.finish_process()