Skip to main content
NVIDIA
NVIDIA

Relighting

Downloadable

Re-illuminate people in video to match target lighting from a 360 HDRI environment map.

Getting Started

Relighting uses gRPC APIs for inferencing requests. The following instructions demonstrate the usage of the Relighting model using Python client.

Prerequisites

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

Download the Relighting Python client

Download 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/relighting

Install the dependencies for the Relighting Python client:

Bash
sudo apt-get install python3-pip
pip install -r requirements.txt

Run Python Client

Navigate to the scripts directory

Bash
cd scripts

Send gRPC request

Bash
python relighting.py --preview-mode \
--target grpc.nvcf.nvidia.com:443 \
--function-id 253bc77f-2d6c-4b9d-86c6-c6fb0f9e239c \
--api-key $NVIDIA_API_KEY \
--video-input <input_file_path> \
--output <output_file_path>

Note the requirements for input file:

  • The supported file type is mp4 with H.264 codec.
  • The size limit for the input video is 100 MiB (104,857,600 bytes).
  • The size limit for the background image is 25 MiB (26,214,400 bytes).
  • HDRI environment maps in Radiance .hdr format are supported for custom lighting.

Refer the documentation for more information.