Skip to content

Commit

Permalink
Merge pull request #325 from venkatram-dev/fix_assert_model_version
Browse files Browse the repository at this point in the history
fix_assert_model_version
  • Loading branch information
grzegorz-roboflow authored Oct 3, 2024
2 parents 808adaf + b947bfc commit a823346
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions roboflow/core/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,39 @@ def live_plot(epochs, mAP, loss, title=""):

time.sleep(5)

if not self.model:
if self.type == TYPE_OBJECT_DETECTION:
self.model = ObjectDetectionModel(
self.__api_key,
self.id,
self.name,
self.version,
colors=self.colors,
preprocessing=self.preprocessing,
)
elif self.type == TYPE_CLASSICATION:
self.model = ClassificationModel(
self.__api_key,
self.id,
self.name,
self.version,
colors=self.colors,
preprocessing=self.preprocessing,
)
elif self.type == TYPE_INSTANCE_SEGMENTATION:
self.model = InstanceSegmentationModel(
self.__api_key,
self.id,
colors=self.colors,
preprocessing=self.preprocessing,
)
elif self.type == TYPE_SEMANTIC_SEGMENTATION:
self.model = SemanticSegmentationModel(self.__api_key, self.id)
elif self.type == TYPE_KEYPOINT_DETECTION:
self.model = KeypointDetectionModel(self.__api_key, self.id, version=self.version)
else:
raise ValueError(f"Unsupported model type: {self.type}")

# return the model object
assert self.model
return self.model
Expand Down

0 comments on commit a823346

Please sign in to comment.