Revisiting model configurations #30
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
For the 1.0 release, I'd like to discuss, and potentially revisit, how models are configured in UpscalerJS.
There's three ways a user interacts with a model in UpscalerJS:
new Upscaler()
- By default, UpscalerJS will use theidealo/gans
, which afaik is not documented anywhere.)new Upscaler({ model: 'div2k-2x', scale: 2 })
)new Upscaler({ model: '/path/to/custom/model', scale: 2 })
)I'd wager the majority of people go with option 1. So it makes sense to choose a sensible default that offers a good tradeoff between performance and accuracy.
That said, there are many valid reasons to encourage people to explore option 2, and make it easy for them to do so. Today those include:
In the near future, those include:
Today, if a user wants to see what models are available, they can either call
getModelDefinitions
from within the package, or they're directed to this second repo - https://github.com/thekevinscott/UpscalerJS-models. The reason models live in a separate repo is because of size. Models must be served over the web (aka, not packaged) so we serve them via a CDN. Including these in the core npm library would bloat its download size significantly, which would be particularly frustrating given most users would only need a single model.That said, that particular repo is missing the default model used (idealo/gans) and doesn't provide a good way of experimenting with models to see how they perform with real world data. It's also hard to keep the two repos up to date (because the core UpscalerJS library must maintain references to the upscalerjs-models repo).
A word on models and their configuration.
To me, a model encompasses the following:
The end result of all of this configuration is a single model file.
Let's talk questions:
face-2x-grayscale
), or should they be more verbose, reflecting their underlying configuration (e.g.,esrgan-idealo-div2k-2-1-channel
, oresrgan/idealo/div2k/2/1-channel
)? If the former, where and how would a user learn more information about the particular model (how it was trained, how to reproduce the results)? If the latter, how do we form that string to effectively communicate the model's configuration?{ dataset: 'DIV2K', scale: 2, channels: 4 }
? If the latter, how do we handle cases where we don't have a model for a particular configuration?My top-level thoughts:
lerna
to publish two npm packages from this single repo.Curious to hear from others on your thoughts!
UPDATE (2/3/22)
Some updates since I wrote this post:
This is now done. Models live in the repo and are published as a separate package on NPM.
I also set out a roadmap that includes Node support as a precursor, so that's another thing worth considering in this discussion.
Beta Was this translation helpful? Give feedback.
All reactions