-
Notifications
You must be signed in to change notification settings - Fork 2
Comparison to default CenterNet #1
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
base: origin_centernet
Are you sure you want to change the base?
Conversation
zimka
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.
Вроде все ок, никаких баг не нашел.
Но есть проблема прямоугольного представления таблиц
| @@ -1,124 +1,145 @@ | |||
| _base_ = [ | |||
| '../_base_/datasets/coco_detection.py', | |||
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.
Общее замечание: лучше либо не менять стиль оформления кодовой базы вообще, либо делать это каким-то отдельным коммитом в начале/конце PR, что бы можно было смотреть дифф без изменения форматирования
| dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']) | ||
| test_pad_mode=None, | ||
| ), | ||
| dict(type="Resize", img_scale=(512, 512), keep_ratio=True), |
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.
В статье raining image равен 1024
| category. | ||
| loss_center_heatmap (dict | None): Config of center heatmap loss. | ||
| Default: GaussianFocalLoss. | ||
| loss_wh (dict | None): Config of wh loss. Default: L1Loss. |
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.
не очень важно, но здесь и в других местах докстринг не соответствут аргументам
| @@ -8,8 +8,7 @@ | |||
| from mmdet.core import multi_apply | |||
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.
Кажется дифф файла centernet_head.py только стилистический, лучше его просто откатить на мастер
| for j, ct in enumerate(gt_centers): | ||
| ctx_int, cty_int = ct.int() | ||
| ctx, cty = ct | ||
| scale_box_h = (gt_bbox[j][3] - gt_bbox[j][1]) * height_ratio |
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.
Масштабирование пятна в gt-хитмапе логично в CenterNet при детекции объектов.
Но в CenterCycleNet ведь предсказываются вершины как keypoint - только xy без wh. В таком варианте кажется нет смысла менять размер пятна.
Так и получается как раз картина, при которой углам большой ячейки соответствуют огромные пятна, а угла маленькой - маленькие.
| loss_v2c=loss_v2c, | ||
| ) | ||
|
|
||
| def get_targets(self, gt_bboxes, gt_labels, feat_shape, img_shape, c2v_pred, v2c_pred): |
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.
Кажется, что подача данных ячеек таблицы в виде COCO-датасета приводит к некорректно реализации Cycle-CenterNet.
Из схемы Cycle-CenterNet в статье и иллюстраций однозначно видно, что сеть предсказыает не-прямоугольные ячейки таблицы.
Но здесь на вход уже подаются прямоугольные ячейки, значит для них можно создать только таргет-хитмап по прямоугольной сетке, значит сеть научится предсказывать только такой прямоугольные ячейки
| ) | ||
| w = 1 - torch.exp(-pi * D_cv) | ||
| pairing_weight[batch_id, 2 * idx + k, cty_int, ctx_int] += w | ||
| pairing_weight[batch_id, 2 * idx + k, v_y_int, v_x_int] += w |
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.
Кажется, что в код написан корректно, и хотя локация соседа (v_y_in, v_x_int) появится 4 раз у ячеек-соседей, прибавление веса будет каждый раз в разные канал.
Но все же я бы здесь для теста на 1 раз поставил бы assert (pairing_weight[...] == 0), чтобы удостовериться что все ок, а затем бы заменил += на присваивание - так чуть более понятно получится
96ec47c to
ff77113
Compare
For code review