Skip to content

Commit

Permalink
Style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ykevu committed Sep 23, 2022
1 parent 4c88997 commit 9be3cf2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
10 changes: 4 additions & 6 deletions deepcell_label_utils/utils.py
Expand Up @@ -25,13 +25,10 @@
# ==============================================================================
"""Label utils"""

# import json
# import geojson
import numpy as np
import cv2

from shapely.geometry import MultiPolygon, Polygon, Point # , mapping
from collections import defaultdict
import cv2
import numpy as np
from shapely.geometry import MultiPolygon, Polygon, Point
from skimage.measure import regionprops


Expand Down Expand Up @@ -115,6 +112,7 @@ def __init__(self, X, y, segments, test_no_poly=False):
mask = self.dcl_to_binary_mask(object_id)
centroid = self.binary_mask_to_centroid(mask)
bbox = self.binary_mask_to_bbox(mask)
# test_no_poly for unit tests below min_area for polygons
if not test_no_poly:
polygon = self.binary_mask_to_polygon(mask)

Expand Down
17 changes: 3 additions & 14 deletions deepcell_label_utils/utils_test.py
@@ -1,8 +1,8 @@
from utils import SpatialLabelConverter, mask_to_polygons, polygons_to_mask
from shapely.geometry import Point

import numpy as np
import pandas as pd
from shapely.geometry import Point

from utils import SpatialLabelConverter, mask_to_polygons, polygons_to_mask


def test_get_object_ids():
Expand Down Expand Up @@ -209,14 +209,3 @@ def test_binary_mask_to_polygon():
expected_2[::-1]]
assert polygon_3.geoms[0].exterior.coords[:] in [expected_2,
expected_2[::-1]]


if __name__ == '__main__':
test_get_object_ids()
test_segments_to_dict()
test_dcl_to_binary_mask()
test_binary_mask_to_centroid()
test_binary_mask_to_bbox()
test_mask_to_polygons()
test_polygons_to_mask()
test_binary_mask_to_polygon()

0 comments on commit 9be3cf2

Please sign in to comment.