Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
Document clarification for different representation for bounding box …
Browse files Browse the repository at this point in the history
…between Turi Create and Vision (#2320)
  • Loading branch information
jakesabathia2 committed Sep 24, 2019
1 parent 6ee5c4a commit 386efa4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/python/turicreate/data_structures/sframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -2660,7 +2660,6 @@ def sample(self, fraction, seed=None, exact=False):
if (fraction > 1 or fraction < 0):
raise ValueError('Invalid sampling rate: ' + str(fraction))


if (self.num_rows() == 0 or self.num_columns() == 0):
return self
else:
Expand Down Expand Up @@ -2709,6 +2708,7 @@ def random_split(self, fraction, seed=None, exact=False):
"""
if (fraction > 1 or fraction < 0):
raise ValueError('Invalid sampling rate: ' + str(fraction))

if (self.num_rows() == 0 or self.num_columns() == 0):
return (SFrame(), SFrame())

Expand Down
4 changes: 3 additions & 1 deletion userguide/object_detection/export-coreml.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let objectRecognition = VNCoreMLRequest(model: visionModel,

for case let foundObject as VNRecognizedObjectObservation in results {
let bestLabel = foundObject.labels.first! // Label with highest confidence
let objectBounds = foundObject.boundingBox
let objectBounds = foundObject.boundingBox // Normalized between [0,1]

// Use the computed values.
print(bestLabel.identifier, bestLabel.confidence, objectBounds)
Expand All @@ -37,6 +37,8 @@ For more details on the integration with Core ML and a sample app to get
you started, please look at the the article on
[Recognizing Objects in Live Capture](https://developer.apple.com/documentation/vision/recognizing_objects_in_live_capture).

**Note:** The bounding box object `VNRecognizedObjectObservation.boundingBox` has a different definition from the one used for Turi Create. First, the location is defined by the lower-left corner of the bounding box instead of the center. Secondly, the coordinate space has origin located in the lower-left corner of image. Third, the location, width, and height for the bounding box are all normalized between [0,1] by the dimensions of the images.

**Note:** Only models that were exported with *non-maximum suppression* (the default
behavior in Turi Create 5.0+) will work with this example app. Older models
or models that specify `include_non_maximum_suppression=False` will not give
Expand Down

0 comments on commit 386efa4

Please sign in to comment.