Tas01 commited on
Commit
1fa30cb
·
verified ·
1 Parent(s): 7ef80a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -18
app.py CHANGED
@@ -345,24 +345,24 @@ class ImageStoryteller:
345
  return story, detected_objects, scene_type
346
 
347
  def create_story_overlay(self, image, story):
348
- """Create formatted text with caption and story for textbox display"""
349
-
350
- # Generate caption (first sentence of the story)
351
- caption = ""
352
- sentences = story.split('. ')
353
- if sentences:
354
- caption = sentences[0].strip()
355
- if not caption.endswith('.'):
356
- caption += '.'
357
-
358
- # Format the text with caption separated from story
359
- # Using a separator line of dashes
360
- separator = "─" * 40
361
-
362
- # Format the complete text for the textbox
363
- formatted_text = f"{caption}\n{separator}\n{story}"
364
-
365
- return formatted_text
366
 
367
  # FIXED: Added the missing method
368
  # def create_story_overlay(self, image, story):
 
345
  return story, detected_objects, scene_type
346
 
347
  def create_story_overlay(self, image, story):
348
+ """Create formatted text with caption and story for textbox display"""
349
+
350
+ # Generate caption (first sentence of the story)
351
+ caption = ""
352
+ sentences = story.split('. ')
353
+ if sentences:
354
+ caption = sentences[0].strip()
355
+ if not caption.endswith('.'):
356
+ caption += '.'
357
+
358
+ # Format the text with caption separated from story
359
+ # Using a separator line of dashes
360
+ separator = "─" * 40
361
+
362
+ # Format the complete text for the textbox
363
+ formatted_text = f"{caption}\n{separator}\n{story}"
364
+
365
+ return formatted_text
366
 
367
  # FIXED: Added the missing method
368
  # def create_story_overlay(self, image, story):