Skip to content

Commit 00524eb

Browse files
Rabah Abdul KhalekRabah Abdul Khalek
authored andcommitted
pdm format
1 parent 7f751b3 commit 00524eb

File tree

5 files changed

+21
-12
lines changed

5 files changed

+21
-12
lines changed

‎examples/landmark_detection/features/ex1_draw_landmarks.ipynb‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"\n",
2020
"import torch\n",
2121
"from giskard_vision.landmark_detection.tests.performance import NMEMean, NMEs, Es, MEMean, MEStd, NMEMean, NMEStd\n",
22-
"from giskard_vision.landmark_detection.models.wrappers import OpenCVWrapper "
22+
"from giskard_vision.landmark_detection.models.wrappers import OpenCVWrapper"
2323
]
2424
},
2525
{
@@ -94,7 +94,9 @@
9494
},
9595
"outputs": [],
9696
"source": [
97-
"model = OpenCVWrapper() #FaceAlignmentWrapper(model=FaceAlignment(LandmarksType.TWO_D, device=\"cpu\", flip_input=False))"
97+
"model = (\n",
98+
" OpenCVWrapper()\n",
99+
") # FaceAlignmentWrapper(model=FaceAlignment(LandmarksType.TWO_D, device=\"cpu\", flip_input=False))"
98100
]
99101
},
100102
{

‎examples/landmark_detection/features/ex4_tests_and_metrics.ipynb‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@
9595
},
9696
"outputs": [],
9797
"source": [
98-
"model = OpenCVWrapper() # FaceAlignmentWrapper(model=FaceAlignment(LandmarksType.TWO_D, device=device, flip_input=False))"
98+
"model = (\n",
99+
" OpenCVWrapper()\n",
100+
") # FaceAlignmentWrapper(model=FaceAlignment(LandmarksType.TWO_D, device=device, flip_input=False))"
99101
]
100102
},
101103
{

‎examples/landmark_detection/report/master.ipynb‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@
7575
],
7676
"source": [
7777
"models = {\n",
78-
" \"FaceAlignment\": FaceAlignmentWrapper(model=FaceAlignment(LandmarksType.TWO_D, device=\"cpu\", flip_input=False, face_detector=\"blazeface\")),\n",
78+
" \"FaceAlignment\": FaceAlignmentWrapper(\n",
79+
" model=FaceAlignment(LandmarksType.TWO_D, device=\"cpu\", flip_input=False, face_detector=\"blazeface\")\n",
80+
" ),\n",
7981
" \"OpenCV\": OpenCVWrapper(),\n",
8082
"}\n",
8183
"# models.pop(\"FaceAlignment\") # takes a long time"

‎examples/landmark_detection/report/report.ipynb‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@
121121
],
122122
"source": [
123123
"models_list = [\n",
124-
" FaceAlignmentWrapper(model=FaceAlignment(LandmarksType.TWO_D, device=\"cpu\", flip_input=False, face_detector=\"blazeface\")),\n",
124+
" FaceAlignmentWrapper(\n",
125+
" model=FaceAlignment(LandmarksType.TWO_D, device=\"cpu\", flip_input=False, face_detector=\"blazeface\")\n",
126+
" ),\n",
125127
" OpenCVWrapper(),\n",
126128
"]\n",
127129
"\n",

‎giskard_vision/landmark_detection/tests/report.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from giskard_vision.landmark_detection.tests.performance import NMEMean
99
from giskard_vision.utils.errors import GiskardImportError
1010

11+
1112
class Report:
1213
"""
1314
A class for generating and managing test reports for landmark detection models.
@@ -27,7 +28,7 @@ def __init__(
2728
dataloaders: List[DataIteratorBase],
2829
metrics: Optional[List[Metric]] = None,
2930
dataloader_ref: Optional[DataIteratorBase] = None,
30-
rel_threshold: Optional[float] = None
31+
rel_threshold: Optional[float] = None,
3132
):
3233
"""
3334
Initializes a Report instance.
@@ -66,7 +67,7 @@ def to_dataframe(self):
6667
import pandas as pd
6768
except (ImportError, ModuleNotFoundError) as e:
6869
raise GiskardImportError(["pandas"]) from e
69-
70+
7071
# columns reordering
7172
df = pd.DataFrame(self.results)[
7273
[
@@ -81,8 +82,8 @@ def to_dataframe(self):
8182
"prediction_fail_rate",
8283
]
8384
].rename(columns={"dataloader": "criteria"})
84-
return df.sort_values(['criteria', 'model'], ignore_index=True)
85-
85+
return df.sort_values(["criteria", "model"], ignore_index=True)
86+
8687
def to_markdown(self, filename: Optional[str] = None):
8788
"""
8889
Writes the test results to a markdown file.
@@ -96,10 +97,10 @@ def to_markdown(self, filename: Optional[str] = None):
9697
except (ImportError, ModuleNotFoundError) as e:
9798
raise GiskardImportError(["tabulate"]) from e
9899
from datetime import datetime
99-
100+
100101
current_time = str(datetime.now()).replace(" ", "-")
101102
filename = f"report_{current_time}.md"
102-
103+
103104
df = self.to_dataframe()
104105
df.to_markdown(filename)
105106

@@ -115,7 +116,7 @@ def to_json(self, filename: Optional[str] = None):
115116

116117
if filename is None:
117118
from datetime import datetime
118-
119+
119120
current_time = str(datetime.now()).replace(" ", "-")
120121

121122
filename = f"report_{current_time}.md"

0 commit comments

Comments
 (0)