Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Docstrings for IceVision data #1102

Merged
merged 28 commits into from
Jan 11, 2022
Merged

Docstrings for IceVision data #1102

merged 28 commits into from
Jan 11, 2022

Conversation

ethanwharris
Copy link
Collaborator

@ethanwharris ethanwharris commented Jan 6, 2022

What does this PR do?

Part of #957
Fixes #1089

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests? [not needed for typos/docs]
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

  • Is this pull request ready for review? (if not, please submit in draft mode)

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@codecov
Copy link

codecov bot commented Jan 6, 2022

Codecov Report

Merging #1102 (dd178bd) into master (54d641d) will increase coverage by 0.06%.
The diff coverage is 93.05%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1102      +/-   ##
==========================================
+ Coverage   88.42%   88.49%   +0.06%     
==========================================
  Files         284      284              
  Lines       12876    12891      +15     
==========================================
+ Hits        11386    11408      +22     
+ Misses       1490     1483       -7     
Flag Coverage Δ
unittests 88.49% <93.05%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
flash/core/integrations/icevision/transforms.py 92.15% <86.20%> (+0.43%) ⬆️
flash/image/keypoint_detection/data.py 97.87% <94.44%> (+3.58%) ⬆️
flash/core/integrations/icevision/data.py 95.74% <100.00%> (+2.72%) ⬆️
flash/image/__init__.py 100.00% <100.00%> (ø)
flash/image/detection/data.py 100.00% <100.00%> (+4.08%) ⬆️
flash/image/instance_segmentation/data.py 100.00% <100.00%> (+4.54%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54d641d...dd178bd. Read the comment docs.

@ethanwharris ethanwharris added bug / fix Something isn't working Data Pipeline V2 documentation Improvements or additions to documentation labels Jan 6, 2022
@ethanwharris ethanwharris marked this pull request as ready for review January 7, 2022 10:29
Copy link
Member

@Borda Borda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

limiting my review only to the docs, as the coding is a different cup of tea to during lol
in general, the Docs is very good, much improved, just minor questions and suggestions 🐰

flash/core/integrations/icevision/data.py Outdated Show resolved Hide resolved
predict_transform: The :class:`~flash.core.data.io.input_transform.InputTransform` type to use when
predicting.
input_cls: The :class:`~flash.core.data.io.input.Input` type to use for loading the data.
transform_kwargs: Dict of keyword arguments to be provided when instantiating the transforms.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you pass different arguments for training and validation?
maybe just overload train_transform with spatial, so we would fill arguments ahead

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently it's a bit strange because you can pass a different transform class for train, val, test, predict, but they all share the same keyword arguments. We could think of just passing the instance, like this:

datamodule = ...from_x(
    train_transform = ImageInputTransform(image_size=64),
    ...
)

It has issues if you want to change e.g. the image size for all transforms but could be an option

... {"file_name": "image_2.png", "height": 64, "width": 64, "id": 2},
... {"file_name": "image_3.png", "height": 64, "width": 64, "id": 3},
... ]}
>>> with open("train_annotations.json", "w") as annotation_file:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, do we have an internal check that the file extension is valid or we leave it to IceVision?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently left to icevision, but the stuff we started in #889 would change that

flash/image/detection/data.py Outdated Show resolved Hide resolved
flash/image/detection/data.py Outdated Show resolved Hide resolved
flash/image/instance_segmentation/data.py Show resolved Hide resolved
flash/image/instance_segmentation/data.py Show resolved Hide resolved
├── image_3.png
...

The folder ``train_masks`` has the following contents:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets write what is the annotation, image coded in uint8 wth 0 as background and 1,... for instances?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should do this, will leave for a follow-up just because this PR is getting too heavy haha, but I plan to come back and add more detail

flash/image/instance_segmentation/data.py Show resolved Hide resolved
flash/image/keypoint_detection/data.py Show resolved Hide resolved
@ethanwharris ethanwharris mentioned this pull request Jan 7, 2022
9 tasks
@mergify mergify bot added the has conflicts label Jan 7, 2022
@mergify mergify bot removed the has conflicts label Jan 11, 2022
@ethanwharris ethanwharris merged commit 1739ada into master Jan 11, 2022
@ethanwharris ethanwharris deleted the docs/icevision_data branch January 11, 2022 19:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug / fix Something isn't working Data Pipeline V2 documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Instance segmentation on COCO-like dataset: RuntimeError: Masks are expected to be MaskFile objects.
2 participants