-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add manual pages and fix configuration for tox
- Loading branch information
Showing
21 changed files
with
399 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# .readthedocs.yml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Build documentation in the docs/ directory with Sphinx | ||
sphinx: | ||
configuration: site/source/conf.py | ||
|
||
# Build documentation with MkDocs | ||
#mkdocs: | ||
# configuration: mkdocs.yml | ||
|
||
# Optionally build your docs in additional formats such as PDF and ePub | ||
formats: all | ||
|
||
# Optionally set the version of Python and requirements required to build your docs | ||
python: | ||
version: 3.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
sphinx==2.3.1 | ||
sphinx-rtd-theme==0.4.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,43 +3,48 @@ | |
|
||
import os | ||
|
||
from setuptools import setup, find_packages | ||
from setuptools import setup | ||
|
||
with open(os.path.join("subaligner", "_version.py")) as f: | ||
with open(os.path.join(os.getcwd(), "subaligner", "_version.py")) as f: | ||
exec(f.read()) | ||
|
||
with open("README.md") as readme_file: | ||
readme = readme_file.read() | ||
|
||
with open('requirements.txt') as requirements_file: | ||
requirements = requirements_file.read().splitlines() | ||
with open("requirements.txt") as requirements_file: | ||
requirements = requirements_file.read().splitlines()[::-1] | ||
|
||
with open('requirements-dev.txt') as requirements_dev_file: | ||
requirements_dev = requirements_dev_file.read().splitlines() | ||
with open("requirements-dev.txt") as requirements_dev_file: | ||
requirements_dev = requirements_dev_file.read().splitlines()[::-1] | ||
|
||
setup(name="subaligner", | ||
version=__version__, | ||
author="Xi Bai", | ||
author_email="[email protected]", | ||
classifiers=[ | ||
'License :: OSI Approved :: MIT License', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python :: 3.4", | ||
"Programming Language :: Python :: 3.5", | ||
"Programming Language :: Python :: 3.6", | ||
], | ||
license="MIT", | ||
url="git@bitbucket.org:baxtree/subaligner-cli.git", | ||
description="Automatically align an out-of-sync subtitle to its video with DNN", | ||
long_description=readme + '\n\n', | ||
python_requires='>=3.4', | ||
url="git@github.com:baxtree/subaligner.git", | ||
description="Automatically aligns an out-of-sync subtitle file to its companion video/audio using Deep Neural Network and Forced Alignment.", | ||
long_description=readme + "\n\n", | ||
python_requires=">=3.4", | ||
package_dir={"subaligner": "subaligner"}, | ||
packages=find_packages("subaligner"), | ||
packages=[ | ||
"subaligner", | ||
"subaligner.models.training.model", | ||
"subaligner.models.training.weights", | ||
], | ||
package_data={ | ||
"subaligner.models.training.model": ["model.hdf5"], | ||
"subaligner.models.training.weights": ["weights.hdf5"] | ||
}, | ||
setup_requires=["numpy"], | ||
install_requires=requirements, | ||
test_suite="tests.subaligner", | ||
tests_require=requirements_dev | ||
tests_require=requirements_dev, | ||
setup_requires=["numpy>=1.14.1,<1.18.0"], | ||
scripts=["bin/subaligner_1pass", "bin/subaligner_2pass"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SPHINXAPIDOC ?= sphinx-apidoc | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
INCLUDED = ../subaligner | ||
EXCLUDED = ../subaligner/models | ||
|
||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
rm -f "$(SOURCEDIR)/subaligner.rst" | ||
rm -f "$(SOURCEDIR)/modules.rst" | ||
$(SPHINXAPIDOC) -o "$(SOURCEDIR)" "$(INCLUDED)" "$(EXCLUDED)" && $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
######################## | ||
Acknowledgement | ||
######################## | ||
|
||
|
||
**Dependencies**:: | ||
|
||
librosa | ||
tensorflow | ||
scikit-learn | ||
pycaption | ||
pysrt | ||
aeneas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
######################## | ||
Anatomy | ||
######################## | ||
|
||
Under the hood, a model has been trained with synchronised video and subtitle pairs and later used for predicating | ||
shifting offsets and directions under the guidance of a two-stage aligning approach. | ||
|
||
The following figure depicts the primary workflow of the first-stage subtitle alignment. It also includes upfront | ||
network training and later-on subtitle shifting. The data set used for training contains pairs of a video clip and | ||
a subtitle file with decent start and end time codes. Mel-Frequency Cepstral Coefficients are extracted in parallel | ||
and fed into a carefully designed DNN incorporating LSTM layers. For subtitle shifting, an out-of-sync subtitle file | ||
and a target video clip are fed in as input and the output can be either time offsets by which the subtitle should be | ||
shifted or a ready-to-playback subtitle file with calibrated start and end time. Notably, the shifting illustrated here | ||
leads to the completion of the first stage alignment (global shifting). | ||
|
||
.. image:: ../../figures/1st_stage.png | ||
:width: 500 | ||
:align: center | ||
:alt: Illustration on First Stage Alignment | ||
|
||
At the second stage, the target video clip and the globally shifted subtitle file will be broken down into evenly | ||
timed chunks respectively, each pair of which will be fed into the DNN and aligned in parallel (regional shifting) as | ||
shown in the following figure. And the concatenated subtitle chunks result in the final output. | ||
|
||
.. image:: ../../figures/2nd_stage.png | ||
:width: 500 | ||
:align: center | ||
:alt: Illustration on Second Stage Alignment |
Oops, something went wrong.