This pull request addresses a Windows-specific path duplication issue in the a_person_mask_generator.py script. On Windows, the script incorrectly constructs the model file path by appending the base directory twice, resulting in a runtime error when attempting to initialize the MediaPipe ImageSegmenter.
Changes Made
Implemented a conditional check to prevent appending 'mediapipe' to models_path if it already ends with 'mediapipe', ensuring compatibility with Windows file paths.
Adjusted the construction of model_path to concatenate the model file name without duplicating the base directory path, specifically addressing Windows path concatenation behavior.
How to Test
On a Windows system, set up and run the process that utilizes the a_person_mask_generator script within the Stable Diffusion web UI.
Verify that the script executes without encountering the previous runtime error related to path duplication.
Issue Fixed
This fix resolves a Windows-specific runtime error caused by incorrect path construction in the a_person_mask_generator.py script, enhancing the script's compatibility and reliability on Windows platforms.
Description
This pull request addresses a Windows-specific path duplication issue in the
a_person_mask_generator.py
script. On Windows, the script incorrectly constructs the model file path by appending the base directory twice, resulting in a runtime error when attempting to initialize the MediaPipe ImageSegmenter.Changes Made
models_path
if it already ends with 'mediapipe', ensuring compatibility with Windows file paths.model_path
to concatenate the model file name without duplicating the base directory path, specifically addressing Windows path concatenation behavior.How to Test
a_person_mask_generator
script within the Stable Diffusion web UI.Issue Fixed
This fix resolves a Windows-specific runtime error caused by incorrect path construction in the
a_person_mask_generator.py
script, enhancing the script's compatibility and reliability on Windows platforms.