-
Notifications
You must be signed in to change notification settings - Fork 68
[DIAG-944] Batch Mode #328
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
# Conflicts: # labelbox/data/annotation_types/geometry/rectangle.py
labelbox/schema/project.py
Outdated
| def change_queue_mode(self, mode: str): | ||
| """Change the queue between Batch and Datasets mode | ||
| Args: | ||
| mode: `BATCH` or `DATASET` | ||
| """ | ||
| if mode == "BATCH": | ||
| self._update_queue_mode("ENABLED") | ||
|
|
||
| elif mode == "DATASET": | ||
| self._update_queue_mode("DISABLED") | ||
| else: | ||
| raise ValueError( | ||
| "Must provide either `BATCH` or `DATASET` as a mode") | ||
|
|
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.
@msokoloff1 how hard would it be to get this into the update call
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.
i added it but it might be a bit of a hack
| @classmethod | ||
| def from_2D_array(cls, arr: TypedArray[Literal['uint8']], **kwargs): | ||
|
|
||
| if len(arr.shape) != 2: | ||
| raise ValueError( | ||
| f"Found array with shape {arr.shape}. Expected two dimensions ([W,H])" | ||
| ) | ||
| arr = np.stack((arr,) * 3, axis=-1) | ||
| return cls(arr=arr, **kwargs) |
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.
I think this is something old you might have had locally.
labelbox/schema/project.py
Outdated
| if self.tag_set_status == "ENABLED": | ||
| return True | ||
| else: | ||
| return False |
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.
return self.tag_set_status == "ENABLED"
labelbox/schema/project.py
Outdated
| 'projectId': self.uid, | ||
| 'status': status | ||
| }) | ||
| self.tag_set_status = status |
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.
tag_set_status is not going to be defined until this point. On Project init we should fetch the existing status since other parts of the code rely on this being set.
| self.client.execute(query_str, { | ||
| 'projectId': self.uid, | ||
| 'status': status | ||
| }) |
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.
Maybe not run this if the current queue mode == mode param the user passed in
| benchmarks = Relationship.ToMany("Benchmark", False) | ||
| ontology = Relationship.ToOne("Ontology", True) | ||
|
|
||
| def update(self, **kwargs): |
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.
Is there any danger to toggling the mode? What happens to existing annotations or data in the queue?
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.
will be handled by product in the future
Can you provide a more lengthy description? I dont know what batch mode is. I would love to understand the ideas behind the PR before reviewing |
msokoloff1
left a comment
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.
just a couple of small things
| # raster = rectangle.draw(height=32, width=32) | ||
| # assert (cv2.imread("tests/data/assets/rectangle.png") == raster).all() |
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.
What happened here?
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.
unsure but I'll uncommit to see if it passes
Batch mode allows you to specify specific data rows rather than entire datasets for labeling
https://docs.labelbox.com/docs/batch-queue