Signlink / demo_cli.py
gaurannggg7's picture
Deploy production architecture with single zipped asset matrix
876754e
import argparse
from whisper_transcribe import transcribe_file, transcribe_from_mic
from gloss_builder import build_gloss_sequence
from mapping import ASLDictionary
from renderer import stitch_clips
def main():
parser = argparse.ArgumentParser("Offline ASL Translator CLI")
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument("--text", type=str)
group.add_argument("--file", type=str)
group.add_argument("--mic", action="store_true")
parser.add_argument("--duration", type=int, default=5)
args = parser.parse_args()
if args.text:
transcript = args.text
elif args.file:
transcript = transcribe_file(args.file)
else:
transcript = transcribe_from_mic(args.duration)
print("πŸ“ Transcript:", transcript)
gloss = build_gloss_sequence(transcript)
print("πŸ”€ Gloss tokens:", gloss)
dictionary = ASLDictionary()
paths = dictionary.get_paths(gloss)
print("🎞️ Clip paths:", paths)
if paths:
out = stitch_clips(paths)
print(f"βœ… Video at {out}")
else:
print("❌ No clips found.")
if __name__ == "__main__":
main()