-
-
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
Unproportional mosaicing #1389
Unproportional mosaicing #1389
Conversation
tiles = np.asarray(tiles) | ||
|
||
shape_y, shape_x = tiles.shape | ||
shuffled_ids = np.linspace(0, shape_y - 1, shape_y, dtype=np.int32).tolist() |
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.
Do not save them into class member. Return as an argument.
def apply_to_keypoint(self, keypoint, **params): | ||
return () | ||
|
||
def get_params_dependent_on_targets(self, params): |
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.
Need to implement targets_as_params
to use this method.
num_segments = params["num_segments"] if "num_segments" in params else 7 | ||
ratio = params["ratio"] if "ratio" in params else 4.0 / 3.0 | ||
# refinement_steps = params["refinement_steps"] if "refinement_steps" in params else 10 |
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.
Mabe better to use it as an augmentation argument on creation. Also we could rewrite it if it will be provided on transform call.
index = 0 | ||
|
||
# We must work with the copy because "Split" alters the original list | ||
segms_copy = segms.copy() |
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 do not copy there
# We must work with the copy because "Split" alters the original list | ||
segms_copy = segms.copy() | ||
|
||
for segm in segms_copy: |
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.
Use enum
for index
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.
@Dipet I would like to ask you what do you mean by enum
. You mean enumerate function?
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.
Replace
index = 0
# We must work with the copy because "Split" alters the original list
segms_copy = segms.copy()
for segm in segms_copy:
with:
# We must work with the copy because "Split" alters the original list
segms_copy = segms.copy()
for index, segm in enumerate(segms_copy):
return True | ||
|
||
# Split | ||
current_num_semgs = 1 |
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.
Typo semgs
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.
Hi there, |
We would like to contribute to project Albumentations with new augmentation named Unproportional mosaicing.