roop icon indicating copy to clipboard operation
roop copied to clipboard

[Draft] Uniform frame processor API

Open henryruhs opened this issue 2 years ago • 1 comments

  • 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

    1. process_frames() should forward to roop.processors.frame.core.process_frames()
    2. process_image() should forward to roop.processors.frame.core.process_image()
    3. process_video() already forward to roop.processors.frame.core.process_video()
  • Introduce a pre_process() hook for extract frames or move it to pre_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.

henryruhs avatar Jun 16 '23 08:06 henryruhs