Add dataset slicing and fix remove annotations
add dataset slicing
This simple PR adds functionality of slicing dataset to return a new sub dataset. This can be used in inference for example like so:
infer_dl = model_type.infer_dl(valid_ds[:4], batch_size=4, shuffle=False)
preds = model_type.predict_from_dl(model, infer_dl, keep_images=True)
remove annotation
The remove annotation for detection component was broken, it only deleted the label_id from record but not the string encoded label itself.
Great idea Pawel! Thanks!
it seems like the error is coming from pytorch-lightning 1.7.0 the version we install
Requirement already satisfied: pytorch-lightning>=1.4.5 in /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages (from icevision==0.12.0) (1.7.1)
argument deprecated since 1.7.0: https://pytorch-lightning.readthedocs.io/en/stable/generated/CHANGELOG.html#removed
Codecov Report
Merging #1131 (500ddf2) into master (356d29b) will increase coverage by
0.35%. The diff coverage is87.50%.
@@ Coverage Diff @@
## master #1131 +/- ##
==========================================
+ Coverage 85.48% 85.83% +0.35%
==========================================
Files 305 305
Lines 6675 6713 +38
==========================================
+ Hits 5706 5762 +56
+ Misses 969 951 -18
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 85.83% <87.50%> (+0.35%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| icevision/data/dataset.py | 93.75% <85.71%> (-2.92%) |
:arrow_down: |
| icevision/core/record_components.py | 81.63% <100.00%> (+0.05%) |
:arrow_up: |
| icevision/models/fastai/unet/lightning.py | 100.00% <0.00%> (ø) |
|
| ...sion/models/torchvision/lightning_model_adapter.py | 100.00% <0.00%> (ø) |
|
| ...dels/ultralytics/yolov5/lightning/model_adapter.py | 100.00% <0.00%> (ø) |
|
| icevision/models/mmdet/lightning/model_adapter.py | 97.43% <0.00%> (+0.21%) |
:arrow_up: |
| icevision/models/ross/efficientdet/loss_fn.py | 100.00% <0.00%> (+25.00%) |
:arrow_up: |
| ...odels/ross/efficientdet/lightning/model_adapter.py | 97.43% <0.00%> (+60.76%) |
:arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more