Convert Figma logo to code with AI

eldar logopose-tensorflow

Human Pose estimation with TensorFlow framework

1,137
384
1,137
65

Top Related Projects

31,037

OpenPose: Real-time multi-person keypoint detection library for body, face, hands, and foot estimation

Detectron2 is a platform for object detection, segmentation and other visual recognition tasks.

Pretrained models for TensorFlow.js

24,600

Mask R-CNN for object detection and instance segmentation on Keras and TensorFlow

The project is an official implement of our ECCV2018 paper "Simple Baselines for Human Pose Estimation and Tracking(https://arxiv.org/abs/1804.06208)"

Quick Overview

Pose-tensorflow is a GitHub repository that implements DeepCut, a method for multi-person pose estimation using deep learning. It provides tools for training and evaluating pose estimation models using TensorFlow, with a focus on human pose detection in images and videos.

Pros

  • Implements state-of-the-art pose estimation techniques
  • Supports multi-person pose detection
  • Provides pre-trained models for quick start
  • Offers flexibility for custom training and fine-tuning

Cons

  • Requires significant computational resources for training
  • May have a steep learning curve for beginners
  • Documentation could be more comprehensive
  • Dependency on specific TensorFlow versions may cause compatibility issues

Code Examples

  1. Loading a pre-trained model:
from config import load_config
from nnet import predict
from dataset.pose_dataset import data_to_input

cfg = load_config("path/to/config.yaml")
pose_net = predict.setup_pose_prediction(cfg)
  1. Performing pose estimation on an image:
import cv2

image = cv2.imread("path/to/image.jpg")
image_batch = data_to_input(image)
outputs = pose_net.predict(image_batch)
scmap, locref, paf = predict.extract_cnn_output(outputs, cfg)
  1. Visualizing the results:
from util import visualize

pose = predict.argmax_pose_predict(scmap, locref, cfg.stride)
visualize.show_heatmaps(cfg, image, scmap, pose)
visualize.show_arrows(cfg, image, paf)

Getting Started

  1. Clone the repository:

    git clone https://github.com/eldar/pose-tensorflow.git
    cd pose-tensorflow
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Download pre-trained models:

    ./download_models.sh
    
  4. Run the demo:

    python demo.py --image path/to/image.jpg
    

Competitor Comparisons

31,037

OpenPose: Real-time multi-person keypoint detection library for body, face, hands, and foot estimation

Pros of openpose

  • More comprehensive body keypoint detection, including face and hand keypoints
  • Better performance and real-time capabilities on GPU
  • Extensive documentation and community support

Cons of openpose

  • Higher system requirements and more complex setup process
  • Less flexibility in terms of customization and model architecture

Code Comparison

openpose:

// Configuring OpenPose
op::Wrapper opWrapper{op::ThreadManagerMode::Asynchronous};
opWrapper.configure(opWrapper);
opWrapper.start();

// Process and display results
opWrapper.emplaceAndPop(datumProcessed);

pose-tensorflow:

# Running inference
poseLifting = PoseLifting(model_file)
pose_2d = estimate_pose(image)
pose_3d = poseLifting.inference(pose_2d)

# Visualize results
visualize(image, pose_2d, pose_3d)

The openpose implementation is in C++ and focuses on real-time processing, while pose-tensorflow uses Python and provides a more straightforward API for 2D and 3D pose estimation. openpose offers more advanced features and better performance, but pose-tensorflow may be easier to integrate into existing Python projects and customize for specific needs.

Detectron2 is a platform for object detection, segmentation and other visual recognition tasks.

Pros of Detectron2

  • More comprehensive and actively maintained, with a wider range of object detection and segmentation models
  • Built on PyTorch, offering better flexibility and ease of use for deep learning researchers
  • Extensive documentation and community support

Cons of Detectron2

  • Steeper learning curve due to its more complex architecture
  • Potentially higher computational requirements for some models

Code Comparison

pose-tensorflow:

import tensorflow as tf
from pose_tensorflow.nnet import predict
config = tf.ConfigProto()
sess = tf.Session(config=config)
poseconfig = predict.load_config("path/to/config.yaml")

Detectron2:

from detectron2.config import get_cfg
from detectron2.engine import DefaultPredictor

cfg = get_cfg()
cfg.merge_from_file("path/to/config.yaml")
predictor = DefaultPredictor(cfg)

Key Differences

  • pose-tensorflow focuses specifically on human pose estimation, while Detectron2 covers a broader range of computer vision tasks
  • Detectron2 offers more pre-trained models and easier integration with other PyTorch-based projects
  • pose-tensorflow may be simpler to use for those specifically interested in pose estimation and familiar with TensorFlow

Pretrained models for TensorFlow.js

Pros of tfjs-models

  • Runs in the browser, enabling client-side pose estimation without server dependencies
  • Supports a wider range of pre-trained models for various tasks beyond pose estimation
  • Actively maintained by the TensorFlow team with frequent updates and improvements

Cons of tfjs-models

  • May have slower performance compared to native TensorFlow implementations
  • Limited to JavaScript environments, reducing flexibility for other programming languages
  • Potentially larger model sizes due to browser compatibility requirements

Code Comparison

pose-tensorflow:

import tensorflow as tf
from pose_tensorflow import PoseEstimator

estimator = PoseEstimator()
poses = estimator.estimate(image)

tfjs-models:

import * as poseDetection from '@tensorflow-models/pose-detection';

const detector = await poseDetection.createDetector(poseDetection.SupportedModels.MoveNet);
const poses = await detector.estimatePoses(image);

Summary

While pose-tensorflow offers native TensorFlow performance and Python integration, tfjs-models provides browser-based functionality and a broader range of pre-trained models. The choice between them depends on specific project requirements, such as deployment environment and performance needs.

24,600

Mask R-CNN for object detection and instance segmentation on Keras and TensorFlow

Pros of Mask_RCNN

  • More comprehensive object detection and instance segmentation capabilities
  • Better documentation and community support
  • Includes pre-trained models on COCO dataset

Cons of Mask_RCNN

  • Higher computational requirements
  • More complex architecture, potentially harder to customize
  • Less focused on human pose estimation specifically

Code Comparison

Mask_RCNN:

import mrcnn.model as modellib
from mrcnn import utils

class InferenceConfig(coco.CocoConfig):
    GPU_COUNT = 1
    IMAGES_PER_GPU = 1

model = modellib.MaskRCNN(mode="inference", config=InferenceConfig(), model_dir=MODEL_DIR)

pose-tensorflow:

from pose_tensorflow.nnet import predict
from pose_tensorflow.config import load_config

cfg = load_config("pose_cfg.yaml")
pose_estimator = predict.setup_pose_prediction(cfg)
pose_estimator.predict(image)

The code snippets show that Mask_RCNN has a more object-oriented approach, while pose-tensorflow uses a functional style. Mask_RCNN's setup appears more involved, reflecting its broader capabilities, while pose-tensorflow's code is more straightforward for pose estimation tasks.

The project is an official implement of our ECCV2018 paper "Simple Baselines for Human Pose Estimation and Tracking(https://arxiv.org/abs/1804.06208)"

Pros of human-pose-estimation.pytorch

  • Implemented in PyTorch, which offers dynamic computational graphs and easier debugging
  • More recent and actively maintained repository
  • Includes pre-trained models and demo scripts for quick start

Cons of human-pose-estimation.pytorch

  • Limited to 2D pose estimation, while pose-tensorflow supports both 2D and 3D
  • Fewer customization options compared to pose-tensorflow's modular architecture
  • Less extensive documentation and fewer examples than pose-tensorflow

Code Comparison

pose-tensorflow:

from config import load_config
from nnet import predict
from util import visualize

cfg = load_config("path/to/config.yaml")
pose_predictor = predict.setup_pose_prediction(cfg)
pose = pose_predictor.predict(image)
visualize.show_heatmaps(cfg, image, pose)

human-pose-estimation.pytorch:

from models.pose_resnet import get_pose_net
from utils.transforms import get_affine_transform

model = get_pose_net(cfg, is_train=False)
model.load_state_dict(torch.load(model_file))
trans = get_affine_transform(c, s, r, image_size)
input = cv2.warpAffine(image, trans, (int(image_size[0]), int(image_size[1])))
output = model(input)

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Human Pose Estimation with TensorFlow

Here you can find the implementation of the Human Body Pose Estimation algorithm, presented in the DeeperCut and ArtTrack papers:

Eldar Insafutdinov, Leonid Pishchulin, Bjoern Andres, Mykhaylo Andriluka and Bernt Schiele DeeperCut: A Deeper, Stronger, and Faster Multi-Person Pose Estimation Model. In European Conference on Computer Vision (ECCV), 2016

Eldar Insafutdinov, Mykhaylo Andriluka, Leonid Pishchulin, Siyu Tang, Evgeny Levinkov, Bjoern Andres and Bernt Schiele ArtTrack: Articulated Multi-person Tracking in the Wild. In Conference on Computer Vision and Pattern Recognition (CVPR), 2017

For more information visit http://pose.mpi-inf.mpg.de

Prerequisites

The implementation is in Python 3 and TensorFlow. We recommended using conda to install the dependencies. First, create a Python 3.6 environment:

conda create -n py36 python=3.6
conda activate py36

Then, install basic dependencies with conda:

conda install numpy scikit-image pillow scipy pyyaml matplotlib cython

Install TensorFlow and remaining packages with pip:

pip install tensorflow-gpu easydict munkres

When running training or prediction scripts, please make sure to set the environment variable TF_CUDNN_USE_AUTOTUNE to 0 (see this ticket for explanation).

If your machine has multiple GPUs, you can select which GPU you want to run on by setting the environment variable, eg. CUDA_VISIBLE_DEVICES=0.

Demo code

Single-Person (if there is only one person in the image)

# Download pre-trained model files
$ cd models/mpii
$ ./download_models.sh
$ cd -

# Run demo of single person pose estimation
$ TF_CUDNN_USE_AUTOTUNE=0 python3 demo/singleperson.py

Multiple People

# Compile dependencies
$ ./compile.sh

# Download pre-trained model files
$ cd models/coco
$ ./download_models.sh
$ cd -

# Run demo of multi person pose estimation
$ TF_CUDNN_USE_AUTOTUNE=0 python3 demo/demo_multiperson.py

Training models

Please follow these instructions

Citation

Please cite ArtTrack and DeeperCut in your publications if it helps your research:

@inproceedings{insafutdinov2017cvpr,
    title = {ArtTrack: Articulated Multi-person Tracking in the Wild},
    booktitle = {CVPR'17},
    url = {http://arxiv.org/abs/1612.01465},
    author = {Eldar Insafutdinov and Mykhaylo Andriluka and Leonid Pishchulin and Siyu Tang and Evgeny Levinkov and Bjoern Andres and Bernt Schiele}
}

@article{insafutdinov2016eccv,
    title = {DeeperCut: A Deeper, Stronger, and Faster Multi-Person Pose Estimation Model},
    booktitle = {ECCV'16},
    url = {http://arxiv.org/abs/1605.03170},
    author = {Eldar Insafutdinov and Leonid Pishchulin and Bjoern Andres and Mykhaylo Andriluka and Bernt Schiele}
}