윤영준 윤영준 2024-05-14
minor fixes
@9d4293c65f5c02fb6947357dbfcf9b567455c9f0
yoloseg/inference_.py
--- yoloseg/inference_.py
+++ yoloseg/inference_.py
@@ -20,9 +20,6 @@
     def sigmoid(self, x):
         return 1 / (1 + np.exp(-x))
 
-    def inverse_sigmoid(self, x):
-        return np.log(x/(1-x))
-
     def run_inference(self, input_image):
         model_input = input_image
         if self.letter_box_for_square and self.model_shape[0] == self.model_shape[1]:
@@ -100,6 +97,7 @@
             x1, y1, w, h = box
             x1, y1, x2, y2 = x1, y1, x1 + w, y1 + h
 
+            # To handle edge cases where you get bboxes that pass beyond the original image
             if y2 > image_shape[1]:
                 h = h + image_shape[1] - h - y1
             if x2 > image_shape[0]:
@@ -110,7 +108,7 @@
 
             # Compute the linear combination of proto masks
             # for now, plural batch operation is not supported, and this is the point where you should start.
-            # instead of proto_masks[0], do some iterative operation.
+            # instead of hardcoded proto_masks[0], do some iterative operation.
             mask = np.tensordot(coeffs, proto_masks[0], axes=[0, 0])  # Dot product along the number of prototypes
 
             # Resize mask to the bounding box size, using sigmoid to normalize
Add a comment
List