Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repository Cleanup #1

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true

[*.py]
charset = utf-8
indent_style = space
indent_size = 4
241 changes: 172 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,177 @@

# ASL - Research [![Badge License]][License]

*American Sign Language Recognition*

<br>

```
Michael Mongelli
Dr. Salgian
American Sign Language Recognition
Apr 1 2020
```

<br>

## Overview

This program is capable of plotting a **3D Hand Figure** <br>
based on coordinates provided by a **CSV** file.

The CSV comes from the **Mendely Dataset** of <br>
recorded **American Sign Language** gestures.

<br>

---

<br>

## Requirements

To run the program, you require:

- **[Python 3]**

- Some modules:

- `pandas`
- `numpy`
- `matplotlib`

<br>

Install them with:

```sh
pip install pandas numpy matplotlib
```

<br>

---

<br>

## Usage

*The program is used in the command line.*

```sh
Plot.py <CSV File> <Mode>
```

<br>

### Mode

#### Line

*This is the default used if no mode is specified.*

Plot the connections between the joints as lines.

```sh
Plot.py <CSV File> line
```

<br>

#### Scatter

Plot the hand using a scatter plot, <br>
showing the joints as points.

```sh
Plot.py <CSV File> scatter
```

<br>

---

<br>

## Notes

### update_plot()

Notice that the title is set using a different <br>
technique for the scatter and line plots.

Scatter and line plots behave differently in **MatPlotLib**.


This is also why the `ax.cla()` (clear axes) function <br>
is present in the line plot but not in the scatter plot.

Further research is needed to find if their is a way to <br>
implement the plotting of these graphs in as similar <br>
a manner as possible.

<br>

### placement of plt.show()

Unfortunately, this has to come last.

While it is suboptimal for the user to have to wait <br>
for the animation to render for saving before they <br>
can view it in a popup window, doing so corrupts <br>
the animation-saving process.

There may be a solution to this, but <br>
this can be solved in the future.

<br>

---

<br>

## Future Work

- Be able to pass multiple csv files to the program to <br>
make creating multiple animations at once less tedious

* It would be good to add more detail <br>
to the progress report in this case

* The process of creating and saving the animation <br>
is currently very slow, so a status report indicates <br>
if the animation is `10%` ... `20%` ... etc until completion

* If the program is made able to convert multiple files <br>
to animations at once, it would be good to show the <br>
user approximately when the animations will be done <br>
rendering so they know how long they will need to <br>
leave their terminal running

- Make it possible to enable / disable the plot being shown

* If one simply wants to save several animations created <br>
from their CSVs, they shouldn't have to see it all pop up <br>
in multiple plot window

- Improve speed

* Line mode is currently very slow, could be sped up by <br>
saving all plot data so it doesn't have to be recalculated <br>
with each loop of the animation

* There could be ways to speed up <br>
the process of the first loop as well

- Be able to plot points and lines at the same time

* Will greatly improve the viewer's ability to <br>
interpret the signs being performed by hand

<!----------------------------------------------------------------------------->

[Python 3]: https://www.python.org/downloads/

[Badge License]: https://img.shields.io/badge/License-Unkown-darkgray?style=for-the-badge

hand_plotter.py Information

Overview:

This program is capable of plotting a hand figure in 3D based on
coordinates provided from a CSV file in the Mendely dataset of
recorded American Sign Language gestures.

Command line args:

$ handfile.csv plot_mode

handfile.csv = the file containing the coordinates you would like to plot

plot_mode = * (optional, set to 'line' by default)
* 'scatter' - plot the hand using a scatter plot, showing the joints as points
* 'line' - plot the connections between the joints as lines

Examples: $ python3 hand_plotter.py Work_Right.csv scatter
$ python3 hand_plotter.py Work_Right.csv line
$ python3 hand_plotter.py Work_Right.csv

Notes:

In update_plot():
Notice that the title is set using a different technique for the scatter and line plots.
Scatter and line plots behave differently in MatPlotLib.
This is also why the ax.cla() (clear axes) function is present in the line plot
but not in the scatter plot.
Further research is needed to find if their is a way to implement
the plotting of these graphs in as similar a manner as possible.

placement of plt.show():
Unfortunately, this has to come last.
While it is suboptimal for the user to have to wait
for the animation to render for saving before they
can view it in a popup window,
doing so corrupts the animation-saving process.
There may be a solution to this,
but this can be solved in the future.

Future Work:

* Be able to pass multiple csv files to the program to make creating
multiple animations at once less tedious
* It would be good to add more detail to the progress report
in this case
* The process of creating and saving the animaiton is currently
very slow, so a status report indicates if the animation is
10%...20%...etc until completion
* If the program is made able to convert multiple files to
animations at once, it would be good to show the user approximately
when the animations will be done rendering so they know how long
they will need to leave their terminal running

* Make it possible to enable/disable the plot being shown
* If one simply wants to save several animations created from
their CSVs, they shouldn't have to see it all pop up in
multiple plot windows

* Improve speed:
* Line mode is currently very slow, could be sped up by saving
all plot data so it doesnt have to be recalculated with each loop
of the animation
* There could be ways to speed up the process of the first loop as well

* Be able to plot points and lines at the same time
* Will greatly improve the viewer's ability to interpret the signs
being performed by the hand
[License]: #
2 changes: 2 additions & 0 deletions hand_plotter.py → Source/Plot.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import pandas as pd
import numpy as np
import sys
Expand Down
10 changes: 10 additions & 0 deletions Test/Example.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh


# Make this file work from any pwd
folder=$(dirname "$0")

alias plot="$folder/../Source/Plot.py"
csv="$folder/Work_Right.csv"

plot $csv line
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes