Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dinov3/eval/detection/models/detr.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def forward(self, outputs, target_sizes, original_target_sizes=None):
scale_fct = torch.stack([img_w, img_h, img_w, img_h], dim=1)
boxes = boxes * scale_fct[:, None, :]

results = [{"scores": s, "labels": l, "boxes": b} for s, l, b in zip(scores, labels, boxes)]
results = [{"scores": score, "labels": label, "boxes": box} for score, label, box in zip(scores, labels, boxes)]

return results

Expand Down
2 changes: 1 addition & 1 deletion dinov3/eval/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
Results: Any = pd.DataFrame

try:
import openpyxl # noqa: 401
import openpyxl # noqa: F401

HAS_OPENPYXL = True
except ImportError:
Expand Down
1 change: 0 additions & 1 deletion dinov3/hub/classifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import os
from enum import Enum
from typing import Optional

import torch
import torch.nn as nn
Expand Down
4 changes: 2 additions & 2 deletions dinov3/layers/fp8_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ def replace(module: torch.nn.Module, name: str) -> torch.nn.Module:
nonlocal total_count
if not isinstance(module, torch.nn.Linear) or not filter_re.search(name):
return module
if type(module) == torch.nn.Linear:
if type(module) == torch.nn.Linear: # noqa: E721
new_cls = Fp8Linear
elif type(module) == LinearKMaskedBias:
elif type(module) == LinearKMaskedBias: # noqa: E721
new_cls = Fp8LinearKMaskedBias
else:
assert False, str(type(module))
Expand Down
2 changes: 1 addition & 1 deletion dinov3/layers/sparse_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def replace(module: nn.Module, name: str) -> nn.Module:
nonlocal total_count
if not isinstance(module, nn.Linear) or not filter_fn(name):
return module
assert type(module) == nn.Linear, "Subtypes not supported"
assert type(module) == nn.Linear, "Subtypes not supported" # noqa: E721
new_module = LinearW24(
in_features=module.in_features,
out_features=module.out_features,
Expand Down