-
Notifications
You must be signed in to change notification settings - Fork 615
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
COCOReader images
argument can be used to provide a custom order of images
#2597
COCOReader images
argument can be used to provide a custom order of images
#2597
Conversation
… samples Signed-off-by: Joaquin Anton <janton@nvidia.com>
'suit-2619784_1280.jpg' : 39, | ||
'business-suit-690048_1280.jpg' : 41, | ||
'car-604019_1280.jpg' : 59 | ||
'car-race-438467_1280.jpg' : 17, |
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 previous data was actually wrong.
If specified, it acts as a filter for the file paths present in the annotation file. | ||
If left unspecified or set to None, all images listed in the annotation file are read. | ||
If specified, it acts as a filter for the file paths present in the annotation file, which will be | ||
read in the same order as they appear in the list. |
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 would add a note that names could repeat and given sample would be read multiple times.
std::unordered_map<std::string, detail::ImageInfo*> image_info_map; | ||
std::unordered_map<int, size_t> custom_order; | ||
|
||
for (const auto &filename : images_) { |
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.
How about calling reserve
first?
'business-suit-690048_1280.jpg' : 41, | ||
'car-604019_1280.jpg' : 59 | ||
'car-race-438467_1280.jpg' : 17, | ||
'clock-1274699_1280.jpg' : 6, |
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 would add a test where a custom order with repetition is 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.
done
Signed-off-by: Joaquin Anton <janton@nvidia.com>
i = 0 | ||
while i < len(images): | ||
out = pipeline.run() | ||
assert out[0].at(0) == expected_ids[i] |
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.
Maybe just put here another loop that iterates batch_size times instead of hardcoding the repetition two times?
custom_orders = [ | ||
None, # natural order | ||
[0, 2, 4, 6, 1, 3, 5, 7], # altered order | ||
[0, 1, 2, 3, 2, 1, 4, 1, 5, 2, 6, 7], # with repetitions |
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.
Can you add a case for ID that doesn't exist in the dataset?
|
||
constexpr inline RLEMask() : UniqueHandle() {} | ||
|
||
struct RLEMask { |
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.
Why? Shouldn't RLEMask be marked as non-movable, non-copyable if not using proper move/copy semantics?
Signed-off-by: Joaquin Anton <janton@nvidia.com>
!build |
CI MESSAGE: [1973019]: BUILD STARTED |
CI MESSAGE: [1973019]: BUILD PASSED |
Signed-off-by: Joaquin Anton janton@nvidia.com
Why we need this PR?
Pick one, remove the rest
What happened in this PR?
Fill relevant points, put NA otherwise. Replace anything inside []
Rework the way that
images
argument is consumed, so that the images are sorted according to the order they appear in the provided file listFix wrong data in tests
COCOReader
COCOLoader changes
Test updated
Operator documentation updated
JIRA TASK: [DALI-1791]