File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -107,16 +107,25 @@ async def initialize(self):
107107 async def _initialize_models (self ):
108108 """Initialize neural network models."""
109109 try :
110- # Initialize DensePose model
110+ # Initialize DensePose model. DensePoseHead requires a config
111+ # dict — input_channels matches the modality translator's output
112+ # (256), with the standard DensePose 24 body parts and 2 (U,V)
113+ # coordinates. (Previously called with no args → TypeError at
114+ # startup, which broke the API service.)
115+ densepose_config = {
116+ 'input_channels' : 256 ,
117+ 'num_body_parts' : 24 ,
118+ 'num_uv_coordinates' : 2 ,
119+ }
111120 if self .settings .pose_model_path :
112- self .densepose_model = DensePoseHead ()
121+ self .densepose_model = DensePoseHead (densepose_config )
113122 # Load model weights if path is provided
114123 # model_state = torch.load(self.settings.pose_model_path)
115124 # self.densepose_model.load_state_dict(model_state)
116125 self .logger .info ("DensePose model loaded" )
117126 else :
118127 self .logger .warning ("No pose model path provided, using default model" )
119- self .densepose_model = DensePoseHead ()
128+ self .densepose_model = DensePoseHead (densepose_config )
120129
121130 # Initialize modality translation
122131 config = {
You can’t perform that action at this time.
0 commit comments