Skip to content

Commit

Permalink
🔀 [Merge] branch 'MODEL' into TEST
Browse files Browse the repository at this point in the history
  • Loading branch information
henrytsui000 committed Nov 21, 2024
2 parents 2ab865c + 5c767f2 commit fa2f0be
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions yolo/tools/data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ def filter_data(self, dataset_path: Path, phase_name: str, sort_image: bool = Fa
continue
annotations = annotations_index.get(image_info["id"], [])
image_seg_annotations = scale_segmentation(annotations, image_info)
if not image_seg_annotations:
continue

elif data_type == "txt":
label_path = labels_path / f"{image_id}.txt"
if not label_path.is_file():
Expand Down
2 changes: 1 addition & 1 deletion yolo/tools/loss_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def __call__(self, predicts: List[Tensor], targets: Tensor) -> Tuple[Tensor, Ten
targets_cls, targets_bbox = self.separate_anchor(align_targets)
predicts_box = predicts_box / self.vec2box.scaler[None, :, None]

cls_norm = targets_cls.sum()
cls_norm = max(targets_cls.sum(), 1)
box_norm = targets_cls.sum(-1)[valid_masks]

## -- CLS -- ##
Expand Down

0 comments on commit fa2f0be

Please sign in to comment.