Last active
July 18, 2020 10:14
-
-
Save j-adamczyk/b7896ab88582d8ba1e2fd86489de9706 to your computer and use it in GitHub Desktop.
Detectron2 demo article - gist 2
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
from detectron2 import model_zoo | |
from detectron2.config import get_cfg, CfgNode | |
from detectron2.engine import DefaultPredictor | |
if __name__ == "__main__": | |
args: argparse.Namespace = _get_parsed_args() | |
cfg: CfgNode = get_cfg() | |
cfg.merge_from_file(model_zoo.get_config_file(args.base_model)) | |
cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url(args.base_model) | |
cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5 | |
predictor: DefaultPredictor = DefaultPredictor(cfg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment