Skip to content

Commit

Permalink
Merge branch 'dev' into fix/update-nn-archive-generation
Browse files Browse the repository at this point in the history
  • Loading branch information
kozlov721 authored Aug 14, 2024
2 parents 32f8098 + c116982 commit 7eaf631
Show file tree
Hide file tree
Showing 33 changed files with 554 additions and 555 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,4 @@ models_venv/*

# vscode settings
.vscode
tests/data
Empty file modified configs/classification_model.yaml
100755 → 100644
Empty file.
Empty file modified configs/coco_model.yaml
100755 → 100644
Empty file.
188 changes: 0 additions & 188 deletions configs/coco_multitask_model.yaml

This file was deleted.

Empty file modified configs/detection_model.yaml
100755 → 100644
Empty file.
Empty file modified configs/example_export.yaml
100755 → 100644
Empty file.
Empty file modified configs/example_tuning.yaml
100755 → 100644
Empty file.
Empty file modified configs/keypoint_bbox_model.yaml
100755 → 100644
Empty file.
110 changes: 0 additions & 110 deletions configs/resnet_multitask_model.yaml

This file was deleted.

Empty file modified configs/segmentation_model.yaml
100755 → 100644
Empty file.
4 changes: 4 additions & 0 deletions luxonis_train/attached_modules/base_attached_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ def get_label(
@rtype: tuple[Tensor, LabelType]
@return: Extracted label and its type.
"""
if label_type is None:
if len(self.required_labels) == 1:
label_type = self.required_labels[0]

if label_type is not None:
task_name = self.node.get_task_name(label_type)
if task_name not in labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def prepare(
targets[:, self.box_offset + 2 :: 3] = kpts[:, 3::3] # insert kp y coordinates
targets[:, self.box_offset + 3 :: 3] = kpts[:, 4::3] # insert kp visibility

n_targets = len(targets)
n_targets = targets.shape[0]

class_targets: list[Tensor] = []
box_targets: list[Tensor] = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,7 @@ def forward(self, predictions: list[Tensor], target: Tensor) -> Tensor:
self.negative_smooth_const,
device=prediction.device,
)
smoothed_target[torch.arange(len(target)), target] = self.positive_smooth_const
smoothed_target[
torch.arange(target.shape[0]), target
] = self.positive_smooth_const
return self.criterion.forward(prediction, smoothed_target)
Loading

0 comments on commit 7eaf631

Please sign in to comment.