-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 CopyAndPaste transform #1225
Comments
@ternaus Hi, I'm interested in the feature. How can we specify the pasted object in an albumentation's transform? Do we need to introduce a new target keyword like 'paste_image': transform(image=image, paste_image=paste_image, ...) , or sample segments from the same target image as yolov5 is doing? |
I think we could support this:
|
@Dipet thank you for your reply. Do You mean that the
If so, I think using Ex. transform Compose([
CopyAndPaste(paste_image_dir=objects_dir, …),
...
])
transform(image=image, …) # we can still use only the standard targets bboxes, and masks. To get a feel for it, I made a workable example in PR #1297 (still working). |
Checked the yolov5 code, here. It looks they don't do the method the paper describes Paper quote:
What they do:
|
Regarding this PR. I haven't checked the implementation in detail, but there are two points so far:
appear suboptimal. It would be better to handle everything in memory, working directly with already loaded images, labels, and masks. |
Loading everything to memory or loading from the disk could be of personal preference. In the lastest transform that needed to load extra data from disk it looks like We have pair of:
and
reference_data could be generator, sequence of ids, paths, images loaded into memory and read_fn is function that maps from reference_data element to something that transform uses. => if person wants to load everything into memory beforehead => load it to reference_data and use lambda x: x as read_fn, if you want to read on the fly => let all the work happen in It looks like a lot of different functionality is added in that PR, I would probably split it into different PR's |
The text was updated successfully, but these errors were encountered: