Git Product home page Git Product logo

trt_pose_demo's Introduction

trt_pose_demo

A Demo Application for NVIDIA TensorRT Pose Estimation

What does this application do?

This application just displays pose estimation results for camera-captured video or H.264/H.265 video file with NVIDIA TensorRT pose estimation. This application also has a capability to save the results in a CSV file.

Prerequisites

  • NVIDIA Jetson Nano/TX2/AGX Xavier Developer Kit with JetPack installed
  • USB web camera or MIPI CSI camera like Raspberry Pi v2 camera

Setup

  1. Install PyTorch and torchvision. Please refer to this page.
  2. Install NVIDIA-AI-IOT/torch2trt.
  3. Install NVIDIA-AI-IOT/trt_pose.
  4. Install this application.
    $ git clone https://github.com/MACNICA-CLAVIS-NV/trt_pose_demo
    $ cd trt_pose_demo
    
  5. Copy the resnet18_baseline_att_224x224_A model file to the application directory.
  6. Copy the human_pose.json task description file to the application directory.

Usage

First, clock up your Jetson.

$ sudo nvpmodel -m 0
$ sudo jetson_clocks

The following command starts this application.

$ python3 trt_pose_app.py [-h] [--camera CAMERA_NUM] [--width WIDTH]
                       [--height HEIGHT] [--fps FPS] [--qsize QSIZE] [--qinfo]
                       [--mjpg] [--title TITLE] [--nodrop] [--repeat] [--h265]
                       [--model MODEL] [--task TASK_DESC] [--csv MAX_CSV_REC]
                       [--csvpath CSV_PATH] [--verbose]
                       [SRC_FILE]

TRT Pose Demo

positional arguments:
  SRC_FILE              Source video file

optional arguments:
  -h, --help            show this help message and exit
  --camera CAMERA_NUM, -c CAMERA_NUM
                        Camera number, use any negative integer for MIPI-CSI
  --width WIDTH         Capture width
  --height HEIGHT       Capture height
  --fps FPS             Capture frame rate
  --qsize QSIZE         Capture queue size
  --qinfo               If set, print queue status information
  --mjpg                If set, capture video in motion jpeg format
  --title TITLE         Window title
  --nodrop              If set, disable frame drop feature
  --repeat              If set, repeat video decoding
  --h265                If set, the specified video file will be assumed as
                        H.265. Otherwise, assumed as H.264
  --model MODEL         Model weight file
  --task TASK_DESC      Task description file
  --csv MAX_CSV_REC     Maximum CSV records
  --csvpath CSV_PATH    Directory path to save CSV files
  --verbose             If set, print debug message

For MIPI-CSI camera, use any negative number as the camera number.

$ python3 trt_pose_app.py --camera -1 

For USB Web camera, if you camera is detected as /dev/video1, use 1 as the camera number.

$ python3 trt_pose_app.py --camera 1

To get a CSV output, please use the --csv option with the maximum capture frames. You can specify the directory to hold the CSV file with the --csvpath option.

$ python3 trt_pose_app.py --camera 0 --csv 1000 --csvpath ./logs

To use the densenet121_baseline_att_256x256_B_epoch_160.pth pre-trained model which is also released at the resnet18_baseline_att_224x224_A model file, use the --model option.

$ python3 trt_pose_app.py --camera 0 --model densenet121_baseline_att_256x256_B_epoch_160.pth

This application can accept not only camera capture but also H.264 movie file as input. For high resolution movie file input, the --nodrop option might be needed.

$ python3 trt_pose_app.py --nodrop test.mov

trt_pose_demo's People

Contributors

tfuru-macnica avatar

Stargazers

Quartz avatar narutaro avatar B.Berkay Aydın avatar  avatar Sean Stevens avatar George Igwegbe avatar FREEWING.JP avatar Jacky avatar lm_xu avatar  avatar  avatar AlbertoSardo avatar XiangjiBU avatar  avatar

Watchers

James Cloos avatar AlbertoSardo avatar  avatar

trt_pose_demo's Issues

Fail to run densenet121_baseline model

Hi,
Thanks for sharing. I ran resnet18_baseline model on Jetson xavier, it works well !
But it failed to run densenet121_baseline model.
ps:
I modify trt_pose_app.py like this:
WIDTH = 256
HEIGHT = 256
INPUT_RES = (WIDTH, HEIGHT)
MODEL_WEIGHTS = 'densenet121_baseline_att_256x256_B_epoch_160.pth'
OPTIMIZED_MODEL = 'densenet121_baseline_att_256x256_B_epoch_160_trt.pth'

Want to use an image.

Hi.
I believe this application is performing skeletal detection of a person in a video.
I would like to perform skeletal detection from images, not videos.
Is it possible to modify the program to perform skeletal detection from images?

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.