Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions examples/load.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,20 @@
"name": "#%%\n"
}
}
},
{
"cell_type": "markdown",
"source": [
"# WMT-SLT\n",
"\n",
"Instructions and example code are here: https://github.com/sign-language-processing/datasets/blob/master/sign_language_datasets/datasets/wmt_slt/README.md"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%% md\n"
}
}
}
]
}
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ tfds-nightly
tensorflow>=2.4.0
numpy
pytest
mediapipe
pytest-cov
pympi-ling
Pillow
opencv-python==4.5.5.64
requests
srt
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
setup(
name="sign-language-datasets",
packages=packages,
version="0.0.9",
version="0.0.10",
description="TFDS Datasets for sign language",
author="Amit Moryossef",
author_email="amitmoryossef@gmail.com",
url="https://github.com/sign-language-processing/datasets",
keywords=[],
install_requires=["python-dotenv", "tqdm", "pose-format", "tfds-nightly", "tensorflow", "numpy", "pympi-ling",
"Pillow", "opencv-python==4.5.5.64", "mediapipe", "srt"],
"Pillow", "opencv-python==4.5.5.64"],
tests_require=['pytest', 'pytest-cov'],
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
5 changes: 5 additions & 0 deletions sign_language_datasets/datasets/wmt_slt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ Until [merged by `tfds`](https://github.com/tensorflow/datasets/pull/3988), plea
pip install git+ssh://git@github.com:AmitMY/datasets-1.git
```

Then install conditional dependencies:

```bash
pip install srt mediapipe
```

```py

Expand Down
18 changes: 13 additions & 5 deletions sign_language_datasets/datasets/wmt_slt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import tempfile

import numpy as np
import mediapipe as mp

from pose_format import Pose, PoseHeader
from pose_format.numpy import NumPyPoseBody
Expand All @@ -21,10 +20,6 @@
from pose_format.utils.holistic import holistic_components
from pose_format.utils.openpose import load_frames_directory_dict

mp_holistic = mp.solutions.holistic
FACEMESH_CONTOURS_POINTS = [str(p) for p in
sorted(set([p for p_tup in list(mp_holistic.FACEMESH_CONTOURS) for p in p_tup]))]


def extract_tar_xz_file(filepath: str, target_dir: str):
"""
Expand Down Expand Up @@ -59,6 +54,19 @@ def read_openpose_surrey_format(filepath: str, fps: int, width: int, height: int


def formatted_holistic_pose(width=1000, height=1000):

try:
import mediapipe as mp

except ImportError:
raise ImportError(
"Please install mediapipe with: pip install mediapipe"
)

mp_holistic = mp.solutions.holistic
FACEMESH_CONTOURS_POINTS = [str(p) for p in
sorted(set([p for p_tup in list(mp_holistic.FACEMESH_CONTOURS) for p in p_tup]))]

dimensions = PoseHeaderDimensions(width=width, height=height, depth=width)
header = PoseHeader(version=0.1, dimensions=dimensions, components=holistic_components("XYZC", 10))
body = NumPyPoseBody(fps=10,
Expand Down
9 changes: 8 additions & 1 deletion sign_language_datasets/datasets/wmt_slt/wmt_slt.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
convert_srt_time_to_frame

from ...datasets import SignDatasetConfig
import srt

_DESCRIPTION = """
These are Standard German daily news (Tagesschau) and Swiss German weather forecast (Meteo) episodes broadcast and interpreted into Swiss German Sign Language by hearing interpreters (among them, children of Deaf adults, CODA) via Swiss National TV (Schweizerisches Radio und Fernsehen, SRF) (https://www.srf.ch/play/tv/sendung/tagesschau-in-gebaerdensprache?id=c40bed81-b150-0001-2b5a-1e90e100c1c0). For a more extended description of the data, visit https://www.wmt-slt.com/data.
Expand Down Expand Up @@ -182,6 +181,14 @@ def _split_generators(self, dl_manager: tfds.download.DownloadManager):
def _generate_examples(self, datasets):
"""Yields examples."""

try:
import srt

except ImportError:
raise ImportError(
"Please install srt with: pip install srt"
)

for dataset_id, directories in datasets.items():
names = [n[:-len('.mp4')] for n in os.listdir(directories['videos'])]
for name in names:
Expand Down