Open bschultz96 opened 2 months ago
[!IMPORTANT]
Review skipped
Auto incremental reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yaml
file in this repository. To trigger a single review, invoke the@coderabbitai review
command.You can disable this status message by setting the
reviews.review_status
tofalse
in the CodeRabbit configuration file.
The recent changes across the codebase introduce a new parameter, allImages
, to various export-related functions and classes. This parameter allows users to specify whether all images should be included in dataset exports. Modifications were made to function signatures, internal logic, and API documentation to accommodate this new functionality, improving the granularity and flexibility of the export processes throughout the application.
Files | Change Summary |
---|---|
cvat-core/src/annotations.ts , cvat-core/src/project-implementation.ts , cvat-core/src/project.ts , cvat-core/src/server-proxy.ts , cvat-core/src/session-implementation.ts , cvat-core/src/session.ts , cvat-ui/src/actions/export-actions.ts |
Added allImages parameter to export functions, modifying function signatures and internal logic to include this parameter for more control over image inclusion during exports. |
cvat-ui/src/components/export-dataset/export-dataset-modal.tsx |
Updated form in the export dataset modal to include a new option for saving all images, modifying the FormValues type and handling state management accordingly. |
cvat/apps/dataset_manager/bindings.py , cvat/apps/dataset_manager/formats/*.py |
Introduced all_images parameter in multiple functions and classes, enhancing the ability to control image inclusion in dataset exports across various formats. |
cvat/apps/dataset_manager/project.py , cvat/apps/dataset_manager/task.py |
Updated export_project , export_job , and export_task functions to include the all_images parameter in their signatures, allowing for more dynamic export options. |
cvat/apps/dataset_manager/util.py , cvat/apps/engine/background.py , cvat/apps/engine/views.py |
Modified functions to integrate the all_images parameter for enhanced export filename generation and callback handling, improving the granularity of image export control across the engine. |
cvat/schema.yml |
Added a new query parameter all_images as a boolean to allow users to specify whether to include all images in dataset exports. |
sequenceDiagram
participant User
participant API
participant ExportManager
participant Dataset
User->>API: Request Export with all_images
API->>ExportManager: Pass all_images parameter
ExportManager->>Dataset: Export Dataset with all_images
Dataset-->>ExportManager: Return Export Status
ExportManager-->>API: Return API Response
API-->>User: Provide Export Results
🐇 In the meadow, I hop and play,
With new exports brightening the day!
All images saved, what a delight,
A dataset journey, pure and bright!
Let's celebrate this joyous feat,
With carrots and love, life is sweet! 🥕✨
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?
This is a useful addition when creating and adding to datasets.
If you have some automation for task creation, so you know was it a dataset originally, you can upload only empty images or upload everything and mark the extra images as deleted.
Please add at least some tests for the updated functionality.
I'm getting a bunch of tests failing due to an APIException with the following error message: "TypeError: _export_task_orjob() got an unexpected keyword argument all_images." It traces back to the cvat.py format file which does indeed have the parameter all_images within all necessary functions. Interestingly enough, if I change the test to use a different format it works fine. Just wondering if you might know why specifically for cvat format I get this exception? Screenshot linked with the output I get.
Maybe you need to rebuild the containers before running tests.
@ bschultz96 Hello brother, have you made any progress? Perhaps there are other ideas for implementation?
@ bschultz96 Hello brother, have you made any progress? Perhaps there are other ideas for implementation?
I couldn't figure out why the tests I added to test the new functionality aren't returning the results I expect. When I run the tests the endpoint is always downloading either all or no images and behavior doesn't change for whichever all_images is set to. Manually testing the endpoint works fine, so I think I'm missing something in the testing environment backend but after spending a few hours couldn't find make any headway.
I couldn't figure out why the tests I added to test the new functionality aren't returning the results I expect. When I run the tests the endpoint is always downloading either all or no images and behavior doesn't change for whichever all_images is set to. Manually testing the endpoint works fine, so I think I'm missing something in the testing environment backend but after spending a few hours couldn't find make any headway.
Have you tried pytest --rebuild tests/python
?
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Added radio buttons to export either all images or only annotated images when "Save Images" is selected during export process.
The default is set to True to match with the previous behavior when saving images.
Motivation and context
This is a useful addition when creating and adding to datasets. We had been using a work around to export only the annotated images but decided doing the work to implement this would be worthwhile.
How has this been tested?
Manual testing, exporting projects, tasks, and jobs have all been tested.
Checklist
develop
branch ~- [ ] I have created a changelog fragment ~ ~- [ ] I have updated the documentation accordingly~ ~- [ ] I have added tests to cover my changes~ ~- [ ] I have linked related issues (see GitHub docs)~ ~- [ ] I have increased versions of npm packages if it is necessary~ ~(cvat-canvas,~ ~cvat-core,~ ~cvat-data and~ ~cvat-ui)~License
Summary by CodeRabbit
New Features
allImages
parameter for dataset export, allowing users to choose whether to export all images or only those with annotations across various export functions.Bug Fixes
allImages
parameter is correctly applied.Documentation
allImages
parameter, providing clarity on its purpose and default value.Style