This document provides a brief intro of the usage of MaskDINO.
Please see Getting Started with Detectron2 for full usage.
- Pick a model and its config file
- for example
- config file at
/configs/coco/instance-segmentation/maskdino_R50_bs16_50ep_3s.yaml
. - Model file MaskDINO (hid 1024)
- config file at
- We provide
demo.py
that is able to demo builtin configs. - Run it with:
cd demo/
python demo.py --config-file /configs/coco/instance-segmentation/maskdino_R50_bs16_50ep_3s.yaml \
--input input1.jpg input2.jpg \
[--other-options]
--opts MODEL.WEIGHTS /path/to/model_file
The configs are made for training, therefore we need to specify MODEL.WEIGHTS
to a model from model zoo for evaluation.
This command will run the inference and show visualizations in an OpenCV window.
For details of the command line arguments, see demo.py -h
or look at its source code
to understand its behavior. Some common arguments are:
- To run on your webcam, replace
--input files
with--webcam
. - To run on a video, replace
--input files
with--video-input video.mp4
. - To run on cpu, add
MODEL.DEVICE cpu
after--opts
. - To save outputs to a directory (for images) or a file (for webcam or video), use
--output
.