virtex.model_zoo


A utility module to easily load common VirTex models (optionally with pretrained weights) using a single line of code.

Get our full best performing VirTex model (with pretrained weights as):

>>> import virtex.model_zoo as mz
>>> model = mz.get("width_ablations/bicaptioning_R_50_L1_H2048.yaml", pretrained=True)

Any config available in configs/ directory under project root can be specified here, although this command need not be executed from project root. For more details on available models, refer VirTex Model Zoo.

Part of this code is adapted from Detectron2’s model zoo; which was originally implemented by the developers of this codebase, with reviews and further changes by Detectron2 developers.

class virtex.model_zoo.model_zoo._ModelZooUrls[source]

Bases: object

Mapping from config names to URL suffixes of pretrained weights.

virtex.model_zoo.model_zoo.get(config_path: str, pretrained: bool = False)[source]

Get a model specified by relative path under Detectron2’s official configs/ directory.

Parameters
  • config_path – Name of config file relative to configs/ directory under project root. (E.g. width_ablations/bicaptioning_R_50_L1_H2048.yaml)

  • pretrained – If True, will initialize the model with the pretrained weights. If False, the weights will be initialized randomly.