Skip to main content

A Python library for sign language video and pose segmentation.

Project description

signlang-segmenter

A Python library for sign language segmentation.

Optical Flow

motion curve with segments

Installation

Option 1: Install the library to use it

pip install signlang-segmenter

Or install it directly from GitHub:

python -m pip install "git+https://github.com/24-mohamedyehia/signlang-segmenter.git"

Option 2: Install the project for development

If you want to modify the code and contribute, use an isolated environment and editable install:

  1. Install Miniconda if needed.
  2. Run:
git clone https://github.com/24-mohamedyehia/signlang-segmenter.git
cd signlang-segmenter
conda create -n signlang-segmenter python=3.11 -y
conda activate signlang-segmenter
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"

Quick Import Check

import signlang_segmenter
import signlang_segmenter.video
import signlang_segmenter.pose

Segmentation API

from signlang_segmenter.video import VideoSegmenter, SegmentExporter

segmenter = VideoSegmenter(
	roi_mode="full",
	smooth_window=11,
	min_len_sec=0.30,
	merge_gap_sec=0.45,
	pad_before_frames=10,
	pad_after_frames=12,
)

segments, info = segmenter.segment(VIDEO_PATH)
print(f"Found {len(segments)} segments: {segments}")

exporter = SegmentExporter(out_dir="../output/segments_out")
exporter.export(VIDEO_PATH, segments)

Visualization

from signlang_segmenter.video import plot_motion_segments

plot_motion_segments(segments, info)

The plot includes:

  • motion raw curve
  • motion smooth curve
  • adaptive high/low thresholds
  • shaded spans for detected segments

The info dict returned by VideoSegmenter.segment must include:

  • motion_raw
  • motion_smooth
  • fps
  • frame_idx
  • th_high_arr
  • th_low_arr

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

signlang_segmenter-0.1.1.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

signlang_segmenter-0.1.1-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file signlang_segmenter-0.1.1.tar.gz.

File metadata

  • Download URL: signlang_segmenter-0.1.1.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for signlang_segmenter-0.1.1.tar.gz
Algorithm Hash digest
SHA256 41d179fb3c0e331edcbde61f927fc14f75f881b3bec2fccb88059a52522af088
MD5 6f36b0eaeab1958d3c4ca985710b51eb
BLAKE2b-256 b840dfdac6b63aa4106a8df4e5864f110a4e7d3407bb56080a5a22890894db73

See more details on using hashes here.

File details

Details for the file signlang_segmenter-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for signlang_segmenter-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3a8cb4c5bb5f4da6b6f0e69a76700e52f152174b071be94aa6b489d98b6f6d65
MD5 d090b0559c0d39f4b8cee7f9f988d4bd
BLAKE2b-256 b7ee604b2f78337a9e0b9624f9a2658612e83ddb8831a977a36dabe8a9e4fce6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page