Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
bhky committed May 7, 2022
1 parent d256790 commit e0f4646
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,15 @@ result = predict_video()
print(result)

# Alternatively, you could provide a pre-recorded video file:
result = predict_video("your_head_gesture_video.mp4", from_beginning=False)
result = predict_video(
"your_head_gesture_video.mp4",
from_beginning=False,
motion_threshold=0.5,
gesture_threshold=0.9
)
# The `from_beginning` flag controls whether the needed frames will be obtained
# from the beginning or toward the end of the video.
# Thresholds can be adjusted as needed, see explanation below.
```
Result format:
```text
Expand All @@ -66,8 +72,8 @@ The following `gesture` types are available:
- `undefined` - Unrecognised gesture.

To determine the final `gesture`:
- If the `has_motion` probability is smaller than a threshold (default `0.5`),
- If `has_motion` probability is smaller than `motion_threshold` (default `0.5`),
`gesture` is `stationary`. Other probabilities are irrelevant.
- Otherwise, we will look for the largest probability from `gestures`:
- If it is smaller than another threshold (default `0.9`), `gesture` is `undefined`,
- If it is smaller than `gesture_threshold` (default `0.9`), `gesture` is `undefined`,
- else, the corresponding gesture label is selected (e.g., `nodding`).

0 comments on commit e0f4646

Please sign in to comment.