From f2d7997e39d0454d15a91e3786fa4e604399cec7 Mon Sep 17 00:00:00 2001 From: Amit Moryossef Date: Wed, 27 Mar 2024 09:31:35 +0100 Subject: [PATCH] chore(): initial commit --- .github/workflows/lint.yaml | 26 ++++++++++++++++++ .github/workflows/test.yaml | 26 ++++++++++++++++++ .gitignore | 3 +++ LICENSE | 21 +++++++++++++++ README.md | 30 +++++++++++++++++++++ pyproject.toml | 41 +++++++++++++++++++++++++++++ signwriting_translation/__init__.py | 0 signwriting_translation/bin.py | 25 ++++++++++++++++++ 8 files changed, 172 insertions(+) create mode 100644 .github/workflows/lint.yaml create mode 100644 .github/workflows/test.yaml create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 pyproject.toml create mode 100644 signwriting_translation/__init__.py create mode 100644 signwriting_translation/bin.py diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..a59faff --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,26 @@ +name: Lint + + +on: + push: + branches: [ master, main ] + pull_request: + branches: [ master, main ] + + +jobs: + test: + name: Lint + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install Requirements + run: pip install .[dev] + + - name: Lint Code + run: pylint signwriting_translation diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..0d742fd --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,26 @@ +name: Test + + +on: + push: + branches: [ master, main ] + pull_request: + branches: [ master, main ] + + +jobs: + test: + name: Test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install Requirements + run: pip install .[dev] + + - name: Test Code + run: pytest signwriting_translation diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..402b788 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea/ +build/ +signwriting_translation.egg-info/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4ec5962 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Sign Language Processing + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..713bfd5 --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# SignWriting Translation + +This project trains and serves models to translate SignWriting into spoken language text and vice versa. + +## Usage + +```bash +pip install git+https://github.com/sign-language-processing/signwriting-translation +``` + +To translate: + +```bash +signwriting_to_text --spoken-language="en" --signed-language="ase" --input="M525x535S2e748483x510S10011501x466S2e704510x500S10019476x475" +text_to_signwriting --spoken-language="en" --signed-language="ase" --input="Sign Language" +``` + +### Examples + +(These examples are taken from the DSGS Vokabeltrainer) + +| | 00004 | 00007 | 00015 | +|:-----------:|:--------------------------------------------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------:| +| SignWriting | | | | +| Video | | | | + +## Data + +We use the SignBank+ Dataset from [signbank-plus](https://github.com/sign-language-processing/signbank-plus). + diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..d4d2a7b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,41 @@ +[project] +name = "signwriting-translation" +description = "Translate from spoken to signed languages using SignWriting" +version = "0.0.1" +authors = [ + { name = "Amit Moryossef", email = "amitmoryossef@gmail.com" }, +] +readme = "README.md" +dependencies = [ + "signwriting @ git+https://github.com/sign-language-processing/signwriting", +] + +dev = [ + "pytest", + "pylint" +] + +[tool.yapf] +based_on_style = "google" +column_limit = 120 + +[tool.pylint] +max-line-length = 120 +disable = [ + "C0114", # Missing module docstring + "C0115", # Missing class docstring + "C0116", # Missing function or method docstring +] + +[tool.setuptools] +packages = [ + "signwriting_translation" +] + +[tool.pytest.ini_options] +addopts = "-v" +testpaths = ["signwriting_translation"] + +[project.scripts] +signwriting_to_text = "signwriting_translation.bin:signwriting_to_text" +text_to_signwriting = "signwriting_translation.bin:text_to_signwriting" diff --git a/signwriting_translation/__init__.py b/signwriting_translation/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/signwriting_translation/bin.py b/signwriting_translation/bin.py new file mode 100644 index 0000000..7ca3e5e --- /dev/null +++ b/signwriting_translation/bin.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python + +import argparse + + +def get_args(): + parser = argparse.ArgumentParser() + parser.add_argument('--spoken-language', required=True, type=str, help='spoken language code') + parser.add_argument('--signed-language', required=True, type=str, help='signed language code') + parser.add_argument('--input', required=True, type=str, help='input text or signwriting sequence') + return parser.parse_args() + + +def signwriting_to_text(): + # pylint: disable=unused-variable + args = get_args() + + +def text_to_signwriting(): + # pylint: disable=unused-variable + args = get_args() + + +if __name__ == '__main__': + signwriting_to_text()