Important
NeMo 2.0 is an experimental feature and currently released in the dev container only: nvcr.io/nvidia/nemo:dev. Please refer to NeMo 2.0 overview for information on getting started.
Framework Inference
For CLIP models, our inference script calculates CLIP similarity scores between a given image and a list of provided texts.
To enable the inference stage with a CLIP model, configure the configuration files:
In the
defaults
section ofconf/config.yaml
, update thefw_inference
field to point to the desired CLIP configuration file. For example, if you want to use theclip/clip_similarity
configuration, change thefw_inference
field toclip/clip_similarity
.
defaults:
- fw_inference: clip/clip_similarity
...
In the
stages
field ofconf/config.yaml
, make sure thefw_inference
stage is included. For example,
stages:
- fw_inference
...
Configure
image_path
andtexts
fields ofconf/fw_inference/clip/clip_similarity.yaml
. Setimage_path
to the path of the image for inference, and provide a list of texts for thetexts
field.Execute the launcher pipeline:
python3 main.py
.
Remarks:
To load a pretrained checkpoint for inference, set the
restore_from_path
field in themodel
section to the path of the pretrained checkpoint in.nemo
format inconf/fw_inference/clip/clip_similarity.yaml
. By default, this field links to the.nemo
format checkpoint located in the CLIP training checkpoints folder.