class_docstr: Embedder module that serves as a container for embedders to use with different
  meshes. Extends Module to automatically save / load state dict.
class_docstr_tok: ["Embedder","module","that","serves","as","a","container","for","embedders","to","use","with","different","meshes",".","Extends","Module","to","automatically","save","\/","load","state","dict","."]
docstr: Initialize mesh embedders. An embedder for mesh `i` is stored in a submodule
  "embedder_{i}".
  
  Args:
      cfg (CfgNode): configuration options
docstr_tok: ["Initialize","mesh","embedders",".","An","embedder","for","mesh","`","i","`","is","stored","in","a","submodule","''","embedder_","{","i","}","''",".","Args",":","cfg","(","CfgNode",")",":","configuration","options"]
code: def __init__(self, cfg: CfgNode):
      """
      Initialize mesh embedders. An embedder for mesh `i` is stored in a submodule
      "embedder_{i}".
  
      Args:
          cfg (CfgNode): configuration options
      """
      super(Embedder, self).__init__()
      self.mesh_names = set()
      embedder_dim = cfg.MODEL.ROI_DENSEPOSE_HEAD.CSE.EMBED_SIZE
      logger = logging.getLogger(__name__)
      for (
          mesh_name,
          embedder_spec,
      ) in cfg.MODEL.ROI_DENSEPOSE_HEAD.CSE.EMBEDDERS.items():
          logger.info(
              f"Adding embedder embedder_{mesh_name} with spec {embedder_spec}"
          )
          self.add_module(
              f"embedder_{mesh_name}",
              create_embedder(embedder_spec, embedder_dim),
          )
          self.mesh_names.add(mesh_name)
      if cfg.MODEL.WEIGHTS != "":
          self.load_from_model_checkpoint(cfg.MODEL.WEIGHTS)
  
file_path: detectron2/projects/DensePose/densepose/modeling/cse/embedder.py
imports: import logging
  import numpy
  import pickle
  from enum import Enum
  from typing import Optional
  import torch
  from torch import nn
  from detectron2.config import CfgNode
  from detectron2.utils.file_io import PathManager
  from .vertex_direct_embedder import VertexDirectEmbedder
  from .vertex_feature_embedder import VertexFeatureEmbedder
label_desc: Use image node_id 1 to create a new Embedder object from inherited base classes: nn with example: obj = Embedder(cfg)