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.2.tar.gz (9.4 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.2-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: signlang_segmenter-0.1.2.tar.gz
  • Upload date:
  • Size: 9.4 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.2.tar.gz
Algorithm Hash digest
SHA256 8d9773f9d8d86747c52bf09bd54e4957081db9417a705c4dcf9ee8524ced2eac
MD5 3c1927a33974d091a88feee678884a5e
BLAKE2b-256 f792126a2d7cc43613f7ceb2e8feb6cd9a9f9423dcf6d6274ecff491f91b3f4d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for signlang_segmenter-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7a90afb49aee7740eb8f285ea11c3e281518b0794c2a0b60a561a5b74c34d55e
MD5 e890099daec6196c29460c99d9e29f9d
BLAKE2b-256 a076d7f603736215348f7a799dc20a898022ecd2b0c7ef299d661b6dc7a3a230

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