Skip to content

Commit

Permalink
Merge pull request #148 from roboflow/fix/instance-segmentation-local…
Browse files Browse the repository at this point in the history
…-predict

`local` Parameter For Instance Segmentation Version
  • Loading branch information
paulguerrie authored May 17, 2023
2 parents 605fd45 + 61a84d4 commit 8694dfe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion roboflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from roboflow.core.workspace import Workspace
from roboflow.util.general import write_line

__version__ = "1.0.8"
__version__ = "1.0.9"


def check_key(api_key, model, notebook, num_retries=0):
Expand Down
1 change: 1 addition & 0 deletions roboflow/core/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def __init__(
self.id,
colors=self.colors,
preprocessing=self.preprocessing,
local=local,
)
elif self.type == TYPE_SEMANTIC_SEGMENTATION:
self.model = SemanticSegmentationModel(self.__api_key, self.id)
Expand Down
11 changes: 9 additions & 2 deletions roboflow/models/instance_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@


class InstanceSegmentationModel(InferenceModel):
def __init__(self, api_key, version_id, colors=None, preprocessing=None):
def __init__(
self, api_key, version_id, colors=None, preprocessing=None, local=None
):
"""
:param api_key: Your API key (obtained via your workspace API settings page)
:param version_id: The ID of the dataset version to use for predicting
"""
super(InstanceSegmentationModel, self).__init__(api_key, version_id)
self.api_url = f"{INSTANCE_SEGMENTATION_URL}/{self.dataset_id}/{self.version}"
if local is None:
self.api_url = (
f"{INSTANCE_SEGMENTATION_URL}/{self.dataset_id}/{self.version}"
)
else:
self.api_url = f"{local}/{self.dataset_id}/{self.version}"
self.colors = {} if colors is None else colors
self.preprocessing = {} if preprocessing is None else preprocessing

Expand Down

0 comments on commit 8694dfe

Please sign in to comment.