Giter Site home page Giter Site logo

howsmysalute's Introduction

HowsMySalute

This is a simple computer vision program to try to determine if someone's "salute" pose meets USMC standards. Marine Corps Order (MCO) 5060.20 covers the requirements for a proper salute.

When "SALUTE" is given, raise your right hand smartly in the most direct manner until the tip of your forefinger touches the lower part of the headdress above and slightly right of your right eye. Your fingers should be extended straight and joined with the thumb along the forefinger. You should be able to see your entire palm when looking straight ahead. Your upper arm should be parallel with the deck with the elbow in line with the body and your forearm at a 45-degree angle. Your wrist and hand should be straight, a continuation of the line made by your forearm. At the same time, if not in ranks, turn your head and eyes toward the person or colors you are saluting.

This script will track to following parts of the requirement:

  • Upper Arm is parallel to the deck
  • Forearm is at a 45 degree angle
  • Wrist and hand is a in-line with the forearm
  • Palm is visible

To prepare your system for the script, make sure python 3 is installed along with mediapipe, OpenCV, numpy flask and matplotlib. The pip program can be used for the installation.

pip install mediapipe
pip install flask
pip install matplotlib

Information about Mediapipe can be found here

For the landmarks that are used by Mediapipe, please refer to the below graphics.

Pose:

pose_landmarks

Hands:

hand_landmarks

To run the code, use the command

python app.py

If you want to build this as a Podman container, a Dockerfile is included. Run the following commands to build and run the container:

$ podman build --layers=false -t howsmysalute .
$ podman run -d --name howsmysalute --security-opt label=disable --device /dev/video0 -p 8080:8080 localhost/howsmysalute

Note that the --security-opt label=disable option is only needed to keep SELinux from blocking access to the webcam from the container.

The SELinux Boolean container_use_devices may have to be set to a value of '1' to allow the container to access the camera.

Open a browser to http://localhost:8080 to see the mirrored image of yourself. See if you can hold the salute for 3-5 seconds.

If you are going to access this over the network, make sure that port 8080 is open on the firewall.

howsmysalute's People

Contributors

tedbrunell avatar rlucente-se-jboss avatar cversky-rh avatar trevorbryant 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.