Skip to content

Commit

Permalink
added fixes for few tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
kprokofi committed Nov 13, 2024
1 parent 53e5f42 commit 702056b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ docs = [
xpu = [
"torch==2.6.0.dev20241104+xpu",
"torchvision==0.20.0.dev20241104+xpu",
"pytorch-triton-xpu==3.1.0+91b14bf559"
"pytorch-triton-xpu==3.1.0+91b14bf559",
"oneccl_bind_pt==2.1.300+xpu",
"lightning==2.2",
"pytorchcv==0.0.67",
Expand Down
2 changes: 1 addition & 1 deletion src/otx/algo/keypoint_detection/heads/rtmcc_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def loss(self, x: tuple[Tensor], entity: KeypointDetBatchDataEntity) -> dict:
mask=mask,
)

loss_pose = -1 * torch.tensor(avg_acc, device=device)
loss_pose = -1 * torch.tensor(avg_acc, device=device, dtype=torch.float32)
losses.update(loss_pose=loss_pose)

return losses
Expand Down
3 changes: 1 addition & 2 deletions src/otx/core/metrics/mlc_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ def update(self, preds: Tensor, target: Tensor) -> None:

def compute(self) -> Tensor | dict[str, Any]:
"""Compute the metric."""
metric_value = _map(torch.stack(self.targets).cpu().numpy(), torch.stack(self.preds).cpu().numpy())

metric_value = _map(torch.stack(self.targets).cpu().numpy(), torch.stack(self.preds).detach().cpu().float().numpy())
return {"mAP": Tensor([metric_value])}


Expand Down

0 comments on commit 702056b

Please sign in to comment.