make linter happy

Esse commit está contido em:
Adrian Bulat
2020-07-31 16:50:26 +01:00
commit c29e1f94c1
5 arquivos alterados com 332 adições e 312 exclusões
+4 -300
Ver Arquivo
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
@@ -45,14 +45,14 @@ class BlazeBlock(nn.Module):
class BlazeFace(nn.Module):
"""The BlazeFace face detection model from MediaPipe.
The version from MediaPipe is simpler than the one in the paper;
The version from MediaPipe is simpler than the one in the paper;
it does not use the "double" BlazeBlocks.
Because we won't be training this model, it doesn't need to have
batchnorm layers. These have already been "folded" into the conv
batchnorm layers. These have already been "folded" into the conv
weights by TFLite.
The conversion to PyTorch is fairly straightforward, but there are
The conversion to PyTorch is fairly straightforward, but there are
some small differences between TFLite and PyTorch in how they handle
padding on conv layers with stride 2.
@@ -179,7 +179,7 @@ class BlazeFace(nn.Module):
Arguments:
img: a NumPy array of shape (H, W, 3) or a PyTorch tensor of
shape (3, H, W). The image's height and width should be
shape (3, H, W). The image's height and width should be
128 pixels.
Returns:
@@ -198,7 +198,7 @@ class BlazeFace(nn.Module):
shape (b, 3, H, W). The height and width should be 128 pixels.
Returns:
A list containing a tensor of face detections for each image in
A list containing a tensor of face detections for each image in
the batch. If no faces are found for an image, returns a tensor
of shape (0, 17).
@@ -237,7 +237,7 @@ class BlazeFace(nn.Module):
def _tensors_to_detections(self, raw_box_tensor, raw_score_tensor, anchors):
"""The output of the neural network is a tensor of shape (b, 896, 16)
containing the bounding box regressor predictions, as well as a tensor
containing the bounding box regressor predictions, as well as a tensor
of shape (b, 896, 1) with the classification confidences.
This function converts these two "raw" tensors into proper detections.
@@ -404,10 +404,10 @@ def jaccard(box_a, box_b):
jaccard overlap: (tensor) Shape: [box_a.size(0), box_b.size(0)]
"""
inter = intersect(box_a, box_b)
area_a = ((box_a[:, 2] - box_a[:, 0]) *
(box_a[:, 3] - box_a[:, 1])).unsqueeze(1).expand_as(inter) # [A,B]
area_b = ((box_b[:, 2] - box_b[:, 0]) *
(box_b[:, 3] - box_b[:, 1])).unsqueeze(0).expand_as(inter) # [A,B]
area_a = ((box_a[:, 2] - box_a[:, 0])
* (box_a[:, 3] - box_a[:, 1])).unsqueeze(1).expand_as(inter) # [A,B]
area_b = ((box_b[:, 2] - box_b[:, 0])
* (box_b[:, 3] - box_b[:, 1])).unsqueeze(0).expand_as(inter) # [A,B]
union = area_a + area_b - inter
return inter / union # [A,B]
+1 -1
Ver Arquivo
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.0.1
current_version = 1.1.0
commit = True
tag = True
+1 -1
Ver Arquivo
@@ -1,3 +1,3 @@
[flake8]
max-line-length = 120
ignore = E305,E402,E721,F401,F403,F405,F821,F841,F999
ignore = E305,E402,E721,F401,F403,F405,F821,F841,F999,W503