From dce0526e2a25d9b19b7c0db338dbdb52724f0882 Mon Sep 17 00:00:00 2001 From: Savan Visalpara Date: Fri, 28 Aug 2020 13:15:23 -0500 Subject: [PATCH 1/3] discard polygons with length of 4 or less --- .../tensorflow/matterport/mask_rcnn/nuclio/model_loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serverless/tensorflow/matterport/mask_rcnn/nuclio/model_loader.py b/serverless/tensorflow/matterport/mask_rcnn/nuclio/model_loader.py index b210338a642e..c0180d59629b 100644 --- a/serverless/tensorflow/matterport/mask_rcnn/nuclio/model_loader.py +++ b/serverless/tensorflow/matterport/mask_rcnn/nuclio/model_loader.py @@ -63,7 +63,7 @@ def infer(self, image, threshold): contour = np.flip(contour, axis=1) # Approximate the contour and reduce the number of points contour = approximate_polygon(contour, tolerance=2.5) - if len(contour) < 3: + if len(contour) < 5: continue label = self.labels[class_id] From 0c10f313b5be1f7968d2da6d2dc7f2c3a824f2c3 Mon Sep 17 00:00:00 2001 From: Savan Visalpara Date: Mon, 31 Aug 2020 11:08:16 -0500 Subject: [PATCH 2/3] updated minimum length of polygons --- .../tensorflow/matterport/mask_rcnn/nuclio/model_loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serverless/tensorflow/matterport/mask_rcnn/nuclio/model_loader.py b/serverless/tensorflow/matterport/mask_rcnn/nuclio/model_loader.py index c0180d59629b..1e56b6e60df7 100644 --- a/serverless/tensorflow/matterport/mask_rcnn/nuclio/model_loader.py +++ b/serverless/tensorflow/matterport/mask_rcnn/nuclio/model_loader.py @@ -63,7 +63,7 @@ def infer(self, image, threshold): contour = np.flip(contour, axis=1) # Approximate the contour and reduce the number of points contour = approximate_polygon(contour, tolerance=2.5) - if len(contour) < 5: + if len(contour) < 6: continue label = self.labels[class_id] From eef74512814f8884fc49862424e66803696f92e1 Mon Sep 17 00:00:00 2001 From: Savan Visalpara Date: Mon, 31 Aug 2020 14:30:20 -0500 Subject: [PATCH 3/3] added line in CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79ed9f965715..f707e0cd77d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed a case in which exported masks could have wrong color order () - Fixed error with creating task with labels with the same name () - Django RQ dashboard view () +- Fixed multiple errors which arises when polygon is of length 5 or less () ### Security -