Skip to content

Commit 3ae87e7

Browse files
committed
linting bug resolved
1 parent 88b5580 commit 3ae87e7

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

retinaface/RetinaFace.py

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def build_model() -> Any:
5555
input_signature=(tf.TensorSpec(shape=[None, None, None, 3], dtype=np.float32),),
5656
)
5757

58+
# pylint: disable=possibly-used-before-assignment
5859
return model
5960

6061

retinaface/commons/postprocess.py

-11
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@
66
import numpy as np
77
from PIL import Image
88
import cv2
9-
import tensorflow as tf
10-
11-
tf_major_version = int(tf.__version__.split(".", maxsplit=1)[0])
12-
if tf_major_version == 1:
13-
from keras.preprocessing import image
14-
else:
15-
from tensorflow.keras.preprocessing import image
16-
179

1810
# pylint: disable=unused-argument
1911

@@ -197,9 +189,6 @@ def resize_image(
197189
if img.shape[0:2] != target_size:
198190
img = cv2.resize(img, target_size)
199191

200-
# make it 4-dimensional how ML models expect
201-
img = image.img_to_array(img)
202-
203192
if min_max_norm is True and img.max() > 1:
204193
img = (img.astype(np.float32) / 255.0).astype(np.float32)
205194

0 commit comments

Comments
 (0)