-
Notifications
You must be signed in to change notification settings - Fork 0
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
add mask_path to Detection label #16
base: cloned_develop_991c1
Are you sure you want to change the base?
Conversation
Clone of the PR voxel51/fiftyone#4693 |
👋 I'm here to help you review your pull request. When you're ready for me to perform a review, you can comment anywhere on this pull request with this command: As a reminder, here are some helpful tips on how we can collaborate together:
|
My review is in progress 📖 - I will have feedback for you in a few minutes! |
Warning Rate limit exceeded@korbit-ai[bot] has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 20 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Review Summary by Korbit AI
Code Execution Comments
- Handle potential AttributeError in
detection.get_mask()
with try/except to ensure robust execution.
Korbit Guide: Usage and Customization
Interacting with Korbit
- You can manually ask Korbit to review your PR using the
/korbit-review
command in a comment at the root of your PR.- Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
- Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.
Customizing Korbit
- Check out our docs on how you can make Korbit work best for you and your team.
- Customize Korbit for your organization through the Korbit Console.
Current Korbit Configuration
General Settings
Setting Value Review Schedule Automatic excluding drafts Max Issue Count 10 Automatic PR Descriptions ✅ Issue Categories
Category Enabled Naming ✅ Database Operations ✅ Documentation ✅ Logging ✅ Error Handling ✅ Systems and Environment ✅ Objects and Data Structures ✅ Tests ❌ Readability and Maintainability ✅ Asynchronous Processing ✅ Design Patterns ✅ Third-Party Libraries ✅ Performance ✅ Security ✅ Functionality ✅ Feedback and Support
@@ -596,7 +596,7 @@ def to_detected_object(detection, name=None, extra_attrs=True): | |||
bry = tly + h | |||
bounding_box = etag.BoundingBox.from_coords(tlx, tly, brx, bry) | |||
|
|||
mask = detection.mask | |||
mask = detection.get_mask() |
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.
The code is accessing the get_mask()
method of the detection
object without handling the potential AttributeError exception that could be raised if the method is not defined. To make this code more robust, consider wrapping the detection.get_mask()
call in a try/except block that catches AttributeError and handles it appropriately, such as setting mask
to None or providing a default mask value if the method is not available.
Chat with Korbit by mentioning @korbit-ai, and give a 👍 or 👎 to help Korbit improve your reviews.
What changes are proposed in this pull request?
Fix #4486
How is this patch tested? If it is not, please explain why.
I genuinely couldn't figure out how to run the tests, I followed the instructions but kept getting errors when using
pytest
, so I don't know if I have inadvertently broken something.I wrote a quick snippet to test the feature instead:
Release Notes
Is this a user-facing change that should be mentioned in the release notes?
Allows
Detection
s to store masks on disk, this allows to offload some disk usage from the mongo database to somewhere else. See also #4486What areas of FiftyOne does this PR affect?
fiftyone
Python library changesSummary by CodeRabbit
New Features
Bug Fixes
Description by Korbit AI
What change is being made?
Add a
mask_path
attribute to theDetection
label class to support handling instance segmentation masks stored on disk, and update related methods to utilize this new attribute.Why are these changes being made?
These changes are being made to enhance the flexibility of the
Detection
label class by allowing it to reference segmentation masks stored as files on disk, which can be more efficient for large datasets. This approach provides an alternative to storing masks directly in memory, thus optimizing resource usage and potentially improving performance when dealing with large-scale image datasets.