Face Recognition สอน – ทำ Face Recognition ง่าย ๆ ไม่กี่คำสั่งใน Python ~ Python 3

July 22, 2022, 9:02 pm

ถ้าพูดถึง Face Recognition สมัยก่อนคงหนีไม่พ้นหนังสายลับ ที่มีมุกนี้มาตั้งแต่ไหนแต่ไร ตำรวจตามหาค้นร้ายผ่านกล้องจราจรด้วยการสแกนใบหน้า หรือหุ่นยนต์บินตามหาเหล่าตัวเอกรอบเมืองด้วยโดรนที่ค้นหาใบหน้าได้ และนี่คือปี 2018 ปีที่เทคโนโลยีหลายๆที่ดูเป็นเรื่องแต่งกลายเป็นเรื่องใกล้ตัวของเรา Face Recognition เป็นเทคโนโลยีนึงที่เริ่มถูกนำมาใช้กันอย่างแพร่หลาย สหรัฐฯกำลังทดลองใช้เพื่อจดจำใบหน้าในการถ่ายรูปใบหน้าของผู้โดยสารบนพาสปอร์ต จีนมี Skynet ช่วยตำรวจตามจับคนร้ายผ่านกล้องในเมือง พอได้เห็นข่าวพวกนี้ทำให้รู้สึกว่า ….

  1. Download
  2. Facial recognition วัดความสนในในชั้นเรียน – DailyGizmo
  3. Video
  4. AI ตรวจจับและรู้จำใบหน้าแบบพร้อมใช้งาน | Facial Recognition with Python - YouTube

Download

load_image_file("") # ไฟล์ต้นแบบ face_encoding = face_recognition. face_encodings(picture_of_Steve_Jobs)[0] # เข้ารหัสหน้าตา unknown_picture = face_recognition. load_image_file("") # ไฟล์ที่ต้องการตรวจสอบ unknown_face_encoding = face_recognition. face_encodings(unknown_picture)[0] # เข้ารหัสหน้าตา results = pare_faces([face_encoding], unknown_face_encoding) # ทำการเปรียบเทียบด้วย Face Recognition if results[0] == True: print("It's a picture of Steve Jobs! ") else: print("It's not a Steve Jobs! ") ผลลัพธ์ It's a picture of Steve Jobs! แสดงว่าไฟล์ เป็นรูปภาพของ Steve Jobs การทดลองทำ Face Recognition แบบง่าย ๆ ในภาษา Python ประสบความสำเร็จ

Facial recognition วัดความสนในในชั้นเรียน – DailyGizmo

  • Face recognition สอน code
  • ตอน FACE RECOGNITION NVR & CAMERA 9700 SERIES แนะนำการตั้งค่าและการใช้งาน - hiviewproduct
  • Cdc hermes ราคา picture
  • เพลง jack and jill
  • Face recognition สอน vs

3* และระดับ Authenticator Assurance Level (AAL) 2.

Video

VideoCapture ( r 'images/4', 0) เรียก face_recognition มาใช้งานหลังจากนั้นสร้าง Landmark ของใบหน้าไว้เป็น Array สำหรับวนหาใบหน้า หลังจากนั้นให้เราเขียนคำสั่งต่อไปนี้: while True: ret, frame = cap. read () rgb_frame = frame [:, :, :: - 1] face_locations = face_recognition. face_locations ( rgb_frame) for top, right, bottom, left in face_locations: cv2. rectangle ( frame, ( left, top), ( right, bottom), ( 0, 255, 0), 4) frame = cv2. resize ( frame, ( 600, 340)) cv2. imshow ( 'Video', frame) การทำงานคือ จับ Frame ของ Video ทีละ Frame โดย ret, frame = cap. read () หลังจากนั้นแปลงภาพจาก Frame ที่เป็น OpenCV ประมวลผลแบบ BGR Color ให้เป็น RGB rgb_frame = frame [:, :, :: - 1] ในแต่ละ Frame จะทำการค้นหาใบหน้าทั้งหมดที่ปรากฏในภาพ Frame face_locations = face_recognition. face_locations ( rgb_frame) ทำการวาดสี่เหลี่ยมสีเขียวลงบนหน้าที่ตรวจจับได้: for top, right, bottom, left in face_locations: cv2. rectangle ( frame, ( left, top), ( right, bottom), ( 0, 255, 0), 4) ทำการย่อขนาดของหน้าต่าง video ตัว output แล้วแสดงผลลัพธ์ออกมา frame = cv2.

imshow ( 'Video', frame) เขียนคำสั่งด Enter แล้วปิดหน้าต่าง: if cv2. waitKey ( 25) == 13: break และสุดท้ายถ้าประมวลผลเสร็จสิ้นให้ทิ้ง Task ที่กำลังทำงานอยู่ออกไปให้หมด cap. release () cv2. destroyAllWindows () จะเห็นว่าไฟล์ Python ของเราจะเป็นดังนี้ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 import cv2 import face_recognition cap = cv2. VideoCapture ( r 'images/4', 0) face_locations = [] while True: ret, frame = cap. imshow ( 'Video', frame) if cv2. waitKey ( 25) == 13: break cap. destroyAllWindows () ทดสอบก็จะได้ผลลัพธ์ตามนี้: ทีนี้ลองเอา ระบบ Face Reconition มาใช้แต่ต้องเปลี่ยนวีดีโอเล็กน้อยที่คมชัดเพราะวีดีโอข้างต้นมันขึ้น Unknown หมดเลยทุกคน ใส่ code นี้ไปเลย: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 import cv2 import face_recognition cap = cv2. VideoCapture ( r 'images/4', 0) database_image = face_recognition. load_image_file ( "images/") data_base_encoding = face_recognition. face_encodings ( database_image) [ 0] person_face_encodings = [ data_base_encoding] person_face_names = [ "BANYAPON"] data_locations = [] data_encodings = [] data_names = [] frameProcess = True while True: ret, frame = cap.

AI ตรวจจับและรู้จำใบหน้าแบบพร้อมใช้งาน | Facial Recognition with Python - YouTube

Face Recognition ด้วย OpenCV + DLIB บน Python - YouTube

face_landmarks(image) เมื่อ?

  1. โคโค่ hololive
  2. ทารก 8 เดือน กิน ข้าว กี่ มื้อ