GithubHelp home page GithubHelp logo

eoeefosa / fitness_counter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from indy9000/fitness_counter

0.0 0.0 0.0 28.78 MB

A Repetition Counter Application Built in Flutter on top of TensorFlow Lite PoseNet.

License: Creative Commons Zero v1.0 Universal

Objective-C 0.13% Java 3.67% Dart 94.77% Swift 1.43%

fitness_counter's Introduction

Fitness Counter

Home

Fitness Counter is your personalized fitness repetition counter app based on Flutter. It uses posenet, a pre-trained deep learning model, to estimate body poses in real time and Count the choses Excercise Repetitions.

DEMO SQUAT Counter

Squat Counter

Getting Started

Step 1: Clone the project repository

Open terminal and type

git clone https://github.com/AshwinB-hat/Fitness_Counter.git

Step 2: Run the app

Connect your device or start the emulator and run the following code

# change directories
cd

# run the app
flutter run

Project Structure

The project structure is quite primitive right now.

Let's look at the lib folder

project structure

Don't worry, we'll take a brief look at all the files in a minute! Let's start with main.dart

1. main.dart

main.dart loads data from shared preferences and the camera module. It also defines routes for home page.

2. home.dart

home.dart defines a Home class, which is a stateless widget. It contains buttons which routes the user to poses.dart according to the button they press. Each button (Single Option for now) call a method _onPoseSelect().

This _onPoseSelect() method is quite important as the arguments given to this function decides which list of poses needs to be shown on the poses page.

3. poses.dart

poses.dart defines a Poses class, which is a stateless widget. It shows a list of available poses as swipable cards. The code of the custom cards can be found in yoga_card.dart file. Each card is clickable and calls the _onSelect() method which directs the user to the InferencePage (inference.dart).

4. inference.dart

inference.dart defines a InferencePage class, which is a stateful widget. It is the class which loads the posenet model. It initializes the Camera object with the camera instance and _setRecognitions() callback function. The _setRecognitions() method is responsibe for saving the predicted output of the PoseNet model into a List (_recognitions). This list of predicted values (_recognitions) is then passed to BndBox's constructor.

You can read more about the implementation here.

5. camera.dart

camera.dart defines a Camera class, which is a stateful widget. It contains code related to camera initialization and calls Tflite.runPoseNetOnFrame() method by passing in the current CameraImage as an argument. The output (predictions) of this method is given as an argument to the _setRecognitions() method, which was passed to Camera() as callback.

6. bndbox.dart

bndbox.dart defines a BndBox class, which is a stateless widget. It takes the List of predictions (_recognitions) and plot keypoints on the screen. It also prints the accuracy of the model in %.

It also contains the logic of the Application Counter which counts the Repetitions.







Co-Contributor.

fitness_counter's People

Contributors

betapundit avatar ashwinb-hat avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.