Skip to content

Commit 8694dfe

Browse files
authored
Merge pull request #148 from roboflow/fix/instance-segmentation-local-predict
`local` Parameter For Instance Segmentation Version
2 parents 605fd45 + 61a84d4 commit 8694dfe

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

roboflow/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from roboflow.core.workspace import Workspace
1313
from roboflow.util.general import write_line
1414

15-
__version__ = "1.0.8"
15+
__version__ = "1.0.9"
1616

1717

1818
def check_key(api_key, model, notebook, num_retries=0):

roboflow/core/version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ def __init__(
120120
self.id,
121121
colors=self.colors,
122122
preprocessing=self.preprocessing,
123+
local=local,
123124
)
124125
elif self.type == TYPE_SEMANTIC_SEGMENTATION:
125126
self.model = SemanticSegmentationModel(self.__api_key, self.id)

roboflow/models/instance_segmentation.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,20 @@
33

44

55
class InstanceSegmentationModel(InferenceModel):
6-
def __init__(self, api_key, version_id, colors=None, preprocessing=None):
6+
def __init__(
7+
self, api_key, version_id, colors=None, preprocessing=None, local=None
8+
):
79
"""
810
:param api_key: Your API key (obtained via your workspace API settings page)
911
:param version_id: The ID of the dataset version to use for predicting
1012
"""
1113
super(InstanceSegmentationModel, self).__init__(api_key, version_id)
12-
self.api_url = f"{INSTANCE_SEGMENTATION_URL}/{self.dataset_id}/{self.version}"
14+
if local is None:
15+
self.api_url = (
16+
f"{INSTANCE_SEGMENTATION_URL}/{self.dataset_id}/{self.version}"
17+
)
18+
else:
19+
self.api_url = f"{local}/{self.dataset_id}/{self.version}"
1320
self.colors = {} if colors is None else colors
1421
self.preprocessing = {} if preprocessing is None else preprocessing
1522

0 commit comments

Comments
 (0)