-
Notifications
You must be signed in to change notification settings - Fork 86
[WIP] Add scale augmentation for all existing tasks #366
base: master
Are you sure you want to change the base?
Conversation
|
I have not addressed a very small box in edge, maybe I should drop them directly. 🤔 |
|
run test |
iizukak
left a comment
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.
@yd8534976 Thank you for PR!
Did you any experiment with Scale augmentation?
I want result of training using and not using training result.
| new_image.paste(scaled, (int(outer_width / 2), int(outer_height / 2))) | ||
|
|
||
| return np.array(new_image) | ||
| class Scale(data_processor.Processor): |
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.
|
|
||
| return np.array(new_image) | ||
| class Scale(data_processor.Processor): | ||
| """Scale. |
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 description was removed?
Resize image to scale size keeping the aspect ratio and place it in center of fill color image.
It's obvious?
| min_scale, max_scale = scale_range | ||
|
|
||
| assert min_scale >= 0.5 | ||
| assert max_scale <= 1.5 |
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 add assert with fill_color ?
@iizukak , Thanks for reviewing! I will fix them. Since I'm training another task.. I'll test this PR later. Since it will have similar issues as #377 . I worry that they can not support various tasks in future. Actually I want to rewrite them using |
|
opencv-python is big and heavy library. |
Now we don't have dependency to |
Thanks for answering! I think data augmentation will only be used in training environment, does it matter only add them into |
|
Or, we can add some functions like this.. |
Considering that adding a dependency to OpenCV will increase several hundreds of mega bytes (or maybe over 1 giga bytes) of our docker image size, adding the dependency just for some data augmentation methods seems not a reasonable choice, even only for training environment. As we already depends on TensorFlow, how about using |
Sorry, I have never tried Well, although rotate augmentation may be helpful, it is not necessary. We may write it by hand or rotate them channel by channel. |
I think we can use BTW, the core of what I wanted to tell here was, before adding a new dependency to large package, we should consider carefully. Otherwise our software will bloat and be hard to use.
Rotate them channel by channel (if channel number != 3) looks a good idea, because it's simple. |
|
@tkng Okay! I will pay attention to this point. Thanks for your patience! |
|
|
1 similar comment
|
|
Motivation and Context
Scale augmentation is an important augmentation especially for detection tasks. This PR implements Scale class to support scale augmentation for all existing tasks.
Description
Scaleclass.How has this been tested?
It is tested well using below notebook.
https://colab.research.google.com/drive/1MvRCKS92LylyhDsx0nIF9Drtt5f97OxZ#scrollTo=Orst-U1mS4rh
Screenshots (if appropriate):
Types of changes
Checklist: