> This page is for NVIDIA Eye Contact NIM, version 1.0.0.
> For other versions, use one of these documentation indexes:
> - 1.5.0 (Latest) (default): https://docs.nvidia.com/nim/maxine/eye-contact/1.5.0/llms.txt
> - 1.4.0: https://docs.nvidia.com/nim/maxine/eye-contact/1.4.0/llms.txt
> - 1.3.0: https://docs.nvidia.com/nim/maxine/eye-contact/1.3.0/llms.txt
> - 1.2.0: https://docs.nvidia.com/nim/maxine/eye-contact/1.2.0/llms.txt
> - 1.1.0: https://docs.nvidia.com/nim/maxine/eye-contact/1.1.0/llms.txt
> - 1.0.0: https://docs.nvidia.com/nim/maxine/eye-contact/1.0.0/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nim/maxine/llms.txt.

# Running Inference

1. Perform a health check on the gRPC endpoint.

   - Install `grpcurl` from [here](https://github.com/fullstorydev/grpcurl/releases)

      Example commands to run on Ubuntu:
      ```bash
      $ wget https://github.com/fullstorydev/grpcurl/releases/download/v1.9.1/grpcurl_1.9.1_linux_amd64.deb
      $ sudo dpkg -i grpcurl_1.9.1_linux_amd64.deb
      ```

   - Download the health checking proto:
      ```bash
      $ wget https://raw.githubusercontent.com/grpc/grpc/master/src/proto/grpc/health/v1/health.proto
      ```

   - Run the health check:
      ```bash
      $ grpcurl --plaintext --proto health.proto localhost:8004 grpc.health.v1.Health/Check
      ```

   - If the service is ready, you will get a response similar to the following:
      ```bash
      { "status": "SERVING" }
      ```

2. Download the Maxine Eye Contact Python client code by cloning the [gRPC Client Repository](https://github.com/NVIDIA-Maxine/nim-clients):

   ```bash
   git clone https://github.com/NVIDIA-Maxine/nim-clients.git

   // Go to the 'eye-contact' folder

   cd nim-clients/eye-contact/

## Running Inference via Script

You can use the sample client script in the Maxine Eye Contact GitHub repo to send a gRPC request to the hosted NIM server:

Go to the scripts directory
```bash
cd scripts
```
Run the command to send gRPC request
```bash
python eye-contact.py --target <server_ip:port> --input <input file path> --output <output file path along with file name>
```

To view details of command line arguments run this command
```bash
python eye-contact.py -h
```
You will get a response similar to the following.
```bash
usage: eye-contact.py [-h] [--target TARGET] [--input INPUT] [--output OUTPUT]

Process mp4 video files using gRPC and apply Gaze-redirection.

options:
  -h, --help       show this help message and exit
  --target TARGET  The target gRPC server address.
  --input INPUT    The path to the input video file.
  --output OUTPUT  The path for the output video file.
```
If the command line arguments are not passed, the script will take the following default values:
- `target` is `127.0.0.1:8004`
- `input` is `../assets/sample_input.mp4`
- `output` will be the current directory with name `output.mp4`