Skip to content
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

LabelMe shift operation bug #4

Open
CMangoDH opened this issue Oct 21, 2020 · 0 comments
Open

LabelMe shift operation bug #4

CMangoDH opened this issue Oct 21, 2020 · 0 comments

Comments

@CMangoDH
Copy link

CMangoDH commented Oct 21, 2020

def _shift_pic_bboxes(self, img, json_info):
  ...
  for shape in shapes:
      points = np.array(shape['points'])
      x_min = min(x_min, points[:, 0].min())
      y_min = min(y_min, points[:, 1].min())
      x_max = max(x_max, points[:, 0].max())
      y_max = max(y_max, points[:, 0].max())   # 这里需要修改 y_max = max(y_max, points[:, 1].max())
  ...
  #目标的边缘在图片边缘的情况 是不能平移的
  if (d_to_left < 1):
      d_to_left = 1
  if (d_to_right < 1):
      d_to_right = 1
  if (d_to_top < 1):
      d_to_top = 1
  if (d_to_bottom < 1):
      d_to_bottom = 1
  
  x = random.uniform(-(d_to_left - 1) / 3, (d_to_right - 1) / 3)
  y = random.uniform(-(d_to_top - 1) / 3, (d_to_bottom - 1) / 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant