Quickstart Guide#
This page will walk you through running inference with the pre-trained Cosmos-Reason1-7B model on a sample video.
Basic Example#
Run the inference_sample.py script to instruct the Cosmos-Reason1-7B model to describe what happens in the sample video.
./scripts/inference_sample.py
Complete Examples#
The inference.py example script allows you to perform the following
inference tasks:
- Caption the sample video: - ./scripts/inference.py --prompt prompts/caption.yaml --videos assets/sample.mp4 -v 
- Ask a question about the sample video with reasoning: - ./scripts/inference.py --prompt prompts/question.yaml --question 'What are the potential safety hazards?' --reasoning --videos assets/sample.mp4 -v 
- Temporally caption the sample video and save the input frames to - outputs/temporal_caption_textfor debugging:- ./scripts/inference.py --prompt prompts/temporal_caption_text.yaml --videos assets/sample.mp4 --timestamp -v -o outputs/temporal_caption_text 
Configuring Inference#
You can configure inference by editing the following files:
- Prompts: - prompts/README.md
- Sampling Parameters: - configs/sampling_params.yaml
- Vision Processor Configuration: - configs/vision_config.yaml
Next Steps#
The Using Cosmos-Reason1 for Rejection Sampling page outlines how to use Cosmos-Reason1 to perform rejection sampling on videos produced by Cosmos-Predict.
Refer to the Reason1 Post-Training Guide to learn more about post-training the Reason1 model.