Conversation
* [DLMED] add metric base class Signed-off-by: Nic Ma <[email protected]> * [DLMED] update meandice and auc Signed-off-by: Nic Ma <[email protected]> * [DLMED] extract reduce API Signed-off-by: Nic Ma <[email protected]> * [DLMED] update regression metrics Signed-off-by: Nic Ma <[email protected]> * [DLMED] update all the other metrics and enhance unit tests Signed-off-by: Nic Ma <[email protected]> * [DLMED] add doc-strings and update unit tests Signed-off-by: Nic Ma <[email protected]> * [MONAI] python code formatting Signed-off-by: monai-bot <[email protected]> * [DLMED] fix flake8 issue Signed-off-by: Nic Ma <[email protected]> * [DLMED] fix pytype issue Signed-off-by: Nic Ma <[email protected]> * [DLMED] fix all the mypy issues Signed-off-by: Nic Ma <[email protected]> * [DLMED] fix integration test Signed-off-by: Nic Ma <[email protected]> * [MONAI] python code formatting Signed-off-by: monai-bot <[email protected]> * [DLMED] fix flake8 issue Signed-off-by: Nic Ma <[email protected]> * [DLMED] fix pytype issue Signed-off-by: Nic Ma <[email protected]> * [DLMED] add more sanity check Signed-off-by: Nic Ma <[email protected]> * [DLMED] update according to comments Signed-off-by: Nic Ma <[email protected]> * [DLMED] update according to Yiheng's comments Signed-off-by: Nic Ma <[email protected]> * [DLMED] update according to Wenqi's comments Signed-off-by: Nic Ma <[email protected]> * [DLMED] change to "_compute()" and "aggregate()" Signed-off-by: Nic Ma <[email protected]> * [DLMED] add compute_list() Signed-off-by: Nic Ma <[email protected]> * [DLMED] fix flake8 issue Signed-off-by: Nic Ma <[email protected]> * [DLMED] fix flake8 issue Signed-off-by: Nic Ma <[email protected]> Co-authored-by: monai-bot <[email protected]> Co-authored-by: Yiheng Wang <[email protected]>
|
Hi @wyli , Thanks for providing the detection metrics example: class PascalVOCMetric(Metric):
def __init__(self, IOUThreshold=0.5, method="EveryPointInterpolation"):
self.IOUThreshold = IOUThreshold
self.method = method
self._ groundtruths = []
self._detections = []
self._classes = []
# here the args and arg type don't match base class
def _compute(self, bb):
if bb.getBBType() == BBType.GroundTruth:
self._groundtruths.append([
bb.getImageName(),
bb.getClassId(), 1,
bb.getAbsoluteBoundingBox(BBFormat.XYX2Y2)
])
else:
self._detections.append([
bb.getImageName(),
bb.getClassId(),
bb.getConfidence(),
bb.getAbsoluteBoundingBox(BBFormat.XYX2Y2)
])
if bb.getClassId() not in classes:
classes.append(bb.getClassId())
def aggregate(self, data):
# final metric computation progress
def reset(self):
self._ groundtruths = []
self._detections = []
self._classes = []I got several questions with current Metric design:
Thanks. |
|
This PR should try to close #303 #565 #561 with a lightweight solution, perhaps also try to be compatible with a few existing packages:
So, I think we can have |
|
Hi @wyli , Thanks for your sharing. Thanks. |
1. re-define base classes in 3 levels to make it more clear and flexible to extend 2. added self-contained variables in metrics to provide easier API 3. added reset() and sync() logic 4. added distributed data parallel logic for all the metrics Signed-off-by: Nic Ma <[email protected]>
6ffc74a to
8cc8e36
Compare
|
/black |
Signed-off-by: monai-bot <[email protected]>
Signed-off-by: Nic Ma <[email protected]>
|
/black |
|
/integration-test |
Signed-off-by: monai-bot <[email protected]>
|
/integration-test |
Signed-off-by: Nic Ma <[email protected]>
Signed-off-by: Nic Ma <[email protected]>
|
/black |
|
/integration-test |
|
Hi @wyli , I have totally updated the PR based on the latest design, could you please help review it again? Thanks in advance. |
wyli
left a comment
There was a problem hiding this comment.
thanks, please see some comments for the details. would be great to have some more docstrings in the base class, but we can also do that in follow up PRs
Signed-off-by: Nic Ma <[email protected]>
Signed-off-by: Nic Ma <[email protected]>
|
/black |
|
/integration-test |
|
Hi @wyli , Thanks for your review and comments. Thanks. |
Signed-off-by: Nic Ma <[email protected]>
wyli
left a comment
There was a problem hiding this comment.
thanks, just wanted to confirm that the use case of single machine multiprocesing is also covered by the design? I put detailed comments inline
|
/black |
|
/integration-test |
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Nic Ma <[email protected]>
|
/black |
|
/integration-test |
Fixes #561
Part of #497
Closes #303
Closes #565
Description
This PR added base class for the metrics.
And add support for list of channel-first Tensor.
It's a breaking change.
Status
Ready
Types of changes
./runtests.sh -f -u --net --coverage../runtests.sh --quick --unittests.make htmlcommand in thedocs/folder.