Skip to content

Commit c29e1f9

Browse files
committed
make linter happy
1 parent f9b386b commit c29e1f9

File tree

5 files changed

+332
-312
lines changed

5 files changed

+332
-312
lines changed

demo.ipynb

Lines changed: 4 additions & 300 deletions
Large diffs are not rendered by default.

examples/demo.ipynb

Lines changed: 316 additions & 0 deletions
Large diffs are not rendered by default.

face_alignment/detection/blazeface/net_blazeface.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ def forward(self, x):
4545
class BlazeFace(nn.Module):
4646
"""The BlazeFace face detection model from MediaPipe.
4747
48-
The version from MediaPipe is simpler than the one in the paper;
48+
The version from MediaPipe is simpler than the one in the paper;
4949
it does not use the "double" BlazeBlocks.
5050
5151
Because we won't be training this model, it doesn't need to have
52-
batchnorm layers. These have already been "folded" into the conv
52+
batchnorm layers. These have already been "folded" into the conv
5353
weights by TFLite.
5454
55-
The conversion to PyTorch is fairly straightforward, but there are
55+
The conversion to PyTorch is fairly straightforward, but there are
5656
some small differences between TFLite and PyTorch in how they handle
5757
padding on conv layers with stride 2.
5858
@@ -179,7 +179,7 @@ def predict_on_image(self, img):
179179
180180
Arguments:
181181
img: a NumPy array of shape (H, W, 3) or a PyTorch tensor of
182-
shape (3, H, W). The image's height and width should be
182+
shape (3, H, W). The image's height and width should be
183183
128 pixels.
184184
185185
Returns:
@@ -198,7 +198,7 @@ def predict_on_batch(self, x):
198198
shape (b, 3, H, W). The height and width should be 128 pixels.
199199
200200
Returns:
201-
A list containing a tensor of face detections for each image in
201+
A list containing a tensor of face detections for each image in
202202
the batch. If no faces are found for an image, returns a tensor
203203
of shape (0, 17).
204204
@@ -237,7 +237,7 @@ def predict_on_batch(self, x):
237237

238238
def _tensors_to_detections(self, raw_box_tensor, raw_score_tensor, anchors):
239239
"""The output of the neural network is a tensor of shape (b, 896, 16)
240-
containing the bounding box regressor predictions, as well as a tensor
240+
containing the bounding box regressor predictions, as well as a tensor
241241
of shape (b, 896, 1) with the classification confidences.
242242
243243
This function converts these two "raw" tensors into proper detections.
@@ -404,10 +404,10 @@ def jaccard(box_a, box_b):
404404
jaccard overlap: (tensor) Shape: [box_a.size(0), box_b.size(0)]
405405
"""
406406
inter = intersect(box_a, box_b)
407-
area_a = ((box_a[:, 2] - box_a[:, 0]) *
408-
(box_a[:, 3] - box_a[:, 1])).unsqueeze(1).expand_as(inter) # [A,B]
409-
area_b = ((box_b[:, 2] - box_b[:, 0]) *
410-
(box_b[:, 3] - box_b[:, 1])).unsqueeze(0).expand_as(inter) # [A,B]
407+
area_a = ((box_a[:, 2] - box_a[:, 0])
408+
* (box_a[:, 3] - box_a[:, 1])).unsqueeze(1).expand_as(inter) # [A,B]
409+
area_b = ((box_b[:, 2] - box_b[:, 0])
410+
* (box_b[:, 3] - box_b[:, 1])).unsqueeze(0).expand_as(inter) # [A,B]
411411
union = area_a + area_b - inter
412412
return inter / union # [A,B]
413413

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.0.1
2+
current_version = 1.1.0
33
commit = True
44
tag = True
55

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[flake8]
22
max-line-length = 120
3-
ignore = E305,E402,E721,F401,F403,F405,F821,F841,F999
3+
ignore = E305,E402,E721,F401,F403,F405,F821,F841,F999,W503

0 commit comments

Comments
 (0)