class_docstr: Implement DirectPose.
class_docstr_tok: ["Implement","DirectPose","."]
code: def __init__(self, cfg, input_shape: Dict[str, ShapeSpec]):
      super().__init__()
      self.in_features = cfg.CONFIG.MODEL.DIRECTPOSE.IN_FEATURES
      self.fpn_strides = cfg.CONFIG.MODEL.DIRECTPOSE.FPN_STRIDES
      self.yield_proposal = cfg.CONFIG.MODEL.DIRECTPOSE.YIELD_PROPOSAL
  
      self.directpose_head = DIRECTPOSEHead(
          cfg, [input_shape[f] for f in self.in_features]
      )
      self.in_channels_to_top_module = (
          self.directpose_head.in_channels_to_top_module
      )
  
      self.directpose_outputs = DirectPoseOutputs(cfg)
  
imports: import math
  from typing import List, Dict
  import torch
  from torch import nn
  from torch.nn import functional
  from torch.autograd import Variable
  import numpy
  from ...utils.comm import compute_locations
  from ...nn.shape_spec import ShapeSpec
  from ...nn.batch_norm import NaiveSyncBatchNorm
  from ...nn.deform_conv import DeformConvWithChangeableStride
  from ...nn.group_norm import NaiveGroupNorm
  from .directpose_outputs import DirectPoseOutputs
label_desc: Use image node_id 1 to create a new DirectPose object from inherited base classes: nn with example: obj = DirectPose(cfg, input_shape)