VoiceVision-AI / utils /captioning.py
azizmeer40's picture
Upload 19 files
4b943a0 verified
raw
history blame contribute delete
677 Bytes
import random
def caption_scene(objects_list):
"""
Temporary caption generator
- Input: list of detected objects
- Output: sentence (scene description)
"""
if not objects_list or "No Object Detected" in objects_list:
return "No specific object visible right now."
# Simple rule-based caption creation
captions = [
f"I can see {', '.join(objects_list)} in front of you.",
f"There is {', '.join(objects_list)} around you.",
f"You are near {', '.join(objects_list)}.",
f"It looks like {', '.join(objects_list)} are present in your surroundings."
]
return random.choice(captions)