-
Notifications
You must be signed in to change notification settings - Fork 212
Conversation
Hello @ethanwharris! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-08-12 12:41:35 UTC |
class IceVisionParserDataSource(IceVisionPathsDataSource): | ||
|
||
def __init__(self, parser: Optional[Type['Parser']] = None): | ||
super().__init__() | ||
self.parser = parser | ||
|
||
def load_data(self, data: Tuple[str, str], dataset: Optional[Any] = None) -> Sequence[Dict[str, Any]]: | ||
root, ann_file = data | ||
|
||
if self.parser is not None: | ||
parser = self.parser(ann_file, root) | ||
dataset.num_classes = len(parser.class_map) | ||
records = parser.parse(data_splitter=SingleSplitSplitter()) | ||
return [{DefaultDataKeys.INPUT: record} for record in records[0]] | ||
else: | ||
raise ValueError("The parser type must be provided") | ||
|
||
|
||
class IceDataParserDataSource(IceVisionPathsDataSource): | ||
|
||
def __init__(self, parser: Optional[Callable] = None): | ||
super().__init__() | ||
self.parser = parser | ||
|
||
def load_data(self, data: Tuple[str, str], dataset: Optional[Any] = None) -> Sequence[Dict[str, Any]]: | ||
root = data | ||
|
||
if self.parser is not None: | ||
parser = self.parser(root) | ||
dataset.num_classes = len(parser.class_map) | ||
records = parser.parse(data_splitter=SingleSplitSplitter()) | ||
return [{DefaultDataKeys.INPUT: record} for record in records[0]] | ||
else: | ||
raise ValueError("The parser must be provided") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could they be merged together ?
Codecov Report
@@ Coverage Diff @@
## master #608 +/- ##
==========================================
- Coverage 90.58% 90.01% -0.58%
==========================================
Files 173 185 +12
Lines 9232 9663 +431
==========================================
+ Hits 8363 8698 +335
- Misses 869 965 +96
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be possible to have the refactoring in separate PR (for example moving backbones) so it is easier to see what are the real changes?
@@ -0,0 +1,31 @@ | |||
|
|||
.. _instance_segmentation: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can have these labels automatically generated by docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work !
pass | ||
|
||
|
||
class AdapterTask(Task): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the AdapterTask use the mixins ?
LGTM! |
…ng/lightning-flash into feature/icevision
What does this PR do?
Fixes #487
Fixes #480
Fixes #119
Before submitting
PR review
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 🙃