semvec/pypi-packages huggingface dataset:
deeprehab-movements 0.1.0
Movement scoring implementations for DeepRehab
License: MIT
Requires Python: >=3.8

# DeepRehab Movements

DeepRehab Movements is a Python package that provides movement analysis and scoring capabilities for rehabilitation exercises. It works with [deeprehab-pose](../deeprehab-pose) and [deeprehab-angles](../deeprehab-angles) to provide a complete rehabilitation analysis solution.

## Features

- Exercise movement scoring
- Form evaluation algorithms
- Integration with pose estimation and angle data
- Extensible design for adding new exercises

## Installation

```bash
pip install deeprehab-movements
```

## Usage

```python
from deeprehab_movements import score_deep_squat

# Score a deep squat exercise
result = score_deep_squat(landmarks)
print(f"Score: {result.score}")
print(f"Reason: {result.reason}")
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
deeprehab-rules 0.1.0
Rehabilitation movement scoring rules for DeepRehab
License: MIT
Requires Python: >=3.8

# DeepRehab Rules

DeepRehab Rules is a Python package that provides a rules engine for validating rehabilitation exercises based on pose estimation data. It works in conjunction with [deeprehab-pose](../deeprehab-pose) and [deeprehab-angles](../deeprehab-angles) to provide a complete rehabilitation analysis solution.

## Features

- Exercise form validation
- Rule-based feedback system
- Configurable rules engine
- Integration with pose estimation data
- Extensible design

## Installation

```bash
pip install deeprehab-rules
```

## Usage

```python
from deeprehab_rules import DeepRehabRules

# Initialize the rules engine
rules_engine = DeepRehabRules()

# Validate exercise form
result = rules_engine.validate_form(landmarks, "knee_extension")
print(result)
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
deeprehab-angles 0.1.0
Angle calculation functions for rehabilitation exercises
License: MIT
Requires Python: >=3.7

# DeepRehab Angles

Angle calculation functions for rehabilitation exercises.

## Overview

DeepRehab Angles is a Python package that provides functions for calculating joint angles from body landmarks. It's designed to work with pose estimation data for rehabilitation exercise analysis.

## Features

- Calculate joint angles (knee, shoulder)
- Support for both left and right sides of the body
- Compatible with MediaPipe Pose landmark format
- Only uses Python built-in modules (math)
- Easy to integrate into rehabilitation applications

## Installation

To install the package in development mode:
```bash
pip install -e .
```

To install from source:
```bash
python -m build
pip install dist/deeprehab_angles-0.1.0-py3-none-any.whl
```

## Usage

```python
from deeprehab_angles import knee_angle, shoulder_flexion_angle, Landmark

# Create a list of landmarks (typically from MediaPipe Pose)
landmarks = [Landmark(x, y, z, visibility) for _ in range(33)]

# Set specific landmarks for testing
landmarks[23] = Landmark(0.0, 2.0, 0.0, 1.0)  # Left hip
landmarks[25] = Landmark(0.0, 1.0, 0.0, 1.0)  # Left knee
landmarks[27] = Landmark(1.0, 1.0, 0.0, 1.0)  # Left ankle

# Calculate left knee angle
knee_angle_left = knee_angle(landmarks, "left")
print(f"Left knee angle: {knee_angle_left:.1f}°")

# Set specific landmarks for shoulder
landmarks[12] = Landmark(0.0, 1.0, 0.0, 1.0)  # Right shoulder
landmarks[14] = Landmark(0.0, 0.0, 0.0, 1.0)  # Right elbow
landmarks[16] = Landmark(1.0, 0.0, 0.0, 1.0)  # Right wrist

# Calculate right shoulder flexion angle
shoulder_angle_right = shoulder_flexion_angle(landmarks, "right")
print(f"Right shoulder flexion angle: {shoulder_angle_right:.1f}°")
```

## API

### Main Functions

- `knee_angle(landmarks, side)` - Calculate knee flexion/extension angle
- `shoulder_flexion_angle(landmarks, side)` - Calculate shoulder flexion angle
- `_angle_3p(a, b, c)` - Calculate angle formed by three points

### Data Classes

- `Landmark` - Represents a body landmark with x, y, z coordinates and visibility

## Testing

Run the tests with:
```bash
python -m pytest src/deeprehab_angles/test_angles.py
```

## License

MIT
deeprehab-pose 0.1.0
Pose estimation for rehabilitation exercises
License: MIT
Requires Python: >=3.7

# DeepRehab Pose

Pose estimation for rehabilitation exercises.

## Overview

DeepRehab Pose is a Python package that provides pose estimation capabilities for rehabilitation exercises. It uses MediaPipe to detect body landmarks in video files and can be used to analyze patient movements during physical therapy sessions.

## Features

- Extract body landmarks from video files
- Process video frames to identify 33 body points
- Handle invalid or corrupted video files
- Return structured landmark data for further analysis

## Installation

To install the package in development mode:
```bash
pip install -e .
```

To install from source:
```bash
python -m build
pip install dist/deeprehab_pose-0.1.0-py3-none-any.whl
```

## Usage

```python
from deeprehab_pose import extract_landmarks, InvalidVideoError

try:
    # Extract landmarks from a video file
    landmarks = extract_landmarks("path/to/video.mp4")
    
    # Process the landmarks
    for frame_index, frame_landmarks in enumerate(landmarks):
        print(f"Frame {frame_index}: {len(frame_landmarks)} landmarks detected")
        
except InvalidVideoError as e:
    print(f"Error processing video: {e}")
```

## API

### Main Functions

- `extract_landmarks(video_path)` - Extract body landmarks from a video file
- `InvalidVideoError` - Exception raised for invalid video files

### Data Classes

- `Landmark` - Represents a body landmark with x, y, z coordinates and visibility

## Testing

Run the tests with:
```bash
python -m pytest src/deeprehab_pose/test_pose.py
```

## License

MIT