Glow: Re-factor ModelRunner/Loader/ImageClassifier and make them re-usable

Created on 13 Feb 2019  路  2Comments  路  Source: pytorch/glow

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.

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.

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jackm321 picture jackm321  路  3Comments

rdzhabarov picture rdzhabarov  路  4Comments

pjaaskel picture pjaaskel  路  4Comments

wayneshawn picture wayneshawn  路  3Comments

stoklund picture stoklund  路  5Comments