-
Notifications
You must be signed in to change notification settings - Fork 592
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
Release notes + cherry-picking PRs for v0.23.8 #4239
Conversation
These functions were creating a new full-sized mask for each object in the mask, which scales badly. This commit makes them run exponentially faster for large images with lots of objects. - Implement a new function `_find_slices()` to preprocess a mask and find the extent of each unique object. This function is the key to speeding up the others. - Use that function to speed up `_segmentations_to_detections()`, `_segmentations_to_polylines()`, and `_transform_mask()`. - Keep track of offsets and overall segmentation mask size, to ensure the new detections have correct relative bounding boxes and the new polylines have the correct coordinates. This includes switching from using `_get_polygons()` to `skimage.measure.label()` in `_parse_thing_instances()`, which avoids the problem of polygon tolerance being off by one or more pixels. When converting to polygons, added `round_coords` option to make it more likely that the coordinates match after a round trip. - Combine the core functionality of `_segmentations_to_detections()` and `_segmentations_to_polylines()` into a single function, `_convert_segmentations()`. This eliminates code duplication and allows future segmentation conversions to reuse this code. - In `_convert_segmentations()`, convert RGB masks to integer masks, matching the way it is done in `_transform_mask()`. This eliminates a number of if/then branches and makes the rest of the function easier to reason about. - Add unit tests to ensure the changed functions behave as expected.
WalkthroughThe latest changes bring a blend of enhancements across the software, including performance optimizations, feature upgrades, and bug fixes. Notable improvements encompass the shift to asynchronous operations for efficiency, enhanced handling of data types, and refined 3D utility functions. User interface adjustments cater to dynamic resizing and layout management, while plugins and spaces modules receive enhancements for extended functionality. Changes
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/v0.23.8 #4239 +/- ##
===================================================
+ Coverage 28.84% 28.99% +0.15%
===================================================
Files 768 768
Lines 97041 97164 +123
Branches 1120 1157 +37
===================================================
+ Hits 27988 28177 +189
+ Misses 69053 68987 -66
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Actionable comments posted: 6
Actionable comments outside the diff hunks (4)
docs/source/tutorials/yolov8.ipynb (4)
Line range hint
4-4
: Ensure thefiftyone
andultralytics
packages are installed in the environment where this notebook will be run. It's good practice to specify version numbers for better reproducibility.
Line range hint
717-717
: The functionexport_yolo_data
lacks documentation. Adding a docstring explaining the parameters, return type, and purpose of the function would improve code maintainability and readability.def export_yolo_data( samples, export_dir, classes, label_field = "ground_truth", split = None ): """ Exports the given samples to YOLO format. Args: samples (fiftyone.core.collections.SampleCollection): The samples to export. export_dir (str): The directory where the exported data will be saved. classes (list): The list of class labels. label_field (str, optional): The field in the samples that contains the labels. Defaults to "ground_truth". split (list or str, optional): The dataset split(s) to export. Can be a list of splits or a single split. Defaults to None, which exports all samples. """
Line range hint
717-717
: The recursive call withinexport_yolo_data
for handling multiple splits is a clever use of the function itself. However, consider the performance implications if the dataset is large. It might be more efficient to handle splits outside this function or ensure that the dataset is filtered efficiently for each split.
Line range hint
717-717
: Theexport_yolo_data
function does not check if theexport_dir
exists or if it has the necessary permissions for writing data. Adding such checks can prevent runtime errors and improve the user experience.import os def export_yolo_data(...): ... if not os.path.exists(export_dir): os.makedirs(export_dir) ...
Review Status
Configuration used: CodeRabbit UI
Files ignored due to path filters (41)
docs/source/images/integrations/hf_data_card_preview.jpg
is excluded by!**/*.jpg
docs/source/images/integrations/hf_push_advanced_example.jpg
is excluded by!**/*.jpg
docs/source/tutorials/images/bdd100k-mistakes.gif
is excluded by!**/*.gif
docs/source/tutorials/images/bdd100k-outliers.gif
is excluded by!**/*.gif
docs/source/tutorials/images/detection_mistakes_above95.gif
is excluded by!**/*.gif
docs/source/tutorials/images/detection_mistakes_full_dataset.png
is excluded by!**/*.png
docs/source/tutorials/images/detection_mistakes_gt_patches.gif
is excluded by!**/*.gif
docs/source/tutorials/images/detection_mistakes_localization.gif
is excluded by!**/*.gif
docs/source/tutorials/images/detection_mistakes_mistakenness.gif
is excluded by!**/*.gif
docs/source/tutorials/images/detection_mistakes_possible_missing.gif
is excluded by!**/*.gif
docs/source/tutorials/images/evaluate_detections_all_boxes.jpg
is excluded by!**/*.jpg
docs/source/tutorials/images/evaluate_detections_click_image.gif
is excluded by!**/*.gif
docs/source/tutorials/images/evaluate_detections_confidence_filter.jpg
is excluded by!**/*.jpg
docs/source/tutorials/images/evaluate_detections_crowded.jpg
is excluded by!**/*.jpg
docs/source/tutorials/images/evaluate_detections_crowded_fp.jpg
is excluded by!**/*.jpg
docs/source/tutorials/images/evaluate_detections_dataset.jpg
is excluded by!**/*.jpg
docs/source/tutorials/images/evaluate_detections_eval_fp.jpg
is excluded by!**/*.jpg
docs/source/tutorials/images/evaluate_detections_eval_patches.gif
is excluded by!**/*.gif
docs/source/tutorials/images/evaluate_detections_eval_tp.jpg
is excluded by!**/*.jpg
docs/source/tutorials/images/evaluate_detections_exists_filter.gif
is excluded by!**/*.gif
docs/source/tutorials/images/evaluate_detections_gt_patches.gif
is excluded by!**/*.gif
docs/source/tutorials/images/evaluate_detections_high_conf_eval_fp.jpg
is excluded by!**/*.jpg
docs/source/tutorials/images/evaluate_detections_high_conf_fp.gif
is excluded by!**/*.gif
docs/source/tutorials/images/evaluate_detections_high_conf_view.jpg
is excluded by!**/*.jpg
docs/source/tutorials/images/evaluate_detections_only_show_selected.gif
is excluded by!**/*.gif
docs/source/tutorials/images/evaluate_detections_prediction_view.jpg
is excluded by!**/*.jpg
docs/source/tutorials/images/evaluate_detections_small_bboxes.jpg
is excluded by!**/*.jpg
docs/source/tutorials/images/image_embeddings_bdd100k.png
is excluded by!**/*.png
docs/source/tutorials/images/image_embeddings_bdd100k_colorby.gif
is excluded by!**/*.gif
docs/source/tutorials/images/image_embeddings_nonzero_cluster.gif
is excluded by!**/*.gif
docs/source/tutorials/images/image_embeddings_outliers.gif
is excluded by!**/*.gif
docs/source/tutorials/images/image_embeddings_panel.gif
is excluded by!**/*.gif
docs/source/tutorials/images/image_embeddings_prelabel.gif
is excluded by!**/*.gif
docs/source/tutorials/images/image_embeddings_tag_mistakes.gif
is excluded by!**/*.gif
docs/source/tutorials/images/image_embeddings_test_split.png
is excluded by!**/*.png
docs/source/tutorials/images/image_embeddings_unlabeled.png
is excluded by!**/*.png
docs/source/tutorials/images/image_embeddings_zero_cluster.gif
is excluded by!**/*.gif
docs/source/tutorials/images/mnist-interactive1.gif
is excluded by!**/*.gif
docs/source/tutorials/images/mnist-interactive2.gif
is excluded by!**/*.gif
docs/source/tutorials/images/mnist-pre-annotation.gif
is excluded by!**/*.gif
e2e-pw/yarn.lock
is excluded by!**/*.lock
Files selected for processing (56)
- app/mocks/recoil.ts (2 hunks)
- app/packages/app/src/pages/IndexPage.tsx (2 hunks)
- app/packages/app/src/pages/generated/IndexPageQuery.graphql.ts (7 hunks)
- app/packages/core/src/components/Actions/Tagger.tsx (2 hunks)
- app/packages/core/src/components/Actions/utils.tsx (1 hunks)
- app/packages/core/src/components/Filters/StringFilter/Checkboxes.tsx (4 hunks)
- app/packages/core/src/components/Sidebar/Entries/FilterablePathEntry/Arrow.tsx (1 hunks)
- app/packages/core/src/components/Sidebar/Entries/FilterablePathEntry/Icon.tsx (1 hunks)
- app/packages/looker/src/overlays/detection.ts (1 hunks)
- app/packages/looker/src/overlays/index.test.ts (1 hunks)
- app/packages/looker/src/overlays/index.ts (2 hunks)
- app/packages/looker/src/worker/deserializer.test.ts (1 hunks)
- app/packages/looker/src/worker/deserializer.ts (3 hunks)
- app/packages/looker/src/worker/painter.test.ts (1 hunks)
- app/packages/looker/src/worker/painter.ts (4 hunks)
- app/packages/operators/src/hooks.ts (3 hunks)
- app/packages/operators/src/operators.ts (5 hunks)
- app/packages/operators/src/state.ts (5 hunks)
- app/packages/state/src/recoil/aggregations.test.ts (1 hunks)
- app/packages/state/src/recoil/aggregations.ts (3 hunks)
- app/packages/state/src/recoil/labels.ts (1 hunks)
- app/packages/state/src/recoil/pathData/counts.test.ts (1 hunks)
- app/packages/state/src/recoil/pathData/counts.ts (1 hunks)
- app/packages/state/src/recoil/schema.ts (4 hunks)
- app/packages/state/tsconfig.json (1 hunks)
- app/schema.graphql (1 hunks)
- docs/source/integrations/huggingface.rst (16 hunks)
- docs/source/integrations/ultralytics.rst (2 hunks)
- docs/source/release-notes.rst (1 hunks)
- docs/source/tutorials/detectron2.ipynb (1 hunks)
- docs/source/tutorials/monocular_depth_estimation.ipynb (2 hunks)
- docs/source/tutorials/yolov8.ipynb (2 hunks)
- e2e-pw/.eslintrc.js (1 hunks)
- e2e-pw/README.md (1 hunks)
- e2e-pw/package.json (1 hunks)
- e2e-pw/src/oss/poms/modal/video-controls.ts (1 hunks)
- e2e-pw/src/oss/poms/selector.ts (1 hunks)
- e2e-pw/src/oss/specs/overlays/detection-mask.spec.ts (1 hunks)
- e2e-pw/src/oss/specs/smoke-tests/quickstart.spec.ts (1 hunks)
- fiftyone/core/dataset.py (1 hunks)
- fiftyone/core/labels.py (9 hunks)
- fiftyone/core/odm/dataset.py (2 hunks)
- fiftyone/core/odm/document.py (2 hunks)
- fiftyone/core/plots/matplotlib.py (1 hunks)
- fiftyone/operators/executor.py (7 hunks)
- fiftyone/operators/server.py (2 hunks)
- fiftyone/server/aggregations.py (2 hunks)
- fiftyone/server/mutation.py (7 hunks)
- fiftyone/server/query.py (3 hunks)
- fiftyone/server/routes/aggregate.py (2 hunks)
- fiftyone/server/routes/frames.py (2 hunks)
- fiftyone/server/routes/sort.py (2 hunks)
- fiftyone/server/routes/tag.py (4 hunks)
- fiftyone/server/routes/tagging.py (3 hunks)
- fiftyone/server/routes/values.py (3 hunks)
- fiftyone/server/tags.py (2 hunks)
Files not processed due to max files limit (6)
- fiftyone/server/view.py
- fiftyone/utils/huggingface.py
- fiftyone/utils/ultralytics.py
- fiftyone/zoo/models/manifest-torch.json
- setup.py
- tests/unittests/label_tests.py
Files not summarized due to errors (1)
- docs/source/integrations/huggingface.rst: Error: Message exceeds token limit
Additional comments not posted (99)
app/packages/state/src/recoil/labels.ts (1)
4-4
: The addition oflabelPathsSet
andlabelPathsSetExpanded
selectors inapp/packages/state/src/recoil/labels.ts
enhances the flexibility of retrieving label paths based on their expanded status. Ensure that these selectors are used consistently across the application and that any related documentation is updated to reflect these new capabilities.app/packages/core/src/components/Sidebar/Entries/FilterablePathEntry/Icon.tsx (2)
22-22
: Ensure theisDisabledPath
function is thoroughly tested, especially for edge cases, to prevent any unexpected behavior due to the newdisabled
prop.
24-25
: Reordering variables for clarity or logical grouping is a good practice, as long as it doesn't affect the execution logic. This change appears to improve readability.fiftyone/server/routes/aggregate.py (1)
30-32
: The addition ofawait
andawaitable=True
to theget_view
call is a significant change towards asynchronous processing. Ensure that all dependent functions and their error handling are compatible with this asynchronous approach.app/packages/looker/src/worker/deserializer.ts (4)
5-5
: Using optional chaining (?.
) to check fornull
orundefined
before deserialization enhances the robustness of the code. This is a good practice to prevent runtime errors.
17-17
: Applying optional chaining in theDetections
deserializer ensures consistency and safety when accessing potentially undefined properties.
22-22
: The use of optional chaining forlabel.map
before deserialization in theHeatmap
deserializer is a prudent safety measure.
36-36
: Similarly, applying optional chaining forlabel.mask
in theSegmentation
deserializer is a good practice for handling potentially undefined values safely.e2e-pw/package.json (1)
7-20
: Updating dev dependencies to their latest versions can bring in new features, bug fixes, and performance improvements. Ensure to test the entire end-to-end testing suite thoroughly to catch any breaking changes introduced by these updates.app/packages/looker/src/worker/painter.test.ts (1)
6-64
: Adding tests to verify that thePainterFactory
correctly skips undefined values for different types of labels is a good practice. It ensures that the deserialization process is robust and can handle unexpected inputs gracefully.fiftyone/server/tags.py (1)
28-56
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [19-56]
Converting
get_tag_view
to an asynchronous function and utilizingrun_sync_task
for execution is a significant improvement towards making the server more efficient. Ensure that all calls to this function have been updated to handle the asynchronous nature properly.fiftyone/server/routes/sort.py (1)
33-45
: The modifications to constructSampleFilter
based on the presence ofslice
and the addition ofawaitable=True
to theget_view
call are aligned with the move towards asynchronous processing. Ensure comprehensive testing, especially around the handling of slices, to verify that the behavior remains consistent.e2e-pw/src/oss/poms/selector.ts (1)
57-61
: Refactoring the visibility check to usetoBeVisible()
instead ofisVisible()
is a good practice, as it likely aligns better with the testing framework's idioms and may provide more accurate results. Ensure that all tests pass with this change.app/packages/core/src/components/Sidebar/Entries/FilterablePathEntry/Arrow.tsx (1)
34-36
: The conditional rendering based on thedisabled
prop is clear and straightforward. However, consider adding a comment explaining the rationale behind rendering only the arrow whendisabled
istrue
, for future maintainability.e2e-pw/src/oss/specs/overlays/detection-mask.spec.ts (2)
18-45
: Ensure that the image created in thebeforeAll
hook is suitable for the test case. The test case seems to focus on loading an empty mask, but the image is created as a blank image without any mask data. If the intention is to test the handling of empty masks specifically, consider adding a comment to clarify this or adjust the test setup to more explicitly reflect the test's focus.
53-57
: The test case is well-structured and focuses on a specific functionality. Consider adding more assertions to verify the correct handling of the empty mask beyond just loading the sample. For example, you could assert that the UI elements related to the mask are in the expected state.e2e-pw/src/oss/specs/smoke-tests/quickstart.spec.ts (1)
31-32
: The update to use a more descriptive assertion method improves the readability and maintainability of the test. Good job on making the test assertions more expressive.fiftyone/server/routes/values.py (1)
37-43
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [40-50]
The introduction of the
await
keyword beforefosv.get_view
correctly transitions the call to asynchronous, aligning with the broader move towards asynchronous operations in the server routes. Ensure that all callers of this endpoint are updated to handle the asynchronous nature of this operation.fiftyone/server/routes/frames.py (1)
36-38
: The asynchronous call tofosv.get_view
is correctly implemented. However, ensure that theawaitable=True
parameter is correctly handled withinfosv.get_view
to support this asynchronous behavior.fiftyone/server/routes/tagging.py (1)
46-49
: The conditional assignment ofGroupElementFilter
based on the presence ofsample_ids
is a logical improvement that adds flexibility to the filtering capabilities. Ensure that all relevant tests are updated to cover both scenarios: with and withoutsample_ids
.app/packages/state/src/recoil/aggregations.test.ts (1)
9-76
: The tests for aggregation path accumulation are well-structured and cover various scenarios, including numeric and non-numeric paths. Consider adding tests for edge cases, such as invalid paths or unexpected input types, to ensure robustness.app/__mocks__/recoil.ts (2)
5-5
: ChangingmockValuesStore
from a variable to a constant is a good practice to ensure that it's not unintentionally modified elsewhere in the tests. This change enhances the reliability of the mock implementation.
18-18
: ReplacingObject.hasOwn
withObject.hasOwnProperty
might not have a significant impact in most cases, but it's important to ensure that this change is compatible with the environments where the tests will run, asObject.hasOwn
is a more recent addition to the JavaScript standard.app/packages/operators/src/hooks.ts (1)
31-31
: LGTM! IncludingviewName
in the context object and its dependencies ensures that any changes toviewName
will correctly trigger updates.Also applies to: 57-57, 68-68
fiftyone/server/routes/tag.py (2)
43-43
: The conversion offost.get_tag_view
calls to asynchronous usingawait
is correctly implemented and aligns with the goal of improving server efficiency.Also applies to: 69-69
51-54
: The adjustments in the structure ofSampleFilter
andGroupElementFilter
instances, including the conditional logic based onsample_ids
, are well-implemented and enhance filtering capabilities.Also applies to: 78-82
e2e-pw/src/oss/poms/modal/video-controls.ts (1)
33-33
: The addition ofawait
beforethis.controls.click()
in thetogglePlay
method is correctly implemented and ensures that the click action is completed before proceeding.app/packages/looker/src/overlays/index.ts (2)
28-29
: The changes in thefromLabel
andfromLabelList
functions to handlenull
orundefined
labels improve the robustness of the code and are correctly implemented.Also applies to: 31-32
48-55
: The updates to thePOINTS_FROM_FO
object functions to handlenull
orundefined
labels are correctly implemented and enhance the code's fault tolerance.e2e-pw/README.md (1)
10-11
: The addition of a note about updating browser binaries when upgrading Playwright is clear, useful, and well-placed in the setup instructions. This information is important for maintaining a functional e2e test environment.app/packages/state/src/recoil/pathData/counts.ts (1)
188-194
: The update in thenoneCount
selector function, introducing a default value foraggCount
, improves the robustness of the function by ensuring thataggCount
is always a number. This is a good practice for handling potentially missing data.app/packages/core/src/components/Actions/utils.tsx (2)
95-95
: The addition of theextended
property based on themodal
value in thetagStatistics
selector is correctly implemented and enhances the selector's functionality by allowing it to adapt based on context.
101-109
: The change in thenumItemsInSelection
selector to take an object withmodal
andlabels
properties as arguments is correctly implemented and improves the selector's usability by allowing for more dynamic configuration.app/packages/state/src/recoil/aggregations.ts (3)
14-14
: The import ofState
from "./types" is correctly implemented and necessary for the functionality introduced in themodalAggregationPaths
selector.
140-149
: The refactoring of theaggregation
selector function to use themodalAggregationPaths
selector for modal contexts andschemaAtoms.filterFields
for non-modal contexts improves the clarity and maintainability of the code.
175-206
: The introduction of themodalAggregationPaths
selector function adds flexibility and precision to the handling of modal aggregation paths. The logic for differentiating between frame and sample spaces and applying additional filtering is correctly implemented.fiftyone/operators/server.py (2)
187-187
: Ensure that theresolve_type
function called withawait
properly handles exceptions and errors in its asynchronous execution.
213-213
: Verify thatresolve_execution_options
function, now awaited, correctly handles potential exceptions and errors during its asynchronous execution.fiftyone/server/aggregations.py (1)
117-132
: Ensure that the asynchronous call tofosv.get_view
withinaggregate_resolver
is properly handling exceptions and errors that may arise during its execution.app/packages/looker/src/overlays/detection.ts (1)
171-173
: Adding a check for the existence ofthis.canvas
before drawing the mask is a good practice to prevent potential runtime errors.app/packages/app/src/pages/__generated__/IndexPageQuery.graphql.ts (1)
87-90
: Renaming the field fromtotal
toestimatedDatasetCount
in the GraphQL query response aligns with the intention to provide a more descriptive name for the dataset count. Ensure that all client-side usages of this field are updated accordingly.app/packages/looker/src/worker/painter.ts (2)
29-29
: Using optional chaining (?.
) to check for the existence oflabel.mask
before proceeding is a good practice to prevent potential runtime errors.
138-138
: Applying optional chaining (?.
) to check for the existence oflabels.detections
before proceeding with the map operation is a prudent safety measure.docs/source/integrations/ultralytics.rst (1)
241-296
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [172-293]
The documentation updates for integrating YOLOv8 and YOLOv9 models into FiftyOne are clear and informative. Ensure that the model names and paths mentioned are accurate and reflect the latest versions available in the FiftyOne Model Zoo.
fiftyone/server/mutation.py (2)
214-220
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [131-305]
The conversion of synchronous calls to asynchronous ones using
await
and the introduction of theawaitable
parameter are correctly implemented. Ensure that all asynchronous calls toget_view
properly handle exceptions to maintain robustness and reliability of the server operations.
371-371
: The removal of theasync
keyword fromupdate_saved_view
should be carefully considered to ensure it aligns with the function's usage patterns and does not introduce performance bottlenecks or inconsistencies in the server's mutation handling.app/schema.graphql (1)
602-602
: LGTM! The addition ofestimatedDatasetCount
to theQuery
type is correctly implemented.app/packages/core/src/components/Actions/Tagger.tsx (2)
371-373
: LGTM! The conditional assignment for theextended
property based on themodal
variable in theuseTagCallback
function is correctly implemented.
424-426
: LGTM! The update to theuseLabelPlaceHolder
function, including the refined calculation ofselectedLabelCount
, is correctly implemented.app/packages/state/src/recoil/schema.ts (4)
33-33
: LGTM! The addition of thelabelPathsSetExpanded
import is correctly implemented.
635-651
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [638-665]
LGTM! The renaming of
filterFields
tofilterFieldsCommon
and the addition ofmodalFilterFields
are correctly implemented, improving the clarity and modularity of the code.
635-651
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [638-665]
LGTM! The adjustments to logic in
filterFieldsCommon
andmodalFilterFields
are correctly implemented, enhancing the field filtering functionality.Also applies to: 667-683
733-733
: LGTM! The renaming of thefilterFields
key toisListField
in theisListField
selector improves clarity.fiftyone/server/query.py (2)
339-339
: Adding theupdate_last_loaded_at
parameter with a default value ofFalse
maintains backward compatibility and provides more control over dataset metadata updates. This is a good enhancement.
414-417
: The addition of theestimated_dataset_count
method is a useful enhancement for efficiently obtaining a rough count of datasets. The implementation correctly utilizes MongoDB'sestimated_document_count
in an asynchronous manner.fiftyone/core/odm/document.py (1)
8-8
: Ensure that indexes are appropriately managed elsewhere in the application after the removal of theensure_indexes
call in the_save
method. Consider adding a comment or documentation note explaining where and how indexes are ensured.fiftyone/core/odm/dataset.py (1)
604-607
: Reformatting themeta
attribute to a multi-line dictionary improves code readability without affecting functionality. This is a good stylistic improvement.app/packages/operators/src/state.ts (2)
83-89
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [86-96]
LGTM! The addition of
viewName
to the global context selector aligns with the PR's objectives and is correctly implemented.
136-142
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [126-153]
LGTM! Adding
viewName
to the execution context within theuseExecutionContext
hook is a valuable enhancement, ensuring operators have access to the current view name.app/packages/operators/src/operators.ts (5)
446-446
: LGTM! Adding theview_name
parameter to the request payload for the/operators/execute/generator
endpoint is correctly implemented and aligns with the PR's objectives.
546-546
: LGTM! The addition of theview_name
parameter to the request payload for the/operators/execute
endpoint is a valuable enhancement, ensuring server-side operator execution is aware of the current view name.
613-613
: LGTM! Adding theview_name
parameter to the request payload for the/operators/resolve-type
endpoint correctly enhances the dynamic resolution of operator types based on the current view name.
681-681
: LGTM! The addition of theview_name
parameter to the request payload for the/operators/resolve-execution-options
endpoint is correctly implemented, ensuring execution options are resolved with the current view name in mind.
710-710
: LGTM! Adding theview_name
parameter to the request payload for the/operators/resolve-placements
endpoint is correctly implemented, enhancing the resolution of operator placements based on the current view name.docs/source/tutorials/monocular_depth_estimation.ipynb (4)
414-414
: Consider adding a brief explanation before thetorch.nn.functional.interpolate()
call in theapply_dpt_model()
function to clarify why interpolation is necessary for those unfamiliar with image processing or neural network output dimensions.
427-493
: Highlight the ease of integrating Hugging Face Transformers with FiftyOne for monocular depth estimation and other tasks. This section effectively demonstrates the flexibility and power of FiftyOne's integration capabilities. However, it would be beneficial to include a brief explanation or link to documentation on how to handle different model outputs (e.g., depth maps, segmentation masks) when usingapply_model()
, as this can be a common point of confusion for new users.
493-493
: In the section discussing the evaluation of predictions, it's commendable that the tutorial introduces common metrics like RMSE, PSNR, and SSIM. However, adding a brief explanation or visual example of what these metrics signify in the context of depth estimation could enhance understanding, especially for readers less familiar with these terms.
493-493
: The final sections on key challenges and summary provide a good wrap-up of the tutorial. It might be beneficial to include links to further reading or advanced topics in monocular depth estimation for readers interested in deepening their understanding.fiftyone/operators/executor.py (3)
336-342
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [339-360]
Consider enhancing the exception handling in
resolve_type
by logging the exception or providing more context in the error message to aid in debugging.
366-372
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [369-389]
Consider enhancing the exception handling in
resolve_execution_options
by logging the exception or providing more context in the error message to aid in debugging.
509-526
: Ensure thatview_name
is properly validated and sanitized before use to prevent potential security issues.fiftyone/core/plots/matplotlib.py (4)
40-40
: Changing the default matplotlib style to "default" is approved.
Please ensure to verify the impact of this change on the readability and appearance of existing plots within FiftyOne to maintain a consistent user experience.
40-40
: Consider adding a fallback mechanism or a user notification if the "default" matplotlib style is not available in the user's environment, to ensure plots are always rendered correctly.
40-40
: Ensure that the change in the default style to "default" is documented in the user guide or release notes, especially if this change affects the visual appearance of plots significantly.
40-40
: Ensure that the documentation clearly explains the additional dependencies required for using thelocation_scatterplot
function, includingsalem
and its dependencies, and provide guidance on how to install them.docs/source/tutorials/yolov8.ipynb (5)
151-187
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-184]
The narrative and instructions provided in the markdown cells are clear and informative, offering a structured flow for the tutorial.
Line range hint
107-107
: The use ofYOLO("yolov8n.pt")
assumes that the model weights are either available locally or will be downloaded automatically. Ensure that there's a mechanism or instruction for obtaining these weights if not present.
159-182
: This new section on FiftyOne's Ultralytics Integration provides a concise example of applying a YOLOv8 model to a FiftyOne dataset. It's well-explained and the code is correctly implemented.
Line range hint
107-107
: Using direct instantiation of theYOLO
class with model paths like"yolov8n.pt"
assumes that the model file is either present in the working directory or will be downloaded. It's good practice to verify the existence of these files or provide clear instructions on how to obtain them, especially for users who might run this notebook in a different environment.
159-182
: The example provided for using FiftyOne's Ultralytics Integration is clear and demonstrates the ease of applying a YOLOv8 model to a dataset. This is a valuable addition to the tutorial, showcasing practical integration with popular tools.fiftyone/core/labels.py (4)
15-16
: Consider verifying the necessity of the newly added importsscipy.ndimage
andskimage
to ensure they are used within the file and not unnecessarily increasing the import overhead.
1672-1676
: The_find_slices
function is a valuable addition for identifying object slices in a mask. However, ensure that thescipy.ndimage.find_objects
function's behavior aligns with the expected output, especially regarding how it handles zero-valued objects and the returned slices' inclusivity/exclusivity.
1780-1792
: The_segmentation_to_polylines
function uses a partial function application to pass thetolerance
parameter to_mask_to_polylines
. This is a good use offunctools.partial
for code clarity and maintainability.
1897-1928
: The_get_polygons
function correctly converts a mask to a list of polygons, adjusting for offsets and frame size. However, consider adding error handling for cases where themask
input does not meet the expected shape or type requirements.docs/source/integrations/huggingface.rst (8)
10-28
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-35]
LGTM! The introduction and setup instructions are clear and concise.
56-65
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [35-435]
The inference section provides comprehensive examples for using Transformers models with FiftyOne datasets across various tasks. It's well-structured and informative.
432-441
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [435-523]
The zero-shot classification section is clear and provides valuable guidance on using zero-shot models with FiftyOne datasets.
569-578
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [523-627]
The batch inference section clearly explains how to perform batch inference with FiftyOne, including a practical example.
642-651
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [627-728]
The embeddings section is comprehensive, covering how to compute embeddings for images and text with Transformers models. The examples are clear and relevant.
769-778
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [728-789]
The batch and patch embeddings sections are clear and informative, offering practical examples for advanced embeddings computations.
813-822
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [789-903]
The brain methods section effectively explains how to use Transformers models with FiftyOne's Brain methods, providing practical examples for enhancing datasets with similarity and visualization computations.
904-1937
: The Hugging Face Hub section thoroughly documents the integration, providing clear instructions and practical examples for a wide range of use cases.docs/source/release-notes.rst (6)
6-14
: Consider adding more specific details about the "data-intensive API calls" that were optimized. This could help users understand the impact of these optimizations on their workflows.
23-28
: Highlighting the Hugging Face Hub integration and refreshed tutorials is great. It might be beneficial to briefly mention the types of datasets or tutorials that were refreshed, to give users an idea of what to expect.
32-47
: The App section clearly outlines new features and bug fixes. However, for the bug fixes, consider briefly explaining the impact of these fixes on the user experience. For example, how the fix for applying filters to |Keypoint| fields improves data visualization or analysis.
51-56
: In the Core section, the optimization of segmentation mask conversion is mentioned alongside a matplotlib style deprecation error fix. It would be helpful to specify how the segmentation mask conversion was optimized, such as through algorithm improvements or parallel processing enhancements.
59-74
: The Plugins section introduces secrets availability and fixes to operator behaviors. Clarifying how secrets can be used by operators and the specific scenarios where the fixed regressions and bugs were impacting performance could provide more context to users.
78-89
: The Zoo section is informative, but adding a brief description of the capabilities or use cases for the newly supported models (YOLOv8, YOLOv9, OBB models, Segment Anything models) could enhance understanding and excitement about these additions.fiftyone/core/dataset.py (1)
6808-6811
: Consider adding a comment explaining the purpose of theforce
parameter and the condition under which the update is skipped. This will enhance code readability and maintainability.
app/packages/core/src/components/Sidebar/Entries/FilterablePathEntry/Arrow.tsx
Show resolved
Hide resolved
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.
Actionable comments posted: 0
Review Status
Configuration used: CodeRabbit UI
Files selected for processing (3)
- docs/source/release-notes.rst (1 hunks)
- fiftyone/utils/utils3d.py (2 hunks)
- tests/unittests/utils3d_tests.py (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- docs/source/release-notes.rst
Additional comments not posted (3)
tests/unittests/utils3d_tests.py (1)
242-280
: Consider adding more diverse test cases for edge cases and error handling.While the current test cases cover basic scenarios, including edge cases and error scenarios (e.g., invalid projection normals) could enhance the robustness of the tests.
fiftyone/utils/utils3d.py (2)
707-718
: Ensure the suppression of the non-unique optimal rotation warning is justified.While suppressing warnings can be necessary, it's important to ensure that this does not hide potential issues. Verify that this warning suppression does not mask other underlying problems with the rotation calculation.
707-718
: Removal of_rotation_matrix_from_vectors
function.The update to use
sp.transform.Rotation.align_vectors
for rotation calculation is a good improvement, making the code more concise and potentially more reliable by leveraging a well-tested library function.
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.
Actionable comments posted: 6
Review Status
Configuration used: CodeRabbit UI
Files selected for processing (6)
- docs/source/release-notes.rst (1 hunks)
- fiftyone/core/stages.py (5 hunks)
- fiftyone/server/aggregations.py (3 hunks)
- fiftyone/server/mutation.py (6 hunks)
- fiftyone/server/view.py (5 hunks)
- tests/unittests/view_tests.py (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- docs/source/release-notes.rst
- fiftyone/server/mutation.py
Additional comments not posted (3)
fiftyone/server/aggregations.py (1)
192-209
: Refine the use ofawaitable
parameter in_load_view
.The
awaitable
parameter in the_load_view
function seems to be a constant value (True
) and is not used within the function body. If this parameter's value is not intended to change, consider removing it to simplify the function signature. If it's meant to provide flexibility for synchronous or asynchronous execution, ensure its usage is correctly implemented within the function.fiftyone/server/view.py (1)
97-145
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [83-101]
Clarify the purpose of the
awaitable
parameter in theget_view
function.The addition of the
awaitable
parameter to theget_view
function suggests an intention to support both synchronous and asynchronous execution paths. However, the current implementation does not clearly differentiate between these paths or utilize theawaitable
parameter effectively. Consider adding documentation to explain the parameter's purpose and ensure its usage aligns with the intended asynchronous behavior of the function.tests/unittests/view_tests.py (1)
4272-4274
: LGTM! The addition of_allow_mixed=True
enhances flexibility in handling group slices.
Co-authored-by: Benjamin Kane <ben@voxel51.com>
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.
Actionable comments posted: 1
Review Status
Configuration used: CodeRabbit UI
Files selected for processing (12)
- app/packages/components/src/components/ThemeProvider/index.tsx (1 hunks)
- app/packages/plugins/src/externalize.ts (3 hunks)
- app/packages/spaces/src/SpaceNode.tsx (2 hunks)
- app/packages/spaces/src/SpaceTree.ts (2 hunks)
- app/packages/spaces/src/components/Space.tsx (2 hunks)
- app/packages/spaces/src/types.ts (1 hunks)
- app/packages/spaces/src/utils.ts (1 hunks)
- app/packages/spaces/src/utils/sizes.test.ts (1 hunks)
- app/packages/spaces/src/utils/sizes.ts (1 hunks)
- app/packages/state/src/hooks/useSessionSpaces.ts (2 hunks)
- docs/source/release-notes.rst (1 hunks)
- fiftyone/core/spaces.py (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- docs/source/release-notes.rst
Additional comments not posted (13)
app/packages/spaces/src/utils.ts (1)
12-12
: Ensure thesizes
property inSpaceNode
is always initialized as an array to avoid potential runtime errors when accessing it.app/packages/spaces/src/utils/sizes.ts (1)
1-26
: Consider adding error handling for edge cases, such as empty arrays or negative sizes, to ensure robustness.app/packages/plugins/src/externalize.ts (1)
5-5
: Ensure that the@fiftyone/spaces
module is correctly installed and available globally as__fosp__
to prevent potential reference errors.Verification successful
The verification process has confirmed that
@fiftyone/spaces
is listed as a dependency in the project'spackage.json
files, indicating that the package is installed and intended for use. This aligns with the initial review comment's suggestion to ensure the module's availability globally as__fosp__
. Therefore, the review comment is validated by the evidence found in the project's dependency listings.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check if @fiftyone/spaces is installed npm list @fiftyone/spaces || echo "@fiftyone/spaces is not installed"Length of output: 175
Script:
#!/bin/bash # Check if @fiftyone/spaces is listed in package.json if grep -q '"@fiftyone/spaces"' package.json; then echo "@fiftyone/spaces is listed in package.json" else echo "@fiftyone/spaces is not listed in package.json" fiLength of output: 192
Script:
#!/bin/bash # Find and check package.json for @fiftyone/spaces fd package.json --exec grep -q '"@fiftyone/spaces"' {} \; -x echo "{}: @fiftyone/spaces is listed" || echo "package.json not found or @fiftyone/spaces is not listed"Length of output: 349
app/packages/spaces/src/types.ts (1)
43-43
: Adding thesizes
field toSpaceNodeJSON
is consistent with the introduction of size management across the application. Ensure that all consumers ofSpaceNodeJSON
are updated to handle this new field appropriately.app/packages/spaces/src/utils/sizes.test.ts (1)
1-41
: The tests cover a good range of scenarios for the size utilities. Consider adding tests for edge cases, such as empty arrays or negative sizes, to ensure the utility functions handle these gracefully.fiftyone/core/spaces.py (1)
62-63
: The addition of thesizes
field to theSpace
class enhances layout management flexibility. Ensure that all code paths that instantiateSpace
objects are updated to handle this new field.app/packages/state/src/hooks/useSessionSpaces.ts (1)
52-52
: The integration ofsizes
handling in session space state conversion functions is a crucial step for supporting the new layout management features. Verify that the sizes data is correctly formatted and used in all relevant components.Also applies to: 69-69
Verification successful
The shell script output confirms that
sizes
data is correctly used in theSpace.tsx
component, indicating that the integration ofsizes
handling in session space state conversion functions is properly utilized in relevant components. This aligns with the initial review comment's verification request.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify that sizes data is correctly used in relevant components grep -R "sizes" app/packages/spaces/src/components/ || echo "No usage of sizes in components found"Length of output: 1347
app/packages/spaces/src/SpaceNode.tsx (1)
14-14
: The addition of thesizes
property to theSpaceNode
class aligns with the broader initiative to enhance layout management. Ensure that all methods interacting withchildren
orlayout
properties consider thesizes
property to maintain consistency.Also applies to: 113-113
app/packages/spaces/src/SpaceTree.ts (1)
85-88
: LGTM! ThesetNodeSizes
method correctly updates the node sizes and the tree.app/packages/spaces/src/components/Space.tsx (3)
1-4
: LGTM! The added imports are necessary for the new functionality in theSpace
component.
10-14
: Ensure the utility functions for size calculations are thoroughly tested, especially for edge cases in resizing.Verification successful
The executed script successfully located and extracted portions of test cases for the
getAbsoluteSizes
,getRelativeSizes
, andtoPercentage
functions from thesizes
utility file. The output provides a clear indication that each of these functions is covered by multiple test cases, which assess a variety of inputs and validate the expected outputs. This demonstrates a thorough approach to testing these utility functions, addressing the original concern about ensuring their reliability, especially in handling edge cases for resizing.Given this evidence, it can be concluded that the utility functions for size calculations (
getAbsoluteSizes
,getRelativeSizes
, andtoPercentage
) are indeed thoroughly tested, covering a range of scenarios that likely include edge cases.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Suggest running unit tests for the utility functions if they exist. echo "Please verify if there are unit tests for getAbsoluteSizes, getRelativeSizes, and toPercentage functions in '../utils/sizes'. If not, consider adding them."Length of output: 326
Script:
#!/bin/bash # Search for test files related to the 'sizes' utilities fd 'sizes.*test.*' --exec grep -E 'getAbsoluteSizes|getRelativeSizes|toPercentage'Length of output: 1232
24-63
: LGTM! The updates to handle resizing and layout changes in theSpace
component are well-implemented. Ensure the interaction between the debouncedsetSpaceSizes
function and theuseEffect
hook is thoroughly tested.app/packages/components/src/components/ThemeProvider/index.tsx (1)
213-221
: LGTM! The style overrides forMuiIconButton
to unset the background color on hover are a good design choice. Ensure this change is consistent with the application's design guidelines.
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.
Actionable comments posted: 0
Review Status
Configuration used: CodeRabbit UI
Files selected for processing (2)
- docs/source/release-notes.rst (1 hunks)
- docs/source/user_guide/using_datasets.rst (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- docs/source/release-notes.rst
Additional comments not posted (1)
docs/source/user_guide/using_datasets.rst (1)
1-4
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-4943]
The documentation update accurately reflects the change in functionality related to removing a parameter reference and adjusting a code snippet for updating label values in FiftyOne Datasets. The reStructuredText formatting appears correct, and there are no typographical or grammatical issues detected in the provided context. This update should help users understand how to work with the updated functionality.
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.
Actionable comments posted: 0
Review Status
Configuration used: CodeRabbit UI
Files selected for processing (1)
- .github/workflows/build-desktop.yml (1 hunks)
Additional comments not posted (2)
.github/workflows/build-desktop.yml (2)
15-15
: Update to Ubuntu 22.04 for the build job.This update likely provides access to newer software versions and security updates. Ensure that all dependencies are compatible with Ubuntu 22.04.
15-15
: Consider updating thepublish
job to Ubuntu 22.04 for consistency.Using the same operating system version across all jobs can help avoid potential compatibility issues and simplify maintenance.
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.
v0.23.8 is intended to be a hotfix release. Do we really want to include all these changes?
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.
Actionable comments posted: 0
Review Status
Configuration used: CodeRabbit UI
Files selected for processing (1)
- docs/source/release-notes.rst (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- docs/source/release-notes.rst
Features already in release/v0.23.8
Features cherry-picked from develop in this PR
Keypoint
filters #4201_transform_mask()
. #4185Release notes