Closed brimoor closed 1 month ago
The recent updates to the FiftyOne library introduce new parameters persistent
and _generated
to several dataset creation functions. These parameters enhance dataset management by controlling persistence and generation behavior. Specifically, they allow for creating either temporary or persistent datasets based on the _generated
flag. This change affects functions in various modules, including clips.py
, dataset.py
, patches.py
, stages.py
, and video.py
. Additionally, new tests ensure the correct functionality of these updates.
File(s) | Change Summary |
---|---|
fiftyone/core/clips.py |
Added persistent and _generated parameters to make_clips_dataset ; modified name parameter to _name ; adjusted dataset creation logic. |
fiftyone/core/dataset.py |
Corrected a comment related to clips datasets. |
fiftyone/core/patches.py |
Added persistent and _generated parameters to make_patches_dataset and make_evaluation_patches_dataset . |
fiftyone/core/stages.py |
Added _generated parameter to several functions, reordered arguments. |
fiftyone/core/video.py |
Added persistent and _generated parameters to make_frames_dataset ; updated function documentation. |
tests/unittests/patches_tests.py |
Added test_make_patches_dataset method to validate patch dataset creation. |
tests/unittests/video_tests.py |
Added test_make_frames_dataset and test_make_clips_dataset methods to validate frames and clips dataset creation. |
Objective | Addressed | Explanation |
---|---|---|
Ensure make_frames_dataset creates a Dataset not treated as FramesView (#4397) |
❓ | The changes include adding parameters to control dataset behavior, but it's unclear if _is_frames issue is resolved. |
Validate new parameters in dataset creation functions | ✅ | |
Add and verify new test methods for dataset creation | ✅ |
In fields of code where datasets grow,
New flags now guide where data flows.
Persistent paths or temp's embrace,
Each line of code finds its place.
With tests to guard and bugs to chase,
Our codebase shines with added grace.
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?
Resolves https://github.com/voxel51/fiftyone/issues/4397
The
make_{patches|frames|clips}_dataset()
methods were originally designed to be called internally by theto_{patches|frames|clips}()
methods but not called directly. For example, as observed in https://github.com/voxel51/fiftyone/issues/4397, they currently return a dataset that behaves like a view in certain ways. Also, directly callingmake_clips_dataset()
is especially pernicious, as it currently returns a dataset that silently reuses the same frames collection as the input dataset.However, there is a good use case for directly calling
make_{patches|frames|clips}_dataset()
to convert a collection into an independent dataset.So, this PR maintains the behavior of
to_{patches|frames|clips}()
while tweaking the default behavior of themake_{patches|frames|clips}_dataset()
methods so that they do return a completely normal dataset.Example usage
Summary by CodeRabbit
New Features
Bug Fixes
Tests