ในเคสนี้ เราจะสร้างโมเดลแบบ Regression คือ โมเดลที่ Output เป็นค่าต่อเนื่อง หมายถึง ให้ตอบเป็นค่าอะไรก็ได้ ในช่วงที่กำหนด สมมติว่า 0-5 ก็จะเป็นค่าอะไรก็ได้ เช่น 1.555555, 2.3456789, 0.0000000002865, 4.99999999999999 แต่ใน Dataset นี้คือ ตำแหน่งพิกัด x, y ของจุดศูนย์กลางของหัว

เปรียบเทียบกับใน ep ก่อน ๆ ที่เราสร้างโมเดลมา จะเป็นโมเดลแบบ Classification คือ ไม่ว่า Input จะเป็นรูปภาพ ข้อความ ข้อมูลตาราง ให้โมเดลจำแนกหมวดหมู่ Output ของโมเดล ก็จะถูกจำกัดอยู่ภายใน ตัวเลือก Class ที่เป็น Choice ที่เรากำหนดเท่านั้น เช่น “0”, “1”, “2”, “3”, “4” …, “9”, หมา, แมว, ป่าไม้, แม่น้ำ, แง่บวก, แง่ลบ, 1 ดาว, 2 ดาว, 3 ดาว…, 5 ดาว, รายได้เกิน 50k USD, รายได้ต่ำกว่า 50k USD

Dataset

เราจะใช้ชุดข้อมูล Biwi Kinect Head Pose Database จาก G. Fanelli, M. Dantone, J. Gall, A. Fossati and L. Van Gool, “Random Forests for Real Time 3D Face Analysis”, International Journal of Computer Vision (IJCV 2012)

ชุดข้อมูลนี้ประกอบด้วย รูปถ่าย ของบุคคล 20 คน (ชาย 14 หญิง 6 – มี 4 คน ที่ถ่ายซ้ำ) จำนวนรวม 15,000 รูป ทุกรูปมีขนาด 640×480 Pixel องศาก้มเงย +-60 องศา องศาหันซ้ายขวา +-75 องศา

Biwi Kinect Head Pose Database. Credit https://data.vision.ee.ethz.ch/cvl/gfanelli/head_pose/head_forest.html#db
Biwi Kinect Head Pose Database. Credit https://data.vision.ee.ethz.ch/cvl/gfanelli/head_pose/head_forest.html#db

เก็บข้อมูลโดยอุปกรณ์ Kinect สแกนภาพ 3 มิติ เพื่อเอามาประมาณค่าจุดกึ่งกลางศีรษะ ดังด่านล่าง

3D Biwi Kinect Head Pose Database. Credit https://data.vision.ee.ethz.ch/cvl/gfanelli/head_pose/head_forest.html#db
3D Biwi Kinect Head Pose Database. Credit https://data.vision.ee.ethz.ch/cvl/gfanelli/head_pose/head_forest.html#db

Ground Truth ที่ให้มา คือ ตำแหน่งพิกัด 3 มิติ และ องศา การหมุนของหัว 1. ก้มเงย 2. หันซ้ายขวา

โดย label ที่เรานำมาใช้ในเคสนี้ คือ ตำแหน่งพิกัด x, y ของจุดศูนย์กลางของหัว ของแต่ละภาพ

เรามาเริ่มกันเลย

Open In Colab

แชร์ให้เพื่อน:

Surapong Kanoktipsatharporn on FacebookSurapong Kanoktipsatharporn on LinkedinSurapong Kanoktipsatharporn on Rss
Surapong Kanoktipsatharporn
Solutions Architect at Bua Labs
The ultimate test of your knowledge is your capacity to convey it to another.

Published by Surapong Kanoktipsatharporn

The ultimate test of your knowledge is your capacity to convey it to another.