Skip to content

Commit

Permalink
autopep8 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sadra-barikbin authored and github-actions[bot] committed May 17, 2023
1 parent 6bfe8c2 commit 0b5a6ce
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 10 deletions.
3 changes: 1 addition & 2 deletions ignite/metrics/mean_average_precision.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


class MeanAveragePrecision(_BasePrecisionRecall):

_tp: Dict[int, List[torch.Tensor]]
_fp: Dict[int, List[torch.Tensor]]
_scores: Union[Dict[int, List[torch.Tensor]], List[torch.Tensor]]
Expand Down Expand Up @@ -187,7 +186,7 @@ def reset(self) -> None:
def _check_binary_multilabel_cases(self, output: Sequence[torch.Tensor]) -> None:
# Ignore the check in `_BaseClassification` since `y_pred` consists of probabilities here.
_, y = output
if not torch.equal(y, y ** 2):
if not torch.equal(y, y**2):
raise ValueError("For binary cases, y must be comprised of 0's and 1's.")

def _check_type(self, output: Sequence[torch.Tensor]) -> None:
Expand Down
6 changes: 1 addition & 5 deletions ignite/metrics/vision/object_detection_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ class ObjectDetectionMAP(MeanAveragePrecision):
def __init__(
self,
iou_thresholds: Optional[Union[Sequence[float], torch.Tensor]] = None,
flavor: Optional[
Literal[
"COCO",
]
] = "COCO",
flavor: Optional[Literal["COCO",]] = "COCO",
rec_thresholds: Optional[Union[Sequence[float], torch.Tensor]] = None,
output_transform: Callable = lambda x: x,
device: Union[str, torch.device] = torch.device("cpu"),
Expand Down
1 change: 0 additions & 1 deletion tests/ignite/metrics/test_mean_average_precision.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ def sklearn_precision_recall_curve_allowing_multiple_recalls_at_single_threshold
],
)
def test__measure_recall_and_precision(allow_multiple_recalls_at_single_threshold, sklearn_pr_rec_curve):

# Classification
m = MeanAveragePrecision(allow_multiple_recalls_at_single_threshold=allow_multiple_recalls_at_single_threshold)

Expand Down
2 changes: 0 additions & 2 deletions tests/ignite/metrics/vision/test_object_detection_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,6 @@ def pycoco_mAP(
]
)
def sample(request) -> Sample:

data = coco_val2017_sample() if request.param[0] == "coco2017" else random_sample()
if request.param[1] == "with_an_empty_pred":
data[0][1] = {
Expand Down Expand Up @@ -802,7 +801,6 @@ def test_matching():


def test_compute(sample):

device = idist.device()
metric_50 = ObjectDetectionMAP(iou_thresholds=[0.5], device=device)
metric_75 = ObjectDetectionMAP(iou_thresholds=[0.75], device=device)
Expand Down

0 comments on commit 0b5a6ce

Please sign in to comment.