Skip to content

Commit 44c9fe9

Browse files
committed
fix: simplify function
1 parent e6bb080 commit 44c9fe9

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

datatorch/api/scripts/import_coco.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
import copy
44
import numpy as np
55
import click
6+
67
from typing import List
7-
from .utils import simplify
8+
from .utils.simplify import simplify_points
89

910
from .. import ApiClient, BoundingBox, File, Where, Project
1011

12+
1113
try:
1214
from pycocotools.coco import COCO
1315
except:
@@ -110,7 +112,7 @@ def simplify_segmentation(segmentation: List[List[float]], tolerance: float = 1)
110112

111113
points_format = segmentation_to_points(segmentation)
112114
simplified = [
113-
simplify.simplify(polygon, tolerance=tolerance, highestQuality=False)
115+
simplify_points(polygon, tolerance=tolerance, highestQuality=False)
114116
for polygon in points_format
115117
]
116118
simplified = [polygon for polygon in simplified if len(polygon) >= 6]

datatorch/api/scripts/utils/simplify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def simplify_douglas_peucker(points, tolerance):
105105
return new_points
106106

107107

108-
def simplify(points, tolerance=0.1, highestQuality=True):
108+
def simplify_points(points, tolerance=0.1, highestQuality=True):
109109
sqtolerance = tolerance * tolerance
110110

111111
if not highestQuality:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
setup(
1919
name="datatorch",
20-
version="0.2.1",
20+
version="0.2.2",
2121
description="A CLI and library for interacting with DataTorch",
2222
author="DataTorch",
2323
author_email="[email protected]",

0 commit comments

Comments
 (0)