From bc42ae7903cdfc9ac90ec63d75b090b0cbcdeced Mon Sep 17 00:00:00 2001 From: ruv Date: Tue, 2 Jun 2026 11:42:52 +0200 Subject: [PATCH] =?UTF-8?q?fix(v1-api):=20pass=20required=20config=20to=20?= =?UTF-8?q?DensePoseHead=20=E2=80=94=20green=20main=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "Continuous Integration" workflow (Performance Tests + API Documentation jobs) has failed on every main commit since the API start path was exercised: pose_service._initialize_models() called `DensePoseHead()` with no args, but DensePoseHead.__init__ requires a config dict → "TypeError: DensePoseHead.__init__() missing 1 required positional argument: 'config'" → uvicorn "Application startup failed". Pass a config: input_channels=256 (matches the modality translator's output), num_body_parts=24 (DensePose standard), num_uv_coordinates=2. Both call sites (with/without pose_model_path) fixed. Verified locally: DensePoseHead(config) + ModalityTranslationNetwork(config) both construct + eval, clearing the startup TypeError. --- archive/v1/src/services/pose_service.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/archive/v1/src/services/pose_service.py b/archive/v1/src/services/pose_service.py index 436c21f8a6..4b2f36ab51 100644 --- a/archive/v1/src/services/pose_service.py +++ b/archive/v1/src/services/pose_service.py @@ -107,16 +107,25 @@ async def initialize(self): async def _initialize_models(self): """Initialize neural network models.""" try: - # Initialize DensePose model + # Initialize DensePose model. DensePoseHead requires a config + # dict — input_channels matches the modality translator's output + # (256), with the standard DensePose 24 body parts and 2 (U,V) + # coordinates. (Previously called with no args → TypeError at + # startup, which broke the API service.) + densepose_config = { + 'input_channels': 256, + 'num_body_parts': 24, + 'num_uv_coordinates': 2, + } if self.settings.pose_model_path: - self.densepose_model = DensePoseHead() + self.densepose_model = DensePoseHead(densepose_config) # Load model weights if path is provided # model_state = torch.load(self.settings.pose_model_path) # self.densepose_model.load_state_dict(model_state) self.logger.info("DensePose model loaded") else: self.logger.warning("No pose model path provided, using default model") - self.densepose_model = DensePoseHead() + self.densepose_model = DensePoseHead(densepose_config) # Initialize modality translation config = {