System Design#

Our system includes a single standalone application that encapsulates the entire physiotherapy flow within itself.

Architecture#

_images/architecture-diagram.png

The following figure represent our application archiecture. Here you will find a brief description of each module shown.

Model#

Our Model module provides functionality to process video files, calculating angles between joints and conducting comparison calculations between 2 video streams that results in an accuracy score.

Submodules:

  1. Pose Module - our preprocessing enging that wraps up mediapipe to find landmarks and identify angles between joints of interest.

  2. Accuracy Model - Contains main video processing and comparison logic.

Video Module#

Our Video Module is responsible for displaying video streams in our application.

Submodules:

  1. Camera Thread - Runs OpenCV session to update user interface with camera feed, Queries the Model to display landmarks and update the accuracy graph.

  2. Video Thread - Updates user interface with the exercise video stream.

  3. Thread Manager - Makes sure that all threads are started and finished safely.

UI#

Our UI module contains code defining styling and positioning of UI elements. This code is automatically generated using QtDesigner app that allows creating user interface through drag and grop and then compiling it into python’s source code.

This module DOES NOT contain any application logic.

Pages Module#

The Pages modules contains application logic of Pages.

Widgets Module#

The Widgets modules contains application logic of arbitrary UI elements, that we create dynamically

UiElement#

The UiElement is an interface for all of our UI elements. The biggest advantage we gain from it is, when debugging we can avoid running precompilation script, and rather load ui directly from qml files. Very useful for when we need to quickly test the UI changes.

App#

The App modules cotntains main application logic. It is responsible changing pages, and accessing the Database.

Data Module#

The Data module contains a SQLITE database interface and tools, for managing the data from the DB.

Database#

_images/er-diagram.png
there are 3 main tables(exercises,attempts,tags).
  • Exercises table is used to take down all sorts of exercises.

  • An attempts informatation would be recorded into database when patients finish their exercise.

  • Tags are used to classify the exercise. And the tag_to_exercise table is generated because of the many to many relation between tags and exercises table.