def __init__(self, data_dir, max_time=None): self.text_renderer = tu.RenderFont(data_dir) self.colorizer = Colorize(data_dir) self.min_char_height = 8 # px self.min_asp_ratio = 0.4 # self.max_text_regions = 7 self.max_time = max_time
def __init__(self, data_dir, max_time=None, text_number=1, font_color_user = None, font_size_user = 18, text_content_user = "******") : self.text_renderer = tu.RenderFont( data_dir, font_size_user, text_content_user) self.colorizer = Colorize(data_dir, font_color= font_color_user) self.NUM_REP = text_number self.min_char_height = 8 #px self.min_asp_ratio = 0.4 # self.max_text_regions = 7 self.max_time = max_time
def __init__(self, data_dir, max_time=None): self.text_renderer = tu.RenderFont(data_dir) self.colorizer = Colorize(data_dir) #self.colorizerV2 = colorV2.Colorize(data_dir) self.min_char_height = 8#8 #px self.min_asp_ratio = 0.4#0.4 # self.max_text_regions = 1#Rohit changed from 7 to 1 self.max_time = max_time
bboxs_of_images.append(bboxs_of_curimg) textcolors_of_images.append(textcolors_of_curimg) fileCnt+=1 return bboxs_of_images, textcolors_of_images, fileCnt WINDOW_H=720.0 WINDOW_W=1080.0 REPEAT = 1 DATA_PATH = '../fonts&corpus' traj_file = open(TRAJ_PATH) location, rotation = load_loc_rot(traj_file) bboxs_of_images, textcolors_of_images, fileCnt = get_bboxes_text_colors(BBOX_PATH, TEXTCOLOR_PATH) text_renderer = tu.RenderFont(DATA_PATH) text_renderer.setStoredToPath(TEXTURE_PATH); print('trajectory, boxes, text renderer loaded') allIndex = [i for i in range(fileCnt-1)] curCnt=random.choice(allIndex) assert len(location) == len(rotation) and len(rotation) == fileCnt-1 print(len(location),len(rotation),fileCnt) outputCnt=0 for ffi in range((fileCnt-1)*REPEAT): curCnt = ffi curLoc = location[curCnt] curRot = rotation[curCnt] client.request('vset /camera/0/location '+str(curLoc[0])+' '+str(curLoc[1])+' '+str(curLoc[2])) client.request('vset /camera/0/rotation '+str(curRot[0])+' '+str(curRot[1])+' '+str(curRot[2])) time1=time.clock()