summaryrefslogtreecommitdiff
path: root/megapixels/app/processors/face_beauty.py
diff options
context:
space:
mode:
Diffstat (limited to 'megapixels/app/processors/face_beauty.py')
-rw-r--r--megapixels/app/processors/face_beauty.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/megapixels/app/processors/face_beauty.py b/megapixels/app/processors/face_beauty.py
index 2e8221b7..a01c6834 100644
--- a/megapixels/app/processors/face_beauty.py
+++ b/megapixels/app/processors/face_beauty.py
@@ -9,12 +9,10 @@ import numpy as np
import imutils
import pickle
-os.environ['CUDA_VISIBLE_DEVICES'] = ''
import keras
from keras.layers import Conv2D, Input, MaxPool2D,Flatten, Dense, Permute, GlobalAveragePooling2D
from keras.models import Model
from keras.optimizers import adam
-import os.path
from keras.models import Sequential
from keras.applications.resnet50 import ResNet50
#from keras.applications.resnet50 import Dense
@@ -33,7 +31,9 @@ class FaceBeauty:
# Estimates beauty using CNN
- def __init__(self, gpu=-1):
+ def __init__(self):
+ # ensure Keras uses CPU (no GPU, it takes up all memory)
+ os.environ['CUDA_VISIBLE_DEVICES'] = ''
# don't really need GPU, CPU is quick enough
self.log = logger_utils.Logger.getLogger()
resnet = ResNet50(include_top=False, pooling='avg')