Skip to content

Commit

Permalink
Merge pull request #636 from exadel-inc/0.6.1-hotfix
Browse files Browse the repository at this point in the history
0.6.1 hotfix
  • Loading branch information
pospielov authored Oct 19, 2021
2 parents 580935b + 0c855a3 commit be2f907
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ email_from=
email_password=
enable_email_server=false
save_images_to_db=true
compreface_api_java_options=-Xmx8g
compreface_admin_java_options=-Xmx8g
compreface_api_java_options=-Xmx4g
compreface_admin_java_options=-Xmx1g
ADMIN_VERSION=0.6.1
API_VERSION=0.6.1
FE_VERSION=0.6.1
Expand Down
2 changes: 1 addition & 1 deletion dev/.env
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ email_password=
enable_email_server=false
save_images_to_db=true
compreface_api_java_options=-Xmx8g
compreface_admin_java_options=-Xmx8g
compreface_admin_java_options=-Xmx1g
ADMIN_VERSION=latest
API_VERSION=latest
FE_VERSION=latest
Expand Down
1 change: 1 addition & 0 deletions embedding-calculator/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ flasgger==0.9.5
Flask==1.1.2
gdown~=3.12
Werkzeug==1.0.1
PyYAML==5.4.1

# tests
mock~=4.0.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# or implied. See the License for the specific language governing
# permissions and limitations under the License.

requirements = ('tensorflow~=2.5.0','tf-slim~=1.1.0')
requirements = ('tensorflow~=2.1.4', 'tf-slim~=1.1.0')
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from src.services.utils.pyutils import get_env


def get_tensorflow(version='2.5.0') -> Tuple[str, ...]:
def get_tensorflow(version='2.1.4') -> Tuple[str, ...]:
libs = [f'tensorflow=={version}']
cuda_version = get_env('CUDA', '').replace('.', '')
if ENV.GPU_IDX > -1 and cuda_version:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import numpy as np
import tensorflow as tf2
from tensorflow.keras.models import load_model
from cached_property import cached_property

from src.services.imgtools.types import Array3D
Expand All @@ -30,27 +29,21 @@ class MaskDetector(base.BasePlugin):
slug = 'mask'
LABELS = ('without_mask', 'with_mask', 'mask_weared_incorrect')
ml_models = (
('inception_v3_on_mafa_kaggle123', '1jm2Wd2JEZxhS8O1JjV-kfBOyOYUMxKHq'),
('mobilenet_v2_on_mafa_kaggle123', '1-eqivfTVaXC_9Z5INbYeFVEwBzzqIzm3')
('inception_v3_on_mafa_kaggle123', '1nhmv4Pd8nnV8XHv6vlf6RCpwQLow78zS'),
)

@property
def input_image_size(self) -> Tuple[int, int]:
if self.ml_model_name == self.ml_models[1][0]:
return 128, 128
else:
return 100, 100
INPUT_IMAGE_SIZE = 100

@property
def retain_folder_structure(self) -> bool:
return True

@cached_property
def _model(self):
model = tf2.keras.models.load_model(self.ml_model.path)
model = tf2.keras.models.load_model(str(self.ml_model.path))

def get_value(img: Array3D) -> Tuple[Union[str, Tuple], float]:
img = cv2.resize(img, dsize=self.input_image_size,
img = cv2.resize(img, dsize=(self.INPUT_IMAGE_SIZE, self.INPUT_IMAGE_SIZE),
interpolation=cv2.INTER_CUBIC)
img = np.expand_dims(img, 0)

Expand Down

0 comments on commit be2f907

Please sign in to comment.