Skip to content

Commit 3ed42b5

Browse files
authored
Apply newer black (#154)
1 parent 66839d1 commit 3ed42b5

11 files changed

+48
-24
lines changed

model_api/python/openvino/model_api/adapters/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
limitations under the License.
1515
"""
1616

17-
1817
from .onnx_adapter import ONNXRuntimeAdapter
1918
from .openvino_adapter import OpenvinoAdapter, create_core, get_user_config
2019
from .ovms_adapter import OVMSAdapter

model_api/python/openvino/model_api/adapters/openvino_adapter.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,11 @@ def reshape_model(self, new_shape):
291291
new_shape = {
292292
name: PartialShape(
293293
[
294-
Dimension(dim)
295-
if not isinstance(dim, tuple)
296-
else Dimension(dim[0], dim[1])
294+
(
295+
Dimension(dim)
296+
if not isinstance(dim, tuple)
297+
else Dimension(dim[0], dim[1])
298+
)
297299
for dim in shape
298300
]
299301
)

model_api/python/openvino/model_api/models/detection_model.py

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
"""
16+
1617
from .image_model import ImageModel
1718
from .types import ListValue, NumericalValue, StringValue
1819
from .utils import load_labels

model_api/python/openvino/model_api/models/detr.py

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
"""
16+
1617
import numpy as np
1718

1819
from .detection_model import DetectionModel

model_api/python/openvino/model_api/models/faceboxes.py

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
"""
16+
1617
import itertools
1718
import math
1819

model_api/python/openvino/model_api/models/nanodet.py

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
"""
16+
1617
import math
1718

1819
import numpy as np

model_api/python/openvino/model_api/models/segmentation.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,11 @@ def postprocess(self, outputs, meta):
155155
return ImageResultWithSoftPrediction(
156156
hard_prediction,
157157
soft_prediction,
158-
_get_activation_map(soft_prediction)
159-
if _feature_vector_name in outputs
160-
else np.ndarray(0),
158+
(
159+
_get_activation_map(soft_prediction)
160+
if _feature_vector_name in outputs
161+
else np.ndarray(0)
162+
),
161163
outputs.get(_feature_vector_name, np.ndarray(0)),
162164
)
163165
return hard_prediction

model_api/python/openvino/model_api/models/ssd.py

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
"""
16+
1617
import numpy as np
1718

1819
from .detection_model import DetectionModel

model_api/python/openvino/model_api/models/ultra_lightweight_face_detection.py

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
"""
16+
1617
import numpy as np
1718

1819
from .detection_model import DetectionModel

model_api/python/openvino/model_api/performance_metrics.py

+32-16
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,18 @@ def paint_metrics(
102102

103103
def get_last(self):
104104
return (
105-
self.last_moving_statistic.latency / self.last_moving_statistic.frame_count
106-
if self.last_moving_statistic.frame_count != 0
107-
else None,
108-
self.last_moving_statistic.frame_count / self.last_moving_statistic.period
109-
if self.last_moving_statistic.period != 0.0
110-
else None,
105+
(
106+
self.last_moving_statistic.latency
107+
/ self.last_moving_statistic.frame_count
108+
if self.last_moving_statistic.frame_count != 0
109+
else None
110+
),
111+
(
112+
self.last_moving_statistic.frame_count
113+
/ self.last_moving_statistic.period
114+
if self.last_moving_statistic.period != 0.0
115+
else None
116+
),
111117
)
112118

113119
def get_total(self):
@@ -116,17 +122,27 @@ def get_total(self):
116122
)
117123
return (
118124
(
119-
(self.total_statistic.latency + self.current_moving_statistic.latency)
120-
/ frame_count
121-
)
122-
if frame_count != 0
123-
else None,
125+
(
126+
(
127+
self.total_statistic.latency
128+
+ self.current_moving_statistic.latency
129+
)
130+
/ frame_count
131+
)
132+
if frame_count != 0
133+
else None
134+
),
124135
(
125-
frame_count
126-
/ (self.total_statistic.period + self.current_moving_statistic.period)
127-
)
128-
if frame_count != 0
129-
else None,
136+
(
137+
frame_count
138+
/ (
139+
self.total_statistic.period
140+
+ self.current_moving_statistic.period
141+
)
142+
)
143+
if frame_count != 0
144+
else None
145+
),
130146
)
131147

132148
def get_latency(self):

model_api/python/openvino/model_api/tilers/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
limitations under the License.
1515
"""
1616

17-
1817
from .detection import DetectionTiler
1918
from .instance_segmentation import InstanceSegmentationTiler
2019
from .tiler import Tiler

0 commit comments

Comments
 (0)