def widen_model(seed_image_id, max_test_id, max_value_cutoff): for test_id in range(0, max_test_id + 1): for x in range(0, 2): filedata = get_single_lmdb_filedata(seed_image_id, max_value_cutoff) run_train_test(seed_image_id, filedata, max_value_cutoff, test_id) image_set.create_composite_images(crop_dir, data_dir, 120, 8, 20)
def retrain_widened_seed(seed_image_id, cut_off): # This did not seem to add much to the model # usage: retrain_widened_seed(7855,27) max_value_cutoff = 10 read_all_results(max_value_cutoff, seeds_share_test_images=False, remove_widened_seeds=True) filedata = get_single_lmdb_filedata(seed_image_id, cut_off) run_train_test(seed_image_id, filedata, max_value_cutoff, test_id=5,multi_image_training = True) read_all_results(max_value_cutoff, seeds_share_test_images=False, remove_widened_seeds=True) image_set.create_composite_images(crop_dir, data_dir, crop_size=140, rows=50, cols=10)
# # run_script(train_dir + str(seed_image_id) + '/train-single-coin-lmdbs.sh') # create_test_script(seed_image_id, 0, True) # scripts_to_run.append(test_dir + str(0) + '/test-' + str(seed_image_id) + '.sh') # #run_script(test_dir + str(0) + '/test-' + str(seed_image_id) + '.sh') # run_scripts(scripts_to_run,max_workers=6) # # read_test(seed_image_ids, 360) # image_set.read_results(0, data_dir, seeds_share_test_images=False, bad_coin_ids=bad_coin_ids, ground_truth=ground_truth) image_set.read_results(0, data_dir, seeds_share_test_images=False) multi_point_error_test_image_ids = get_multi_point_error_test_image_ids() print 'The following test_image_ids where taking out of the image:' print multi_point_error_test_image_ids print 'multi_point_error_test_image_ids length:' + str( len(multi_point_error_test_image_ids)) image_set.create_composite_images(crop_dir, data_dir, 125, 40, 10, None, multi_point_error_test_image_ids, True) #image_set.create_composite_images(crop_dir, data_dir, 125, 40, 10, None, multi_point_error_test_image_ids, True) #image_set.create_composite_image(crop_dir, data_dir, 140, 100, 10, multi_point_error_test_image_ids) print 'Done in %s seconds' % (time.time() - start_time, ) sys.exit("End") # ******** # Step 2: # Then widen the seed to include all crops in all results for each seed: # Check out the results in the png # Note the cutoff # This should be changed to include the step 3 double check for seed_image_id in widen_seed_image_ids: cutoff = 13