当前位置:网站首页>Getting started with detectron2

Getting started with detectron2

2022-04-23 21:01:00 Top of the program

This article briefly introduces detectron2 Use of built-in command line tools in

Reasoning demonstration of pre training model
from Model Zoon Select a model and configuration file , for example mask_rcnn_R_50_FPN_3x.yaml
Run this command

python demo.py --config-file ../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml --input jiejin.jpg --opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl

ModelZoon The configuration in is for training

Training and evaluation in the command line
tools/plain_train_net.py and tools/train_net.py, have access to ModelZoon Different configurations in , Model training . You can use it as a reference for writing your own training script . If you want to use these two scripts to train , May refer to datasets/README.md Build your own dataset , Then use the command :

./train_net.py \
  --config-file ../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml \
  --num-gpus 1 SOLVER.IMS_PER_BATCH 2 SOLVER.BASE_LR 0.0025

If you want to evaluate the model :

./train_net.py \
  --config-file ../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml \
  --eval-only MODEL.WEIGHTS /path/to/checkpoint_file

版权声明
本文为[Top of the program]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/111/202204210545090270.html