Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load keypoint yaml model #1

Open
guowenbin90 opened this issue Mar 2, 2023 · 0 comments
Open

Load keypoint yaml model #1

guowenbin90 opened this issue Mar 2, 2023 · 0 comments

Comments

@guowenbin90
Copy link
Owner

guowenbin90 commented Mar 2, 2023

detectron2 utilities

from detectron2 import model_zoo
from detectron2.engine import DefaultPredictor
from detectron2.config import get_cfg
from detectron2.utils.visualizer import Visualizer
from detectron2.data import MetadataCatalog, DatasetCatalog
from detectron2.structures import BoxMode

#Load pretrained models using model_zoo API, make predictions and visualize the output.
#First import the model zoo API and get a pretrained keypoint
#Faster R-CNN model with FBNetV3 backbone

cfg = get_cfg() # fresh config
cfg.merge_from_file(model_zoo.get_config_file("COCO-Keypoints/keypoint_rcnn_R_50_FPN_3x.yaml"))
cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.7 # set threshold for this model
cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-Keypoints/keypoint_rcnn_R_50_FPN_3x.yaml")
predictor = DefaultPredictor(cfg)

https://detectron2.readthedocs.io/en/v0.4.1/_modules/detectron2/model_zoo/model_zoo.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant