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
  • 17:20 (UTC -04:00)
  • X @patelkvin04
View GitHub Profile
@KevinPatel04
KevinPatel04 / MATLAB.md
Created March 21, 2020 18:18
MATLAB CHEAT SHEET

MATLAB Cheatsheets for Image Processing

  • Read Image File
  
  %%
  % replace `PATH_TO_IMAGE` with actual image file path
  %
 impath = 'PATH_TO_IMAGE';
@KevinPatel04
KevinPatel04 / navie-bayes-latest-news-classifier.ipynb
Last active March 27, 2020 17:08
This project can be used to classify the given news into 20 different predefined categories like religion, space, sci-fy, sports, computer, etc using Navie Bayes Classifier algorithm.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Creating Branch and Commit on GitHub using Vs Code

  • Download Git on your PC from Here.
  • Open the Terminal and follow the following steps:
import argparse
import datetime
import imutils
import math
import cv2
import numpy as np
width = 800
textIn = 0
textOut = 0
@KevinPatel04
KevinPatel04 / check-dlib-fr.py
Last active April 26, 2020 08:50
For Environment Setup
# import libraries here
import dlib
import face_recognition
# print the version of library
print(dlib.__version__)
print(face_recognition.__version__)
@KevinPatel04
KevinPatel04 / cnn.py
Last active April 20, 2020 12:08
Face Detection Image Blog
# import required packages
import dlib
import cv2
# only for google colab
# from google.colab.patches import cv2_imshow
# load the image to be detected
image = cv2.imread('images/modi-obama-1.jpg')
@KevinPatel04
KevinPatel04 / cnn-realtime.py
Last active April 20, 2020 12:17
Real time Face Detection Blog
# import required packages
import dlib
import cv2
# only for google colab
# from google.colab.patches import cv2_imshow
# for using your inbuilt webcam
# Get the webcam #0 ( the default one, 1, 2 and so on)
# video_stream = cv2.VideoCapture(0)
@KevinPatel04
KevinPatel04 / blur-face-from-image.py
Last active April 26, 2020 17:25
Face Blurring Blog
# load the image to be detected
image = cv2.imread('test/family.jpg')
# find all face locations using face_locations() function
# model can be "cnn" or "hog"
# number_of_times_to_upsample = 1 higher and detect more smaller faces from the image
all_face_locations = face_recognition.face_locations(image, model="hog")
#printing the number of faces in the array
print("There are {} face(s) in this image".format(len(all_face_locations)))
@KevinPatel04
KevinPatel04 / dir-tree.md
Last active April 26, 2020 11:57
Face Expression Recognition Blog
•
├── test
│   ├── modi-obama-1.jpg
│   ├── modi-obama-2.jpg
│   └── face-demographics-walking.mp4
├── models
│   ├── facial_expression_model_weights.h5
│   └── facial_expression_model_structure.json
├── facial-expression-recognition-from-image.py
@KevinPatel04
KevinPatel04 / face-expression-recognition.py
Last active April 26, 2020 11:58
Real time Face Recognition 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