Models Inconsistency #566
Labels
code readability
documentation
Improvements or additions to documentation
enhancement
New feature or request
refactoring
Code Refactoring
Description
Tiatoolbox has several pre-trained models helpful for data processing. However, models differ in how they handle input and output, making them confusing to use (especially when customizing):
forward
method (e.g.CNNModel
), sometimesforward
returns a raw layer output and the transformation applies ininfer_batch
(e.g.UNetModel
).HoVerNet
uses it inforward
,UNetModel
in_transform
,MicroNet
inpreproc
, and vanilla models rely on the user to do so.preproc_func
/_preproc
functions,UNetModel
uses its own_transform
, unrelated to the standard methods. Yet, its behavior could implement in_preproc
.What to do
Refactoring the code will significantly improve readability:
ModelABC
: one method for normalization, activation function as an attribute, etc.ModelABC
methods in their documentation: doesinfer_batch rely
onpostproc_func
? Caninfer_batch
be used for training? How?ModelABC
structure.The text was updated successfully, but these errors were encountered: