from skimage.feature import local_binary_pattern from numpy import linalg as la import base64 from src import detect_faces from PIL import Image import csv _lfw_landmarks = 'data/LFW.csv' _lfw_images = 'data/peopleDevTest.txt' _lfw_root = '/home/aaron/Datasets/database/' _lbpfaces_path = 'data/lbpfaces.npy' meanface_path = 'data/meanImage.npy' eigenVec_path = 'data/eigenVectors_new.npy' weightVec_path = 'data/weightVectors_updated.npy' args = test_args.get_args() PEOPLE_FOLDER = os.path.join('static', 'people_photo') ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg']) # initialize flask application app = Flask(__name__, template_folder='templates') app.config['UPLOAD_FOLDER'] = PEOPLE_FOLDER app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 0 frameCount = 0 fileName = "" filePath = "" def get_landmarks(image):
from arguments.test_args import get_args import torch from models import net_resolution if __name__ == '__main__': args = get_args() weights = torch.load(args.srnet_pth) model = net_resolution.get_model() model.load_state_dict(weights['net']) print(weights)