def _preprocess_setup(self): """Apply desired pre_processing to the input """ self.preprocess_funcs = [] if self.random_crop: self.preprocess_funcs.append( U.random_crop(int(self.inputLength * self.audio_rate))) if self.normalize: self.preprocess_funcs.append(U.normalize(2147483648.0))
def _preprocess_setup(self): """Apply desired pre_processing to the input """ self.preprocess_funcs = [] if self.strongAugment: self.preprocess_funcs.append(U.random_scale(1.25)) if self.pad > 0: self.preprocess_funcs.append(U.padding(self.pad)) if self.random_crop: self.preprocess_funcs.append( U.random_crop(int(self.inputLength * self.audio_rate))) if self.normalize is True: self.preprocess_funcs.append(U.normalize(32768.0))
def make_table_fmtfiles(self, header, file_format): imgname = 'image_filename: ' + str(image_info['image_filename']) format_heading = 'Format: '+file_format # Write the headlines for the table: self.underline = 1 self.set_font('Times','B',10) self.cell(0, 6, 'Disk Image: '+filename_from_path(imgname), ln=1) self.cell(0, 12, format_heading, border=0, ln=1) self.underline = 0 # Set Colimn width w = [16,150] #Colors, line width and bold font self.set_table_hdr_attributes(w, header) #Color and font restoration self.set_table_body_attributes() fill=0 num_files = 0 for i in range(0, len(FiwalkReport.fiDictList)): if (FiwalkReport.xmlInput == True): mystr = FiwalkReport.fiDictList[i]['libmagic'] else: mystr = bc_utils.normalize(FiwalkReport.fiDictList[i]['libmagic']) if mystr == file_format: num_files+=1 ###self.cell(w[0],6,str(num_files),'LR',0,'L',fill) self.cell(w[0],6,str(FiwalkReport.fiDictList[i]['partition']),'LR',0,'L',fill) mystr = (FiwalkReport.fiDictList[i]['filename']) text = bc_pdf.bc_adjust_text(mystr, w[1]) self.cell(w[1],6,text,'LR',0,'L',fill) self.ln() fill=not fill bc_pdf.bc_table_end_page(self, FiwalkReport, num_files, header, w) self.cell(sum(w),0,'','T') return