roop
roop copied to clipboard
[Draft] Uniform frame processor API
- As not all frame_processors are equal we need to change the API of all hook methods a bit.
Examples:
def process_frame({
subject_image: ... # face, nose, hair can be optional
temp_frame: ...
})
def process_image({
subject_path: ... # face, nose, hair can be optional
target_path: ...
output_path: ...
})
-
In best case the processors only contains frame processor methods - the rest is just forwarded
- process_frames() should forward to roop.processors.frame.core.process_frames()
- process_image() should forward to roop.processors.frame.core.process_image()
- process_video() already forward to roop.processors.frame.core.process_video()
-
Introduce a
pre_process()hook for extract frames or move it topre_start()- so in-memory processors could skip that -
Introduce a hook that gives information what UI elements to render - the enhancer for example does not need a source face. Therefore the ui.py needs a resolve_ui_config() for the final elements to be rendered.
def ui_config() -> List[str]:
return ['select-source', 'select-target', 'button-preview']
- Replace related code in core.py and ui.py to new API.