Skip to content
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

Add dataset slicing and fix remove annotations #1131

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

potipot
Copy link
Contributor

@potipot potipot commented Aug 11, 2022

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.

@ai-fast-track
Copy link
Collaborator

Great idea Pawel! Thanks!

@potipot
Copy link
Contributor Author

potipot commented Aug 11, 2022

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
Copy link

codecov bot commented Aug 11, 2022

Codecov Report

Merging #1131 (500ddf2) into master (356d29b) will increase coverage by 0.35%.
The diff coverage is 87.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%) ⬆️

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%) ⬇️
icevision/core/record_components.py 81.63% <100.00%> (+0.05%) ⬆️
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%) ⬆️
icevision/models/ross/efficientdet/loss_fn.py 100.00% <0.00%> (+25.00%) ⬆️
...odels/ross/efficientdet/lightning/model_adapter.py 97.43% <0.00%> (+60.76%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants