GithubHelp home page GithubHelp logo

human-pose-test's Introduction

human-pose-test

This a my personnal sandbox for test with various machine learning models in Python. It started with tests on human pose detection (hence the name).

Prerequisites

To use these scripts, you need Intel's OpenVino toolkit down installed on your machine and the OpenCV as well. You can read more about both these.

  • OpenCV - The simple install should look like pip install opencv-python.
  • OpenVino toolKit - See website for installation depending of your configuration.

Human pose

The scripts main.py and mainpi.py are my (windows) desktop and raspberry pi tests on human pose detection.

Model used

For these tests, I used the human-pose-estimation-0001 model, included in the standard distribution of OpenVino.

This is a multi-person 2D pose estimation network (based on the OpenPose approach) with tuned MobileNet v1 as a feature extractor. It finds a human pose: body skeleton, which consists of keypoints and connections between them, for every person inside image. The pose may contain up to 18 keypoints: ears, eyes, nose, neck, shoulders, elbows, wrists, hips, knees and ankles.

More information here.

Output example

Emotion recognition

The scripts emotion.py and emotionpi.py are my (windows) desktop and raspberry pi tests on Emotion recognition.

Model used

For these tests, I used the emotions-recognition-retail-0003 model, included in the standard distribution of OpenVino.

It's a fully convolutional network for recognition of five emotions ('neutral', 'happy', 'sad', 'surprise', 'anger').

More information here.

Output example

BERT

The script bert.py is my test playing with similar questions recognition with BERT.

The script bert_questions.py takes the file questions.txt for reference and asks the user to input a new question. It tries to find the 5 most similar questions in its reference file.

Model used

BERT (Bidirectional Encoder Representations from Transformers) provides dense vector representations for natural language by using a deep, pre-trained neural network with the Transformer architecture. It was originally published by Jacob Devlin, Ming-Wei Chang, Kenton Lee, Kristina Toutanova: "BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding", 2018.

I based my tests on the "multilingual_L-12_H-768_A-12" model that I found on the Google Research Github page.

Cat detection

The script cat.py is my test base of what became the AceVINOtura project with help from some other Udacity students (see acknowledgements).

A lot of stuff is hardcoded in this script :

  • the paths to the source video file used and the output file generated
  • the path to the (windows) openvino CPU extension
  • the path to the model (frozen_inference_graph.xml)
  • the coordinates of the "forbidden zone" describing the zone where the cat should not go
  • the confidence threshold for the model detections

Output examples

Model used

The model used (and not included in this repository) is a OpenVino IR converted from the ssdlite_mobilenet_v2_coco of the Tensorflow model zoo.

Conversion was made with the following command :

python mo_tf.py --input_model ssdlite_mobilenet_v2_coco\frozen_inference_graph.pb --tensorflow_use_custom_operations_config extensions\front\tf\ssd_v2_support.json --tensorflow_object_detection_api_pipeline_config ssd_mobilenet_v2_coco.config --data_type FP16

Performance counts

The script perf_counts.py is just a quick & simple example of running the method get_perf_counts() on an inference request using the OpenVino framework. This is a very nice diagnostic tool and I'm glad to have discovered it.

Licence

These scripts are my work for personnal testing of various models. They are based on course content from Udacity "Intel Edge AI Scholarship Foundation Course".

The tokenisation.py and input_feature.py scripts I used for my BERT tests are works from the Google AI Language Team and licensed under the Apache License, Version 2.0 (the "License");

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.