def main(): search_id_pair= [[3501,3845],[9395,12209],[90058,91110],[126257,126638],[129707, 130171]] #Find the image id you decided to use data_path = 'val2014' save_path = 'test_data/merge_seam_data/simple_merge/' for id_pair in search_id_pair: id1, id2 = id_pair im1 = cocotools.get_image(data_path,id1) im2 = cocotools.get_image(data_path,id2) combined_im = combine_horizontal(im1,im2) file_path = os.path.join(save_path,cocotools.get_filename(id1,False) + '_' + str(id2).zfill(12) + '.jpg') plt.imsave(file_path, combined_im) all_imname = cocotools.get_all_images(data_path) generate_random = 10 for i in range(generate_random): id1 = cocotools.get_cocoid(random.choice(all_imname)) id2 = cocotools.get_cocoid(random.choice(all_imname)) im1 = cocotools.get_image(data_path, id1) im2 = cocotools.get_image(data_path, id2) combined_im = combine_horizontal(im1,im2) file_path = os.path.join(save_path,cocotools.get_filename(id1,False) + '_' + str(id2).zfill(12) + '_r.jpg') plt.imsave(file_path, combined_im) #Chosen image reference #FOOD 3501 , 3690, 3845 #BASEDBALL 9395, 12209 #COLOR MATCH BUT WEIRD 90058 91110 #JUST WEIRD 126257, 126638 #JUST NO 129707, 130171 return
def main(): search_id_pairs = [[15581,86840],[436603, 446359]] #Find the image id you decided to use data_path = 'val2014' save_path = 'test_data/morph_data/' run_morph = False run_structural_morph = True for id_pair in search_id_pairs: im1 = cocotools.get_image_plt(data_path, id_pair[0]) im2 = cocotools.get_image_plt(data_path, id_pair[1]) if np.shape(im1) != np.shape(im2): print "Shape does not match" im1, im2 = cocotools.reshape_crop(im1,im2) if run_morph: file_name = cocotools.get_filename(id_pair[0], False) + '_' + str(id_pair[1]).zfill(12) generate_morph(im1,im2, file_name, save_path) if run_structural_morph: file_name = cocotools.get_filename(id_pair[0], False) + '_' + str(id_pair[1]).zfill(12) generate_structural_morph(im1,im2, file_name, save_path + '/structural_morph') """ for a in cocotools.find_annotation(id): print a """ break return
def main(): data_path = 'val2014' save_path = 'test_data/cross_dissolve_data' all_imname = cocotools.get_all_images(data_path) generate_random = 10 for i in range(generate_random): id1 = cocotools.get_cocoid(random.choice(all_imname)) id2 = cocotools.get_cocoid(random.choice(all_imname)) im1 = cocotools.get_image_plt(data_path, id1) im2 = cocotools.get_image_plt(data_path, id2) if np.shape(im1) != np.shape(im2): print "Shape does not match" im1, im2 = cocotools.reshape_crop(im1,im2) file_path = os.path.join(save_path,cocotools.get_filename(id1,False) + '_' + str(id2).zfill(12)) generate_cross_dissolve(im1,im2, file_path) return