File size: 919 Bytes
d87e8d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
import argparse
from app.captioning import generate_caption
from app.storytelling import generate_story
from app.tts import speak_story

def main(file_name):
    image_path = os.path.join(os.path.dirname(__file__), "assets",file_name)
    print("πŸ” Generating caption from image...")
    caption = generate_caption(image_path)
    print(f"\nπŸ–ΌοΈ  Caption: {caption}")

    print("\n✍️  Generating story from caption...")
    story = generate_story(caption)
    print(f"\nπŸ“– Story:\n{story}")

    print("\nπŸ”Š Converting story to speech...")
    audio_path = speak_story(story)
    print(f"\nβœ… Audio saved at: {audio_path}")

if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Run image β†’ caption β†’ story β†’ speech pipeline")
    parser.add_argument("image_path", type=str, help="Path to the input image")

    args = parser.parse_args()
    main(args.image_path)