When creating a new backend, a new test or a new tool, you often need the functionality to run a user-defined model on a set of provided inputs (e.g. image files).
In many cases, this general functionality is very similar to ModelRunner, Loader and ImageClassifier, but with certain customizations. But as of now, one cannot easily reuse these functionalities and has to duplicate a lot of code.
Ideally, we should re-factor ModelRunner/Loader/ImageClassifier and make this general functionality reusable. This way we could easily write small tests/tools like this without duplicating a lot of boiler-plate code.
I think this is a very good idea. For this, I think the code should stop directly accessing options information through global variables. Except main(), functions should only use parameters. This will make the code more easily reusable and this code could be put in a separate library.
@tlepley-cadence Totally agree with you! I had exactly this in mind, but forgot to write it down when I created the issue.
Most helpful comment
I think this is a very good idea. For this, I think the code should stop directly accessing options information through global variables. Except main(), functions should only use parameters. This will make the code more easily reusable and this code could be put in a separate library.