[MYAI Studio SDK] Image-FaceNet-Jupyter

FaceNet can be applied to face grouping and face classification, and judge the similarity of faces through Euclidean distance, and then achieve face recognition.

[Instruction]

The solution process is:

Prepare images-> Train -> Face image inference.

Prepare images -> Face image grouping.

Prepare images -> Face image comparison.

1. 1_preprocess.ipynb

Extract face images from the images in data/image and data/image_test, scale them to 160x160 pixel, and save them in the data/image-160 and data/image_test folders.

Remarks:

The image of data/image is for training; the image of data/image_test is for testing.

The face image extracted by data/image_test will be additionally stored in data/clustering_image for use by 3_clustering.ipynb.

The images of each folder in data/image and data/image_test must be images of the same person.

The image file format must be .jpg or .png or .jpeg.

2. 2_classifier.ipynb

Training the face image classifier will be used in 5~8.

3. 3_clustering.ipynb

Prepare images -> Face image grouping.

Divide the images prepared at point 1 and the similar faces into one category, and save the results in the data/clustering_result folder.

4. 4_compare.ipynb

Prepare images -> Face image comparison.

Input six images, compare yourself with the other five images, and output the result matrix. The smaller the number, the more likely the face image is the same person.

5. 5_inference.ipynb

Input an image, classify it according to the classification model trained by 2_classifier.ipynb, and infer who the person in the image is.

Parameter Description:

input_image is the image path to be inferred.

input_pkl is the path of the classification model trained by 2_classifier.ipynb. It is not recommended to change the file location and name.

6. 6_inference_folder.ipynb

Enter the location of the image folder to be inferred, classify according to the classification model trained by 2_classifier.ipynb, and infer the person in the image in the folder.

Parameter Description:

input_image is the path of the image folder to be inferred.

input_pkl is the path of the classification model trained by 2_classifier.ipynb. It is not recommended to change the file location and name.

7. 7_inference_webcam.ipynb

Turn on the webcam and infer who the person photographed by the webcam is.

Parameter Description:

--deviceNumber 0 :0 refers to the webcam number used. If the user has more than one webcam, he can set it by himself.

8. 8_inference_api.ipynb

Use the webpage to select an image and infer who the person in the image is.

Parameter Description:

--port 8801: 8801 is the port occupied by the FaceNet webpage.

After running, if the port is not changed, you can use 9_inference_api_browser.ipynb to open the webpage.

FaceNet.png

This SDK is built in AppForAI - AI Dev Tools.

Purchase license separately: USD 600, permanent authorization, single APP authorization, single machine authorization, one-year activation, one-year download, one-year update, one-year email technical support.

Further Reading

1.
MYAI Studio for Windows

2.
MYAI Studio for Linux

3.
AI PC

Thanks for the support from our clients

National Taiwan University, National Tsing Hua University, National Yang Ming Chiao Tung University, National Cheng Kung University, Taipei Medical University, Kaohsiung Medical University, National Taipei University of Nursing and Health Sciences, China Medical University, National Chung Hsing University, National Central University, National Sun Yat-sen University, National Chung Cheng University, National Chi Nan University, National Chiayi University, National Ilan University, National Taipei University of Education, National United University, Tamkang University, Feng Chia University, Chang Gung University, I-Shou University, Shih Chien University, Tatung University, Chung Yuan Christian University, Soochow University, Tzu Chi University, Tzu Chi University of Science and Technology, National Taiwan University of Science and Technology, National Taipei University of Technology, National Taichung University of Science and Technology, National Yunlin University of Science and Technology, National Chin-Yi University of Technology, National Formosa University, National Pingtung University of Science and Technology, National Kaohsiung University of Science and Technology, Chaoyang University of Technology, Ming Chi University of Technology, Minghsin University of Science and Technology, Southern Taiwan University of Science and Technology, Asia Eastern University of Science and Technology, China University of Technology, National Taiwan Sport University, National Defense University, Republic of China Naval Academy, Republic of China Army Academy, Luodong Senior High School, Gushan Senior High School, Kaohsiung Girls Senior High School, National Taiwan University Hospital, National Cheng Kung University Hospital, Taipei Veterans General Hospital, Chang Gung Memorial Hospital, Tzu Chi Hospital, E-Da Hospital, Far Eastern Memorial Hospital, Lien Hsin International Hospital, National Chung-Shan Institute of Science and Technology, Armaments Bureau, Ministry of National Defense, Ministry of Justice Investigation Bureau, Industrial Technology Research Institute, Institute for Information Industry, Institute of Nuclear Energy Research, Atomic Energy Council, Endemic Species Research Institute, Council of Agriculture, Institute of Labor, Occupational Safety and Health, Ministry of Labor, Taiwan Textile Research Institute, Metal Industries Research & Development Centre, Taiwan Instrument Research Institute, Automotive Research & Testing Center, Chunghwa Telecom, Taiwan Water Corporation, Taiwan Semiconductor Manufacturing Company, United Microelectronics Corporation, Nanya Technology Corporation, Winbond Electronics Corporation, Wafer Works Corporation, Grandtop Optoelectronics, AU Optronics, Innolux Corporation, HannStar Display Corporation, Formosa Plastics Corporation, Formosa Petrochemical Corporation, Formosa Technologies Corporation, Nan Ya Plastics Corporation, Formosa Chemicals & Fibre Corporation, CPC Corporation, Taiwan, Logitech, Elan Microelectronics Corporation, Lextar Electronics Corporation, Darfon Electronics Corporation, Sercomm Corporation, EZconn Corporation, Foxconn Technology Group, WPG Holdings, World Peace Industrial Co., Ltd., Mirle Automation Corporation, Shuttle Machinery Co., Ltd., ChipMOS Technologies Inc., Simplo Technology Co., Ltd., Primax Electronics Ltd., Intesys Technology, Feng Hsin Iron & Steel Co., Ltd., China Ecotek Corporation, Zhu Sheng Technology, Advantech Co., Ltd., Stark Technology Inc., Hong Teng Technology, MiTAC International Corp., SYNNEX Technology International Corp., Allion Labs, Inc., Co-in International, Feng An Auto, Hong Hu International, Blue Ocean Intelligence, TOPPAN IDGATE Co., LTd., Far EasTone Telecommunications, SYSTEX Corporation, Cooler Master, Lion Travel, Beigang Wude Temple, Xiluo Fuxing Temple, etc.