{"id":15671389,"url":"https://github.com/winstxnhdw/capgen","last_synced_at":"2025-07-03T22:33:33.403Z","repository":{"id":195258445,"uuid":"692525751","full_name":"winstxnhdw/CapGen","owner":"winstxnhdw","description":"A fast CPU-first video/audio transcriber for generating caption files with Whisper and CTranslate2, hosted on Hugging Face Spaces.","archived":false,"fork":false,"pushed_at":"2025-03-21T10:24:18.000Z","size":1144,"stargazers_count":10,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-06T20:41:13.946Z","etag":null,"topics":["asr","automatic-speech-recognition","ctranslate2","docker","granian","huggingface","huggingface-spaces","litestar","whisper"],"latest_commit_sha":null,"homepage":"https://huggingface.co/spaces/winstxnhdw/CapGen","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/winstxnhdw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-09-16T18:44:19.000Z","updated_at":"2025-02-21T11:06:48.000Z","dependencies_parsed_at":"2024-04-04T12:26:34.019Z","dependency_job_id":"61c1f02e-72e0-4475-806f-6c583afdcd41","html_url":"https://github.com/winstxnhdw/CapGen","commit_stats":{"total_commits":291,"total_committers":4,"mean_commits":72.75,"dds":"0.46735395189003437","last_synced_commit":"c7f7c4cd18999bc4ea1598f3a119df5e52a78cf2"},"previous_names":["winstxnhdw/capgen"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/winstxnhdw/CapGen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winstxnhdw%2FCapGen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winstxnhdw%2FCapGen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winstxnhdw%2FCapGen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winstxnhdw%2FCapGen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/winstxnhdw","download_url":"https://codeload.github.com/winstxnhdw/CapGen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winstxnhdw%2FCapGen/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263415700,"owners_count":23463103,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asr","automatic-speech-recognition","ctranslate2","docker","granian","huggingface","huggingface-spaces","litestar","whisper"],"created_at":"2024-10-03T15:02:07.654Z","updated_at":"2025-07-03T22:33:33.355Z","avatar_url":"https://github.com/winstxnhdw.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CapGen\n\n[![linting: pylint](https://img.shields.io/badge/linting-pylint-yellowgreen)](https://github.com/PyCQA/pylint)\n[![main.yml](https://github.com/winstxnhdw/CapGen/actions/workflows/main.yml/badge.svg)](https://github.com/winstxnhdw/CapGen/actions/workflows/main.yml)\n[![deploy.yml](https://github.com/winstxnhdw/CapGen/actions/workflows/deploy.yml/badge.svg)](https://github.com/winstxnhdw/CapGen/actions/workflows/deploy.yml)\n[![formatter.yml](https://github.com/winstxnhdw/CapGen/actions/workflows/formatter.yml/badge.svg)](https://github.com/winstxnhdw/CapGen/actions/workflows/formatter.yml)\n[![warmer.yml](https://github.com/winstxnhdw/CapGen/actions/workflows/warmer.yml/badge.svg)](https://github.com/winstxnhdw/CapGen/actions/workflows/warmer.yml)\n[![dependabot.yml](https://github.com/winstxnhdw/CapGen/actions/workflows/dependabot.yml/badge.svg)](https://github.com/winstxnhdw/CapGen/actions/workflows/dependabot.yml)\n\n[![Open in Spaces](https://huggingface.co/datasets/huggingface/badges/raw/main/open-in-hf-spaces-md-dark.svg)](https://huggingface.co/spaces/winstxnhdw/CapGen)\n[![Open a Pull Request](https://huggingface.co/datasets/huggingface/badges/raw/main/open-a-pr-md-dark.svg)](https://github.com/winstxnhdw/CapGen/compare)\n\nA fast cross-platform CPU-first video/audio English-only transcriber for generating caption files with [Whisper](https://openai.com/research/whisper) and [CTranslate2](https://github.com/OpenNMT/CTranslate2), hosted on Hugging Face Spaces. A `pip` installable offline CLI tool with CUDA support is provided. By default, Voice Activity Detection (VAD) preprocessing is always enabled.\n\n## Requirements\n\n- Python 3.11\n- 4 GB RAM\n\n## Usage (API)\n\nSimply cURL the endpoint like in the following. Currently, the only available caption format are `srt`, `vtt` and `txt`.\n\n```bash\ncurl \"https://winstxnhdw-CapGen.hf.space/api/v1/transcribe?caption_format=$CAPTION_FORMAT\" \\\n  -F \"file=@$AUDIO_FILE_PATH\"\n```\n\nYou can also redirect the output to a file.\n\n```bash\ncurl \"https://winstxnhdw-CapGen.hf.space/api/v1/transcribe?caption_format=$CAPTION_FORMAT\" \\\n  -F \"file=@$AUDIO_FILE_PATH\" | jq -r \".result\" \u003e result.srt\n```\n\nYou can stream the captions in real-time with the following.\n\n```bash\ncurl -N \"https://winstxnhdw-CapGen.hf.space/api/v1/transcribe/stream?caption_format=$CAPTION_FORMAT\" \\\n  -F \"file=@$AUDIO_FILE_PATH\"\n```\n\n## Usage (CLI)\n\n`CapGen` is available as a CLI tool with CUDA support. You can install it with `pip`.\n\n```bash\npip install git+https://github.com/winstxnhdw/CapGen\n```\n\nYou may also install `CapGen` with the necessary CUDA binaries.\n\n```bash\npip install \"capgen[cuda] @ git+https://github.com/winstxnhdw/CapGen\"\n```\n\nNow, you can run the CLI tool with the following command.\n\n```bash\ncapgen -c srt -o ./result.srt --cuda \u003c ~/Downloads/audio.mp3\n```\n\n```yaml\nusage: capgen [-h] [-g] [-t] [-w] -c  -o  [file]\n\ntranscribe a compatible audio/video file into a chosen caption file format\n\npositional arguments:\n  file            the file path to a compatible audio/video\n\noptions:\n  -h, --help      show this help message and exit\n  -g, --cuda      whether to use CUDA for inference\n\ncpu:\n  -t, --threads   the number of CPU threads\n  -w, --workers   the number of CPU workers\n\nrequired:\n  -c, --caption   the chosen caption file format\n  -o, --output    the output file path\n```\n\n## Development\n\nYou can install the required dependencies for your editor with the following.\n\n```bash\npoetry install\n```\n\nYou can spin the server up locally with the following. You can access the Swagger UI at [localhost:7860/api/docs](http://localhost:7860/api/docs).\n\n```bash\ndocker build -f Dockerfile.build -t capgen .\ndocker run --rm -e SERVER_PORT=7860 -p 7860:7860 capgen\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinstxnhdw%2Fcapgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwinstxnhdw%2Fcapgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinstxnhdw%2Fcapgen/lists"}