-
Notifications
You must be signed in to change notification settings - Fork 464
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
[datasets] Allow detection task for built-in datasets #1717
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1717 +/- ##
==========================================
+ Coverage 96.40% 96.42% +0.02%
==========================================
Files 164 164
Lines 7782 7869 +87
==========================================
+ Hits 7502 7588 +86
- Misses 280 281 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
doctr/datasets/funsd.py
Outdated
if recognition_task and detection_task: | ||
raise ValueError( | ||
"recognition_task and detection_task cannot be set to True simultaneously " | ||
+ "to get the whole dataset with boxes and labels leave both to False" | ||
) | ||
|
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.
I guess this part can be moved in VisionDataset
or even in an abstraction above as this configuration is always forbidden.
It'll also reduce the number of copy paste
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.
The problem here is that all datasets inerhit from AbstractDataset
, but not all datasets provides the functionality to be used for recognition
and/or detection
for example MJSynth is a pure recognition
dataset :)
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.
So recognition_task
/ detection_task
is only available on the top level .. We could do something like raise_for
on VisionDataset
but not sure if we really want something 😅
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.
Ok, so if you don't want to to be able to pass recognition_task
or detection_task
to all AbstractDataset
, the code can stay like this, I'm fine with it. My goal was to move the logic "if both variables are set to True, then raise an error as it's never possible".
@odulcy-mindee I tried to handle it with kwargs in the Do you know what i mean ? Edit: double checked - we would need to init
wdyt ? |
Here, I see what you mean. It lacks a variable |
Correct :) Something like that :) |
I think too for the moment we can stay with it as is, but this would be an possible way to clean up the code a bit 👍 |
This PR:
Any feedback is welcome