Skip to content

Commit

Permalink
mtcnn - Fix for torch
Browse files Browse the repository at this point in the history
  • Loading branch information
torzdf committed Mar 1, 2024
1 parent 4a78639 commit 739459a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions plugins/extract/detect/mtcnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import cv2
import numpy as np

from keras.layers import Conv2D, Dense, Flatten, Input, MaxPool2D, Permute, PReLU
from keras.layers import Conv2D, Dense, Flatten, Input, MaxPooling2D, Permute, PReLU

from lib.model.session import KSession
from ._base import BatchType, Detector
Expand Down Expand Up @@ -185,7 +185,7 @@ def model_definition() -> tuple[list[Tensor], list[Tensor]]:
input_ = Input(shape=(None, None, 3))
var_x = Conv2D(10, (3, 3), strides=1, padding='valid', name='conv1')(input_)
var_x = PReLU(shared_axes=[1, 2], name='PReLU1')(var_x)
var_x = MaxPool2D(pool_size=2)(var_x)
var_x = MaxPooling2D(pool_size=2)(var_x)
var_x = Conv2D(16, (3, 3), strides=1, padding='valid', name='conv2')(var_x)
var_x = PReLU(shared_axes=[1, 2], name='PReLU2')(var_x)
var_x = Conv2D(32, (3, 3), strides=1, padding='valid', name='conv3')(var_x)
Expand Down Expand Up @@ -351,11 +351,11 @@ def model_definition() -> tuple[list[Tensor], list[Tensor]]:
input_ = Input(shape=(24, 24, 3))
var_x = Conv2D(28, (3, 3), strides=1, padding='valid', name='conv1')(input_)
var_x = PReLU(shared_axes=[1, 2], name='prelu1')(var_x)
var_x = MaxPool2D(pool_size=3, strides=2, padding='same')(var_x)
var_x = MaxPooling2D(pool_size=3, strides=2, padding='same')(var_x)

var_x = Conv2D(48, (3, 3), strides=1, padding='valid', name='conv2')(var_x)
var_x = PReLU(shared_axes=[1, 2], name='prelu2')(var_x)
var_x = MaxPool2D(pool_size=3, strides=2)(var_x)
var_x = MaxPooling2D(pool_size=3, strides=2)(var_x)

var_x = Conv2D(64, (2, 2), strides=1, padding='valid', name='conv3')(var_x)
var_x = PReLU(shared_axes=[1, 2], name='prelu3')(var_x)
Expand Down Expand Up @@ -475,13 +475,13 @@ def model_definition() -> tuple[list[Tensor], list[Tensor]]:
input_ = Input(shape=(48, 48, 3))
var_x = Conv2D(32, (3, 3), strides=1, padding='valid', name='conv1')(input_)
var_x = PReLU(shared_axes=[1, 2], name='prelu1')(var_x)
var_x = MaxPool2D(pool_size=3, strides=2, padding='same')(var_x)
var_x = MaxPooling2D(pool_size=3, strides=2, padding='same')(var_x)
var_x = Conv2D(64, (3, 3), strides=1, padding='valid', name='conv2')(var_x)
var_x = PReLU(shared_axes=[1, 2], name='prelu2')(var_x)
var_x = MaxPool2D(pool_size=3, strides=2)(var_x)
var_x = MaxPooling2D(pool_size=3, strides=2)(var_x)
var_x = Conv2D(64, (3, 3), strides=1, padding='valid', name='conv3')(var_x)
var_x = PReLU(shared_axes=[1, 2], name='prelu3')(var_x)
var_x = MaxPool2D(pool_size=2)(var_x)
var_x = MaxPooling2D(pool_size=2)(var_x)
var_x = Conv2D(128, (2, 2), strides=1, padding='valid', name='conv4')(var_x)
var_x = PReLU(shared_axes=[1, 2], name='prelu4')(var_x)
var_x = Permute((3, 2, 1))(var_x)
Expand Down

0 comments on commit 739459a

Please sign in to comment.