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

Feedback #1

Open
wants to merge 210 commits into
base: feedback
Choose a base branch
from
Open

Feedback #1

wants to merge 210 commits into from

Conversation

github-classroom[bot]
Copy link

@github-classroom github-classroom bot commented Nov 10, 2024

👋! GitHub Classroom created this pull request as a place for your teacher to leave feedback on your work. It will update automatically. Don’t close or merge this pull request, unless you’re instructed to do so by your teacher.
In this pull request, your teacher can leave comments and feedback on your code. Click the Subscribe button to be notified if that happens.
Click the Files changed or Commits tab to see all of the changes pushed to the default branch since the assignment started. Your teacher can see this too.

Notes for teachers

Use this PR to leave feedback. Here are some tips:

  • Click the Files changed tab to see all of the changes pushed to the default branch since the assignment started. To leave comments on specific lines of code, put your cursor over a line of code and click the blue + (plus sign). To learn more about comments, read “Commenting on a pull request”.
  • Click the Commits tab to see the commits pushed to the default branch. Click a commit to see specific changes.
  • If you turned on autograding, then click the Checks tab to see the results.
  • This page is an overview. It shows commits, line comments, and general comments. You can leave a general comment below.
    For more information about this pull request, read “Leaving assignment feedback in GitHub”.

Subscribed: @Batwan01 @jhuni17 @jung0228 @min000914 @chan-note @uddaniiii

from config import TRAIN_IMAGE_ROOT, TRAIN_LABEL_ROOT, CLASSES, CLASS2IND, \
train_jsons, train_pngs, TEST_IMAGE_ROOT, test_pngs

class XRayDataset(Dataset):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docstring 작성이 필요합니다.

y_coords = coords[2::2]

# 각 좌표를 이미지 크기로 정규화
x_coords_norm = [x / img_width for x in x_coords]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

해당 방식보다는, vectorization (numpy)를 활용하여 연산하면 훨씬 효율적으로 할 수 있습니다.

"""outputs_json 디렉토리 내의 모든 ID 폴더를 가져오는 함수"""
return sorted([p for p in Path(base_path).glob('ID*')])

def read_hand_jsons(id_folder):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

해당 함수 부분은 병렬처리가 가능해 보입니다. multi-threading 혹은 multi processing을 활용해서 병렬처리가 가능하도록 하면 훨씬 빠르게 처리가 가능합니다.

cv2.drawContours(image_to_draw, [contour], -1, colors[class_idx % len(colors)], 2)

# 저장
cv2.imwrite(save_path, image_to_draw)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

해당 저장하는 부분도 별도의 함수로 처리하여 병렬처리가 가능한 것으로 보입니다.
크게 문제는 없지만, 만약 병목구간이라면 위의 방법을 사용하는 것도 괜찮아 보입니다.


return image, label

def calculate_crop_box_from_points(self, points, image_size, crop_size=IMSIZE):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좀더 상세하게 docstring을 작성하는 것이 좋습니다.

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

Successfully merging this pull request may close these issues.

7 participants