MapReader
MapReader copied to clipboard
Consider adding further filtering rules in context-based post processing
Currently the only post-processing option is to filter for patches with no surrounding patches labelled as the same thing (e.g. an isolated railspace patch) and relabel these as non-railspace if below a certain model confidence. As per Ed's suggestion (below), if we want to add further post processing options within the MapReader pipeline we could allow users to define their own rules as opposed to having it 'built in'.
+ves of this are that this enables much broader post-processing options -ves of this are complexity (for users with limited coding experience) and also the need to evaluate post-processing results
We should consider this for future work.
I think that this line is the filtering rule? If so, might it make sense to separate it as it's own function and give it a name. The name could be
filter_rule_1
with a docstring that explains the logic in plain English like "If patch has label X but no surrounding patches have label X, remove label X from patch"What you could do then is have an arg for
update_preds
calledfilter_func
. You could pass in the filter function when it's called and the filter function would be called on this line. This would mean you could substitute in a different filter function.So all you have to do to try out a different filter rule is write another small function and call update_preds like
patches.update_preds(filter_func=filter_rule_2 ... other args)
Originally posted by @edwardchalstrey1 in https://github.com/Living-with-machines/MapReader/pull/342#discussion_r1457718465