-
-
Notifications
You must be signed in to change notification settings - Fork 4
Add get_image and get_image_label #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks -- comments are inline.
assert isinstance(self.image.get_image_labels(), tuple) | ||
|
||
self.image.load_image(data, image_label="test") | ||
assert len(self.image.get_image_labels()) == 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting; logically I would have thought of this as being 1.
Is this too complicated: None
only counts as an image label if it has data associated with it
So the idea would be that if, like in this example, the only loaded data was for an image label you set, the get_image_labels
returns just the image label you have used.
Doing this would return two image labels:
# Assume we are starting with a clean slate
assert self.image.get_image_labels() is None # or maybe == []
# Load an image without a label, which means the label is `None`
self.image.load_image(data)
# Load a second image with an explicit label
self.image.load_image(data, label="test")
assert len(self.image.get_image_labels()) == 2 # None and "test"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tracking this in #74
As discussed with @mwcraig at the coordination meeting. For now we are setting no type limitations on the returned image since backends often have different internal representations.
Edit: fixes #59