Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
AmitMY committed Mar 30, 2024
2 parents be400fa + e5e2599 commit b1b4f0d
Show file tree
Hide file tree
Showing 27 changed files with 1,322 additions and 25 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/dart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Dart Tests

on:
pull_request:
branches: [master, main]
push:
branches: [master, main]

jobs:
build:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
with:
sdk: 3.0

- name: Install Requirements
working-directory: src/dart
run: dart pub get

# Verify the use of 'dart format' on each commit.
- name: Check formatting
working-directory: src/dart
run: dart format --output=none --set-exit-if-changed .

# Passing '--fatal-infos' for slightly stricter analysis.
- name: Analyze
working-directory: src/dart
run: dart analyze --fatal-infos

- name: Run tests
working-directory: src/dart
run: dart test
15 changes: 9 additions & 6 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
name: Build
name: Python Tests

on:
push:
branches: [ master, main ]
branches: [master, main]
pull_request:
branches: [ master, main ]

branches: [master, main]

jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.10" ]
python-version: ["3.9"]

steps:
- uses: actions/checkout@v3
Expand All @@ -27,4 +26,8 @@ jobs:

- name: Run tests
working-directory: src/python
run: pytest pose_format
run: pytest pose_format

- name: Run additional tests
working-directory: src/python
run: pytest tests -s
6 changes: 6 additions & 0 deletions src/dart/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.dart_tool/
test.gif
pubspec.lock
analysis_options.yaml
pose_file.pose
demo.gif
37 changes: 37 additions & 0 deletions src/dart/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## 1.0.0

- Can Load Pose File

## 1.0.1

- Add Documentation

## 1.0.2

- Add More Tests

## 1.1.0

- Add Visualization

## 1.1.1

- Fix Visualization

## 1.1.2

- Removed Unused files
- Re-structre

## 1.1.3

- Optimizations

## 1.1.4

- Method Divide

## 1.1.5

- Async Tasks

29 changes: 29 additions & 0 deletions src/dart/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2018, the respective contributors, as shown by the AUTHORS file.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46 changes: 46 additions & 0 deletions src/dart/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Pose

[![pub package](https://img.shields.io/pub/v/pose.svg)](https://pub.dev/packages/pose)

This is `dart` implementation of its [python counterpart](https://github.com/sign-language-processing/pose/tree/master/src/python) with limited features

This repository helps developers interested in Sign Language Processing (SLP) by providing a complete toolkit for working with poses.

## File Format Structure

The file format is designed to accommodate any pose type, an arbitrary number of people, and an indefinite number of frames.
Therefore it is also very suitable for video data, and not only single frames.

At the core of the file format is `Header` and a `Body`.

* The header for example contains the following information:

- The total number of pose points. (How many points exist.)
- The exact positions of these points. (Where do they exist.)
- The connections between these points. (How are they connected.)

## Features

- ✔️ Reading
- ❌ Normalizing
- ❌ Augmentation
- ❌ Interpolation
- ✔️ Visualization (2x slow compared to python and supports only GIF)

## Usage

```dart
import 'dart:io';
import 'dart:typed_data';
import 'package:pose/pose.dart';
void main() async {
File file = File("pose_file.pose");
Uint8List fileContent = file.readAsBytesSync();
Pose pose = Pose.read(fileContent);
PoseVisualizer p = PoseVisualizer(pose);
await p.saveGif("demo.gif", p.draw());
}
```

![Demo Gif](https://raw.githubusercontent.com/sign-language-processing/pose/master/src/dart/assets/demo.gif)
22 changes: 22 additions & 0 deletions src/dart/example/pose_example.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'dart:io';
import 'dart:typed_data';
import 'package:pose/pose.dart';

void main() async {
Stopwatch stopwatch = Stopwatch()..start();

File file = File("pose_file.pose");
Uint8List fileContent = file.readAsBytesSync();
print("File Read");

Pose pose = Pose.read(fileContent);
print("File Loaded");

PoseVisualizer p = PoseVisualizer(pose, thickness: 2);
print("File Visualized");

File giffile = await p.saveGif("demo.gif", p.draw());
print("File Saved ${giffile.path}");

print('Time taken : ${stopwatch.elapsed}');
}
Loading

0 comments on commit b1b4f0d

Please sign in to comment.