Skip to main content
NVIDIA
NVIDIA

3D Body Pose

DownloadableFree Endpoint

Estimate 3D human body pose and skeleton from video input.

API Reference
Deploying your application in production? Get started with a 90-day evaluation of NVIDIA AI Enterprise

Follow the steps below to download and run the NVIDIA NIM inference microservice for this model on your infrastructure of choice.

Generate API Key

Pull and Run the NIM

The 3D Body Pose NIM uses gRPC APIs for inferencing requests.

An NGC API Key is required to pull the container image and download models from NGC. Pass the value of the API Key to the docker run command in the next section as the NGC_API_KEY environment variable as indicated.

If you are not familiar with how to create the NGC_API_KEY environment variable, the simplest way is to export it in your terminal:

Bash
export NGC_API_KEY=<PASTE_API_KEY_HERE>

Run one of the following commands to make the key available at startup:

Bash
# If using bash
echo "export NGC_API_KEY=<value>" >> ~/.bashrc

# If using zsh
echo "export NGC_API_KEY=<value>" >> ~/.zshrc

Other, more secure options include saving the value in a file, so that you can retrieve it with cat $NGC_API_KEY_FILE, or using a password manager.

To pull the NIM container image from NGC, first authenticate with the NVIDIA Container Registry with the following command:

Bash
echo "$NGC_API_KEY" | docker login nvcr.io --username '$oauthtoken' --password-stdin

Optionally, set the model profile that matches your GPU. If omitted, the NIM automatically selects the correct profile based on the detected hardware. To list the profiles available in the container, run:

Bash
docker run --rm --runtime=nvidia --gpus all -e NGC_API_KEY=$NGC_API_KEY \
  nvcr.io/nim/nvidia/body-pose:1.0.0 list-model-profiles

Compute capability 8.0 or newer is required. NVIDIA T4 (compute capability 7.5, sm75) is not supported. For details on profiles, refer to Model Manifest Profiles.

Bash
export NIM_MODEL_PROFILE=<profile_id_from_list-model-profiles>

The following command launches the 3D Body Pose container with the gRPC service. Find reference to runtime parameters for the container here.

Bash
docker run -it --rm --name=body-pose-nim \
  --runtime=nvidia \
  --gpus all \
  --shm-size=8GB \
  -e NGC_API_KEY=$NGC_API_KEY \
  -e NIM_MODEL_PROFILE=$NIM_MODEL_PROFILE \
  -e NV_AI4M_MAX_CONCURRENCY_PER_GPU=1 \
  -e NIM_HTTP_API_PORT=8000 \
  -e NIM_GRPC_API_PORT=8001 \
  -p 8000:8000 \
  -p 8001:8001 \
  nvcr.io/nim/nvidia/body-pose:1.0.0

NV_AI4M_MAX_CONCURRENCY_PER_GPU caps how many streams the NIM will serve at once per GPU. The value above is the container's own default. Raise it to run more streams concurrently -- the hosted endpoint on build.nvidia.com runs 4 on a single L40S. A request that arrives when every slot is taken is refused with RESOURCE_EXHAUSTED rather than queued, so size this for your workload rather than leaving it at 1 and retrying.

Please note, the flag --gpus all is used to assign all available GPUs to the docker container. To assign specific GPUs to the docker container (in case of multiple GPUs available in your machine) use --gpus '"device=0,1,2..."'

If the command runs successfully, you will get an output ending similar to the following:

Bash
Triton server is ready
[INFO MAXINE BASE LOGGER ... base_service.py:_serve_threading:295 PID:...] Using Insecure Server Credentials
[INFO MAXINE BASE LOGGER ... base_service.py:_serve_threading:300 PID:...] Listening to 0.0.0.0:8001

By default the 3D Body Pose gRPC service is hosted on port 8001. You will use this port for inferencing requests. The port is configurable via the NIM_GRPC_API_PORT environment variable.

Verify the NIM is Ready

Install grpcurl from github.com/fullstorydev/grpcurl/releases and perform a health check:

Bash
wget https://raw.githubusercontent.com/grpc/grpc/master/src/proto/grpc/health/v1/health.proto
grpcurl --plaintext --proto health.proto localhost:8001 grpc.health.v1.Health/Check

If the service is ready, you get a response similar to:

Bash
{ "status": "SERVING" }

Test the NIM

You will need a system with git and Python 3.10+ installed.

Download the 3D Body Pose Python client code by cloning the NVIDIA AI for Media NIM Clients Repository:

Bash
git clone https://github.com/NVIDIA-Maxine/nim-clients.git
cd nim-clients/body-pose

Install the dependencies for the Python client:

Bash
python3 -m pip install -r requirements.txt

Go to the scripts directory:

Bash
cd scripts

Run the command to send a gRPC request:

Bash
python3 body_pose.py --target <server_ip:port> --video-input <input_file_path> --output <output_file_path>

Example command with sample input:

Bash
python3 body_pose.py --target 127.0.0.1:8001 \
  --video-input ../assets/sample_input.mp4 \
  --output ../assets/sample_output.arrow

Note the requirements for the input file:

  • The supported file type is mp4 with the H.264 codec.
  • The size limit for the input file is 50 MB.

Refer to the documentation for more information.