def ret (): prevpage_callback = None nextpage_callback = None if i != 0: prevpage_callback = page_callbacks[i-1] if i+1 != len (raw_pages): nextpage_callback = page_callbacks[i+1] illustration_path = "test_bookpage.png" if i < len(illustrations): illustration_path = illustrations[i] page = Page (display, raw_pages[i], illustration_path, prevpage_callback, nextpage_callback) if i != 0: page.set_confidences ([1-float(i)/float(len(raw_pages)-1)]*page.numwords) page.show ()
#!/usr/bin/python import sys import os from page import Page SHOW_STEPS = True # change this to false if you just want to see the final output for each page. SAVE_OUTPUT = False inputFolder = os.path.join('../images') outputFolder = os.path.join('../output') for filename in os.listdir(inputFolder)[:]: #for filename in ['page332.jpg', 'page335.jpg']: inputPath = os.path.join(inputFolder, filename) outputPath = os.path.join(outputFolder, filename) page = Page(inputPath, SHOW_STEPS) if SAVE_OUTPUT: page.save(outputPath) # save a copy of what is displayed. Used for getting images for the paper. page.show((800, 800))
#!/usr/bin/python import sys import os from page import Page SHOW_STEPS = True # change this to false if you just want to see the final output for each page. SAVE_OUTPUT = True inputFolder = os.path.join('../data_BCEV2/0/testpics') outputFolder = os.path.join('../data_BCEV2/0/output_docscrum') # /Users/murtada/Documents/BU/Arabic NLP/data_BCEV2/0/jpg_subset print(len(os.listdir(inputFolder))) for filename in os.listdir(inputFolder)[:]: #for filename in ['page332.jpg', 'page335.jpg']: if filename == '.DS_Store': continue inputPath = os.path.join(inputFolder, filename) outputPath = os.path.join(outputFolder, filename) page = Page(inputPath, SHOW_STEPS) if SAVE_OUTPUT: page.save( outputPath ) # save a copy of what is displayed. Used for getting images for the paper. page.show((800, 800))