Skip to content

Instantly share code, notes, and snippets.

View KevinPatel04's full-sized avatar

Kevin Patel KevinPatel04

  • New York University
  • New York, NY, USA
  • 15:27 (UTC -04:00)
  • X @patelkvin04
View GitHub Profile
@KevinPatel04
KevinPatel04 / predictive-maintenance-for-a-water-pump.ipynb
Created November 24, 2020 09:58
Predictive Maintenance for a Water Pump.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@KevinPatel04
KevinPatel04 / after-channel-shift.py
Last active July 11, 2020 10:21
Data Augmentation
# find the mean of the pixels
x.mean()
@KevinPatel04
KevinPatel04 / dir-tree.md
Last active April 26, 2020 18:15
Face Makeup
•
├── images
│   ├── test-1.jpg
│   └── test-2.jpg
└── face-makeup-on-image.py
@KevinPatel04
KevinPatel04 / detect-faces.py
Last active April 22, 2020 17:46
Detect & Mark Face Landmarks Blog
# detect face from image using cnn_face_detector
all_face_locations = cnn_face_detector(face_image, 1)
@KevinPatel04
KevinPatel04 / calculate-distance-between-faces.py
Last active April 15, 2020 13:46
Measure Distance Between Two Images Blog
# importing required libraries
import cv2
import face_recognition
import os
import numpy as np
# initialize the empty list of name label
known_face_names = []
# initialize the empty list for storing the encoding of each face
@KevinPatel04
KevinPatel04 / dir-tree.md
Last active April 27, 2020 11:53
Real time Face Recognition Blog
•
├── training-images
│   ├── Barack Obama.jpg
│   ├── Narendra Modi.jpg
│   ├── Boris Johnson.jpg
│   ├── Donald Trump.jpg
│   └── Justin Trudeau.jpg
├── models
│ ├── mmod_human_face_detector.dat
@KevinPatel04
KevinPatel04 / compare-face-encodings.py
Last active April 27, 2020 12:08
Face Recognition From Image Blog
# TOLERANCE defines the tolerance for face comparisons
# The lower the number - the stricter the comparison
# To avoid false matches, use lower value
# To avoid false negatives (i.e. faces of the same person doesn't match), use higher value
# 0.5-0.6 works well
TOLERANCE = 0.50
# This function returns the name of the person whose image matches with the given face (or 'Unknown Face')
# face_encoding is the face encoding of the face we are looking for
def find_match(face_encoding):
@KevinPatel04
KevinPatel04 / age-prediction.py
Last active April 26, 2020 10:02
Real time Age Prediction Blog
# capture the video from default camera
# video_stream = cv2.VideoCapture(0)
# read video from video file
video_file_path = 'test/face-demographics-walking.mp4'
video_stream = cv2.VideoCapture(video_file_path)
# initialize the number of frame needed to be skipped
skip = 0
@KevinPatel04
KevinPatel04 / import-libraries.py
Last active April 26, 2020 09:40
Age Prediction Blog
# importing required libraries
import cv2
import numpy as np
from keras.preprocessing import image
from keras.models import model_from_json
import face_recognition
# only for google colab
# from google.colab.patches import cv2_imshow
@KevinPatel04
KevinPatel04 / import-libraries.py
Last active April 26, 2020 11:01
Realtime Gender Prediction using Face
# importing required libraries
import cv2
import numpy as np
from keras.preprocessing import image
from keras.models import model_from_json
import face_recognition
# only for google colab
# from google.colab.patches import cv2_imshow