<jupyter_start><jupyter_text>Colab 介紹 Colab 本身就是 jupter notebook + 一台免費 vm 的組合 (ubuntu)所有 linux 下的指令就是加一個 ! 來執行所以第一步驟就是可以安裝所需要的套件<jupyter_code># Install Package

!apt-get install -y cmake
!pip3 install face_recognition<jupyter_output>Reading package lists... Done
Building dependency tree       
Reading state information... Done
cmake is already the newest version (3.9.1-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Collecting face_recognition
  Using cached https://files.pythonhosted.org/packages/3f/ed/ad9a28042f373d4633fc8b49109b623597d6f193d3bbbef7780a5ee8eef2/face_recognition-1.2.3-py2.py3-none-any.whl
Requirement already satisfied: Click>=6.0 in /usr/local/lib/python3.6/dist-packages (from face_recognition) (7.0)
Requirement already satisfied: Pillow in /usr/local/lib/python3.6/dist-packages (from face_recognition) (4.0.0)
Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from face_recognition) (1.14.6)
Collecting dlib>=19.7 (from face_recognition)
  Using cached https://files.pythonhosted.org/packages/35/8d/e4ddf60452e2fb1ce3164f774e68968b3f110f1cb4cd353235d56875799e/dlib-19.16.0.tar.gz
Requirement already satisfied: face-recognition-models>=0.3.0 in /usr/loca[...]<jupyter_text>使用 face_recognitionhttps://github.com/ageitgey/face_recognition<jupyter_code>import face_recognition

import matplotlib.pyplot as plt
import matplotlib.image as mpimg


image_file='tenmax1.jpg'

img=mpimg.imread(image_file)
imgplot = plt.imshow(img)
plt.show()


image = face_recognition.load_image_file(image_file)
face_locations = face_recognition.face_locations(image)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10096735187424426, 'fraction_numerical': 0.07496977025392987, 'mean_word_length': 6.133620689655173, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 11, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '549545', 'license': 'Apache-2.0', 'n_tokens_mistral': 704, 'n_tokens_neox': 647, 'n_words': 115, 'path': 'kata-2-face_recognition/lab1_face_recognition.ipynb', 'repo_name': 'howie/Machine-Learning-by-Python-Kata-', 'size': '1654'}