Spaces:
Runtime error
Runtime error
Merge pull request #26 from barun-saha/visual
Browse filesFiles changed (2)
11 unmodified lines1213141516171811 unmodified linesREQUEST_TIMEOUT = 12MAX_PHOTOS = 2# Only show warnings11 unmodified lines1213141516171811 unmodified linesREQUEST_TIMEOUT = 12MAX_PHOTOS = 3# Only show warnings
33 unmodified lines343536373839404150 unmodified lines9293949596979899523 unmodified lines62362462562662762836 unmodified lines66566666766866967067167267367433 unmodified linesINCHES_0_3 = pptx.util.Inches(0.3)STEP_BY_STEP_PROCESS_MARKER = '>> 'IMAGE_DISPLAY_PROBABILITY = 0.3FOREGROUND_IMAGE_PROBABILITY = 0.75SLIDE_NUMBER_REGEX = re.compile(r"^slide[ ]+\d+:", re.IGNORECASE)50 unmodified lines# Add content in a loopfor a_slide in parsed_data['slides']:# The loop has a bug:# if any of this functions fail (i.e., returns False), an empty slide would still existis_processing_done = _handle_double_col_layout(presentation=presentation,slide_json=a_slide,523 unmodified lines):return Falsebullet_slide_layout = presentation.slide_layouts[1]slide = presentation.slides.add_slide(bullet_slide_layout)shapes = slide.shapes36 unmodified linesshape.text = step.removeprefix(STEP_BY_STEP_PROCESS_MARKER)top += height + INCHES_0_3left += INCHES_0_5else:# Two steps -- probably not a process# More than 5--6 steps -- would likely cause a visual clutterreturn Falsereturn True33 unmodified lines343536373839404150 unmodified lines929394959697523 unmodified lines62162262362462562662762862963063136 unmodified lines66866967067167267333 unmodified linesINCHES_0_3 = pptx.util.Inches(0.3)STEP_BY_STEP_PROCESS_MARKER = '>> 'IMAGE_DISPLAY_PROBABILITY = 1 / 3.0FOREGROUND_IMAGE_PROBABILITY = 0.8SLIDE_NUMBER_REGEX = re.compile(r"^slide[ ]+\d+:", re.IGNORECASE)50 unmodified lines# Add content in a loopfor a_slide in parsed_data['slides']:is_processing_done = _handle_double_col_layout(presentation=presentation,slide_json=a_slide,523 unmodified lines):return Falseif n_steps < 3 or n_steps > 6:# Two steps -- probably not a process# More than 5--6 steps -- would likely cause a visual clutterreturn Falsebullet_slide_layout = presentation.slide_layouts[1]slide = presentation.slides.add_slide(bullet_slide_layout)shapes = slide.shapes36 unmodified linesshape.text = step.removeprefix(STEP_BY_STEP_PROCESS_MARKER)top += height + INCHES_0_3left += INCHES_0_5return True
helpers/image_search.py+1-1
helpers/pptx_helper.py+7-8