Fix function name resolution for different preprocessors

Use getattr to dynamically call the correct function name for each
preprocessor (e.g. 'estimate_pose' for DWPose, 'execute' for others).
This resolves the 'object has no attribute execute' error.
This commit is contained in:
samizdat
2025-06-10 06:20:58 -04:00
parent 08130f179c
commit 4413057a33
+3 -2
View File
@@ -47,9 +47,10 @@ class MultiGPUPreprocessorWrapper:
# Temporarily override with consistent device
model_management.get_torch_device = lambda: torch.device(self.target_device)
# Create and execute original preprocessor
# Create and execute original preprocessor using its specific function name
preprocessor = self.preprocessor_class()
result = preprocessor.execute(**kwargs)
function_name = getattr(self.preprocessor_class, 'FUNCTION', 'execute')
result = getattr(preprocessor, function_name)(**kwargs)
return result
except Exception as e: