janvarev / chain-img-processor

Chain IMG processor with plugins for neuronet pipelines etc.
MIT License
14 stars 1 forks source link

Suggestions #2

Open C0untFloyd opened 1 year ago

C0untFloyd commented 1 year ago

Hey, I'm working on implementing your image chaining lib into roop-unleashed and while doing this, I found some parts could stll be improved so more people might use it. I don't know if you would like suggestions as separate issues but here you go:

  1. A way to pause batch processing, stop and perhaps resume.
  2. A delegate/callback to display an image in different stages or different steps of batch processing. This could then be shown as preview image.
  3. Some sort of manner to pass global parameters from e.g. ChainVideoProcessor to the individual plugins. I know you can emulate this by using the passed parameters but this isn't clean nor safe.
  4. Similar to 3, accessible utility functions which can be accessed by a plugin, for example a method to use a pre-selected torch device.
  5. Prepare and release functions for the Classes which run a chain of plugins to free resources etc.
  6. A rewrite of the moviepy ffmpeg class rip. This seems to be very old and doesn't support HW acceleration or GIF writing.
  7. A verbose flag to suppress/enable those debug console prints
  8. A way to init plugins/core without .json files or change options on-the-fly

Anyway, these are my major concerns. Thanks for writing the library!

janvarev commented 1 year ago

Hi! Thanks for all of suggestions!

Some feedback:

  1. If there are an easy way to do it, it can be cool.
  2. Yes, was in plans. If you want implement by yourself, just add another "callback=None" param in ChainVideoProcessor call.
  3. Not sure about case to be. May be we need kind of "global" dict in ChainVideoProcessor
  4. If there are any useful utils, we can add it to ChainImgProc or ChainVideoProcessor, as I understand.
  5. Good idea, but a lot of requirements for Classes writing. I'm not into it (not sure how to manage resources, there are a lot of strategies), but if there are easy solution, it can be good.
  6. If there are any good replacement, feel free to add.
  7. Yes, some code needs clean
  8. There are an idea to add to jaa.py option to override plugins options by command line. Also, it can be done manually by call self.core.plugin_options(pluginname)["option"] = value. This will change in-memory. If you wanna save it, updating JSON, use self.core.save_plugin_options(pluginname,self.core.plugin_options(pluginname))
janvarev commented 1 year ago

About 6 - current ffmpeg moviepy class work pretty stable, and has no dependencies, so I like it due it's simplicity. But if there are good replacement, it could be added too (I hope as separate function, so user can choose).