Comments (5)
@5had3z Thank you for reporting this issue. To make sure I understand the problem, could you also provide some toy example data and code snippet so that I can reproduce and debug on my end? You can also play with pipeline seed to provide reproducible results.
Thank you in advance.
from dali.
More bounding boxes are removed than expected around the edges of an image with a random crop.
Can you also explain what you mean by this? What is the "expected" case? This operator removes any bounding box with a centroid outside of the cropping region. That is, if the center of the box is outside of the random crop, it's filtered out. Is this what you mean?
From the documentation:
The third output contains the bounding boxes, after filtering out the ones with a centroid outside
of the cropping window, and with the coordinates mapped to the new coordinate space.
from dali.
From the documentation:
The third output contains the bounding boxes, after filtering out the ones with a centroid outside of the cropping window, and with the coordinates mapped to the new coordinate space.
I should've rtfm'd a bit harder, I mainly focused on using the anchor, shape and output_bbox_indices output correctly. Since this is currently expected behaviour, I think a new parameter should be added to prune boxes based on area of bbox within the ROI, which I would argue would a prefered metric.
With the current behaviour if my centroid is in the ROI by one pixel in both axis, I have ~25% of the original box and this is kept. But if my bbox centroid is outside of the ROI by 1 pixel in 1 axis, I have just lost a bbox that is still ~50% within the image. Using a %area still within the ROI would keep more boxes that are reasonably within the ROI and would enable the option to make it 0.0 for no pruning.
I'll copy-pasta the existing code and add this new behaviour to a custom plugin for myself for now. If there is interest I can then make the changes on the main fn.random_bbox_crop.
from dali.
Comparison with my new cropping algorithm. This is shown with threshold=0.0 so if any sliver of the box is within roi it is kept, but this can be tuned. Not much needed to be changed, new arg and FilterByCentroid
replaced with FilterBboxes
that takes a lambda that returns a "should_keep" bool based on crop and box.
from dali.
That's awesome. We will gladly review and incorporate your extension to the operator:
Not much needed to be changed, new arg and FilterByCentroid replaced with FilterBboxes that takes a lambda that returns a "should_keep" bool based on crop and box.
How do you suggest we switch between the current filter by centroid and your new criteria?
filter_by="centroid"
vs filter_by="area"
argument?
Feel free to open a PR and with your suggested changes and we can continue the discussion in the review.
Thanks!
from dali.
Related Issues (20)
- Extracting properties from a list of DataNodes HOT 5
- A100 hardware decoder HOT 1
- Extract motion vectors HOT 7
- Segmentation fault when using 'mixed' HOT 5
- Indexing video with binary mask HOT 1
- source_info tensor not guaranteed to contain correct data HOT 1
- 16 bit gray scale Image read error HOT 1
- COCO Reader pixelwise_masks Emtpy Output HOT 7
- Dali on Jetson: nvidia.dali.fn.readers.video_resize is missing HOT 4
- Numpy reader test (GDS) HOT 4
- How to add a scalar value to the loader? HOT 1
- Can DALI be integrated into HuggingFace Trainer? HOT 9
- Bug in creating `TensorGPU` when `stream` key is `None` in CUDA array interface HOT 2
- Configure max image size HOT 3
- Webdataset reader behavior with many sources HOT 1
- ModuleNotFoundError: No module named 'nvidia.dali.python_function_plugin' HOT 3
- Speed up Dino with DALI HOT 3
- error using webdataset
- webdataset cannot stop cycling at end of epoch HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dali.