master 66c562fc6c51 cached
3 files
1.5 KB
506 tokens
1 requests
Download .txt
Repository: italojs/facial-landmarks-recognition
Branch: master
Commit: 66c562fc6c51
Files: 3
Total size: 1.5 KB

Directory structure:
gitextract_d540hd6z/

├── README.md
├── main.py
└── requirements.txt

================================================
FILE CONTENTS
================================================

================================================
FILE: README.md
================================================
## facial landmarks recognition 

![My Face](https://i.imgur.com/7IIOka9.png)

### Dependencies 
`pip install -r .\requirements.txt`

### Run
`python main.py`

================================================
FILE: main.py
================================================
# import the necessary packages
from imutils import face_utils
import dlib
import cv2
 
# initialize dlib's face detector (HOG-based) and then create
# the facial landmark predictor
p = "shape_predictor_68_face_landmarks.dat"
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor(p)

cap = cv2.VideoCapture(0)
 
while True:
    # load the input image and convert it to grayscale
    _, image = cap.read()
    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
        
    # detect faces in the grayscale image
    rects = detector(gray, 0)
    
    # loop over the face detections
    for (i, rect) in enumerate(rects):
        # determine the facial landmarks for the face region, then
        # convert the facial landmark (x, y)-coordinates to a NumPy
        # array
        shape = predictor(gray, rect)
        shape = face_utils.shape_to_np(shape)
    
        # loop over the (x, y)-coordinates for the facial landmarks
        # and draw them on the image
        for (x, y) in shape:
            cv2.circle(image, (x, y), 2, (0, 255, 0), -1)
    
    # show the output image with the face detections + facial landmarks
    cv2.imshow("Output", image)
    k = cv2.waitKey(5) & 0xFF
    if k == 27:
        break

cv2.destroyAllWindows()
cap.release()


================================================
FILE: requirements.txt
================================================
opencv-python==4.7.0.72
imutils==0.5.4
dlib==19.24.0
Download .txt
gitextract_d540hd6z/

├── README.md
├── main.py
└── requirements.txt
Condensed preview — 3 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2K chars).
[
  {
    "path": "README.md",
    "chars": 158,
    "preview": "## facial landmarks recognition \n\n![My Face](https://i.imgur.com/7IIOka9.png)\n\n### Dependencies \n`pip install -r .\\requi"
  },
  {
    "path": "main.py",
    "chars": 1280,
    "preview": "# import the necessary packages\nfrom imutils import face_utils\nimport dlib\nimport cv2\n \n# initialize dlib's face detecto"
  },
  {
    "path": "requirements.txt",
    "chars": 52,
    "preview": "opencv-python==4.7.0.72\nimutils==0.5.4\ndlib==19.24.0"
  }
]

About this extraction

This page contains the full source code of the italojs/facial-landmarks-recognition GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 3 files (1.5 KB), approximately 506 tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!