Run an inference demo with pre-trained models
mainUse demo.py to run inference and visualize results using OpenCV. You must provide a configuration file and specify the model weights using the MODEL.WEIGHTS option, as the default configs are designed for training.
Common arguments:
--webcam: Run inference on your webcam.--video-input <path>: Run inference on a video file.--output <path>: Save outputs to a directory (for images) or a file (for webcam/video).--opts MODEL.DEVICE cpu: Run inference on the CPU instead of GPU.
cd demo/
python demo.py --config-file ../configs/coco/panoptic-segmentation/maskformer2_R50_bs16_50ep.yaml \
--input input1.jpg input2.jpg \
--opts MODEL.WEIGHTS /path/to/checkpoint_file