Created
April 9, 2021 05:34
-
-
Save trongan93/5ac94cd368286ab1fbb84255f3fca956 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cfg = get_cfg() | |
# add project-specific config (e.g., TensorMask) here if you're not running a model in detectron2's core library | |
cfg.merge_from_file(model_zoo.get_config_file("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml")) | |
cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5 # set threshold for this model | |
# Find a model from detectron2's model zoo. You can use the https://dl.fbaipublicfiles... url as well | |
cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml") | |
predictor = DefaultPredictor(cfg) | |
outputs = predictor(im_test) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment