Basic Inference
This guide demonstrates how to perform basic inference with the Synthetic Video Detector NIM over gRPC.
Prerequisites
-
Ensure that the Synthetic Video Detector NIM container is running. For container launch instructions, refer to Getting Started.
-
Verify that the service is accessible by performing a health check on the gRPC endpoint.
-
Install
grpcurlfrom github.com/fullstorydev/grpcurl/releases.Example commands to run on Ubuntu:
-
Download the health checking proto:
-
Run the health check:
If the service is ready, you get a response similar to the following:
For using grpcurl with an SSL-enabled server, avoid using the
--plaintextargument, and use--cacertwith a CA certificate,--keywith a private key, or--certwith a certificate file. For more details, refer togrpcurl --help. -
-
Download the Synthetic Video Detector Python client code by cloning the Clients repository (NVIDIA-Maxine/nim-clients):
-
Install the required dependencies:
Compile the Protos (Optional)
If you want to use the client code provided in the Clients repository (NVIDIA-Maxine/nim-clients), you can skip this step.
The proto files are available in the synthetic-video-detector/protos folder. You can compile them to generate client interfaces in your preferred programming language. For more details, refer to Supported languages in the gRPC documentation.
The following is an example of how to compile the protos for Python on Linux and Windows.
The grpcio version needed for compilation can be referred from requirements.txt
To compile protos on Linux:
To compile protos on Windows:
Input and Output
The input and output of the Synthetic Video Detector NIM are mp4 files. The input file must use the H.264 codec for video and can include audio. The output file contains an overall synthetic probability, with optional intermediate results for analysis.
Videos with Variable Frame Rate (VFR) are not supported.
The Synthetic Video Detector is sensitive to video transcoding and compression; detection accuracy may degrade as compression levels increase.
Running Inference
To run the Synthetic Video Detector NIM, run the Synthetic Video Detector sample client without any additional flags:
Go to the scripts directory:
Send a gRPC request:
The first inference is not indicative of the model’s actual performance because it includes the time taken by the inference server to load the models in addition to the time required to process the inference request.
Usage for Preview API Request
To view details of command-line arguments, run the following command:
You get a response similar to the following. All parameters are optional.
Python Notebook
For an interactive experience and to explore all feature parameters, we provide a comprehensive Python notebook that demonstrates the Synthetic Video Detector service capabilities.
The Python notebook is located at notebook/synthetic_video_detector_notebook.ipynb in the synthetic-video-detector client folder.