-
Notifications
You must be signed in to change notification settings - Fork 4
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
base: feedback
Are you sure you want to change the base?
Feedback #1
Conversation
Batwan01/yolo_base
…dataset cleaning process in data_cleansing.py
from config import TRAIN_IMAGE_ROOT, TRAIN_LABEL_ROOT, CLASSES, CLASS2IND, \ | ||
train_jsons, train_pngs, TEST_IMAGE_ROOT, test_pngs | ||
|
||
class XRayDataset(Dataset): |
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.
docstring 작성이 필요합니다.
y_coords = coords[2::2] | ||
|
||
# 각 좌표를 이미지 크기로 정규화 | ||
x_coords_norm = [x / img_width for x in x_coords] |
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.
해당 방식보다는, vectorization (numpy)를 활용하여 연산하면 훨씬 효율적으로 할 수 있습니다.
"""outputs_json 디렉토리 내의 모든 ID 폴더를 가져오는 함수""" | ||
return sorted([p for p in Path(base_path).glob('ID*')]) | ||
|
||
def read_hand_jsons(id_folder): |
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.
해당 함수 부분은 병렬처리가 가능해 보입니다. multi-threading 혹은 multi processing을 활용해서 병렬처리가 가능하도록 하면 훨씬 빠르게 처리가 가능합니다.
cv2.drawContours(image_to_draw, [contour], -1, colors[class_idx % len(colors)], 2) | ||
|
||
# 저장 | ||
cv2.imwrite(save_path, image_to_draw) |
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 image, label | ||
|
||
def calculate_crop_box_from_points(self, points, image_size, crop_size=IMSIZE): |
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.
좀더 상세하게 docstring을 작성하는 것이 좋습니다.
👋! 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:
For more information about this pull request, read “Leaving assignment feedback in GitHub”.
Subscribed: @Batwan01 @jhuni17 @jung0228 @min000914 @chan-note @uddaniiii