Skip to content

Commit

Permalink
fix: fix mypy errors
Browse files Browse the repository at this point in the history
Due to renaming HEAD to head, mypy and git believes the two names exist at the sametime. Delete them first and stage the delete action fixes the problem.
  • Loading branch information
LutingWang committed Feb 17, 2023
1 parent 9843ac0 commit 60cf057
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 40 deletions.
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ repos:
rev: v1.0.0
hooks:
- id: mypy
args:
- --no-incremental
additional_dependencies:
- todd_ai
- repo: https://github.com/codespell-project/codespell
Expand Down
9 changes: 0 additions & 9 deletions configs/HEAD/HEAD_retina_faster_mnv2_fpn_mstrain_1x_coco.py

This file was deleted.

9 changes: 0 additions & 9 deletions configs/HEAD/head_retina_faster_r18_fpn_mstrain_1x_coco.py

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion head/prior_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def single_level_grid_priors(
dtype: torch.dtype = torch.float32,
device: Union[str, torch.device] = 'cuda',
) -> torch.Tensor:
priors = super().single_level_grid_priors(
priors = super().single_level_grid_priors( # type: ignore[safe-super]
featmap_size,
level_idx,
dtype,
Expand Down
6 changes: 3 additions & 3 deletions head/roi_heads.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Dict, List, Optional
from typing import Any, Dict, List, Optional, Sequence

import torch
from mmdet.core import BaseAssigner
Expand All @@ -19,7 +19,7 @@ def _sample(
proposal_list: List[torch.Tensor],
gt_bboxes: List[torch.Tensor],
gt_labels: List[torch.Tensor],
gt_bboxes_ignore: List[Optional[torch.Tensor]],
gt_bboxes_ignore: Sequence[Optional[torch.Tensor]],
):
sampling_results: List[SamplingResultWithBBoxIDs] = []
for i, (proposal, gt_bbox, gt_label, gt_bbox_ignore) in enumerate(
Expand Down Expand Up @@ -71,7 +71,7 @@ def forward_train(
proposal_list: List[torch.Tensor],
gt_bboxes: List[torch.Tensor],
gt_labels: List[torch.Tensor],
gt_bboxes_ignore: Optional[List[torch.Tensor]] = None,
gt_bboxes_ignore: Optional[Sequence[Optional[torch.Tensor]]] = None,
gt_masks: Optional[List[Any]] = None,
**kwargs,
):
Expand Down
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,14 @@ files = [
'head',
]

[[tool.mypy.overrides]]
module = [
'mmcv.*',
'mmdet.*',
'todd.*',
]
ignore_missing_imports = true


[tool.commitizen]
name = 'cz_conventional_commits'

0 comments on commit 60cf057

Please sign in to comment.