<jupyter_start><jupyter_text>Make landmark points of Fer2013 dataset The CNN model that makes landmark is trained by [Face Images with Marked Landmark Points](https://www.kaggle.com/drgilermo/face-images-with-marked-landmark-points)  - Face_landmark_using_CNN.ipynb   FER-2013, https://www.kaggle.com/msambare/fer2013  0. Import Packages<jupyter_code>import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from PIL import Image
from tensorflow.keras.models import load_model
import os<jupyter_output><empty_output><jupyter_text>1. Load models<jupyter_code>model = load_model('landmark.h5')<jupyter_output><empty_output><jupyter_text>2. Load Fer2013 dataset<jupyter_code>label = 'surprise'  ## change
name = os.listdir('test/' + label)
name_len = np.shape(name)[0]
print(name_len)
name[0]
x_test = []
for i in range(name_len):
    img = Image.open('test/'+ label + '/' + name[i]).convert("L")
    img_resize = img.resize((96,96))  # resize
    img_resize = np.array(img_resize)
    img_resize = img_resize/255  # normalize
    x_test.append(img_resize)

x_test = np.array(x_test)
x_test = x_test.reshape((x_test.shape[0], x_test.shape[1], x_test.shape[2], 1))    
print(x_test.shape)<jupyter_output>(831, 96, 96, 1)<jupyter_text>3. Make predictions<jupyter_code>pred = model.predict(x_test)
pred.shape<jupyter_output><empty_output><jupyter_text>4. Test one sample<jupyter_code>index = 0  # change
plt.imshow(x_test[index,:,:], cmap='gray')
plt.scatter(pred[index,:][0:-1:2], pred[index,:][1::2], c ='b')  # divide x-coordinate and y-coordinate
plt.axis("off")
plt.show()<jupyter_output><empty_output><jupyter_text>5. Save landmark points<jupyter_code>name[0][:-4]  # cut '.jpg' string
for i in range(name_len):
    np.savetxt('land_mark/'+ label + '/' + name[i][:-4] +'.txt', pred[i])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15363586659376707, 'fraction_numerical': 0.028977583378895572, 'mean_word_length': 6.093023255813954, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '578038', 'license': 'MIT', 'n_tokens_mistral': 748, 'n_tokens_neox': 705, 'n_words': 128, 'path': 'Make_landmark_of_FER2013.ipynb', 'repo_name': 'OH-Seoyoung/Facial_Emotion_Recognition', 'size': '1829'}