Skip to content

Instantly share code, notes, and snippets.

View shravankumar147's full-sized avatar
🎯
Focusing

Shravankumar shravankumar147

🎯
Focusing
View GitHub Profile
@shravankumar147
shravankumar147 / spam_filter.ipynb
Last active August 4, 2017 06:51
Spam Filtering
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shravankumar147
shravankumar147 / face_detection.py
Last active September 1, 2022 09:27
Face Detection using dlib and opencv. It detects even multi-faces.
# USAGE
# python face_detection.py --image face1.jpg
# import the necessary packages
# from imutils import face_utils
# import numpy as np
import argparse
import imutils
import dlib
import cv2
@shravankumar147
shravankumar147 / my_vimrc
Last active October 11, 2017 06:46
vimrc_for_python
set nocompatible " be iMproved, required
filetype off " required
set exrc
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" ==== PLUGINS ====
Plugin 'VundleVim/Vundle.vim'
Plugin 'vim-scripts/L9'
@shravankumar147
shravankumar147 / postsname_generator.py
Created October 14, 2017 07:08
jekyll post name generator for github project pages
from datetime import datetime
def post_name(name):
"""
This will generate your github post name.
example:
@shravankumar147
shravankumar147 / simple_mlp_tensorflow.py
Created December 1, 2017 01:51 — forked from vinhkhuc/simple_mlp_tensorflow.py
Simple Feedforward Neural Network using TensorFlow
# Implementation of a simple MLP network with one hidden layer. Tested on the iris data set.
# Requires: numpy, sklearn>=0.18.1, tensorflow>=1.0
# NOTE: In order to make the code simple, we rewrite x * W_1 + b_1 = x' * W_1'
# where x' = [x | 1] and W_1' is the matrix W_1 appended with a new row with elements b_1's.
# Similarly, for h * W_2 + b_2
import tensorflow as tf
import numpy as np
from sklearn import datasets
from sklearn.model_selection import train_test_split
@shravankumar147
shravankumar147 / categorical_to_integer_mapping.py
Created December 4, 2017 13:57
Convert categorical label to integers
iris["Species"] = iris["Species"].map({"Iris-setosa":0,"Iris-virginica":1,"Iris-versicolor":2})
@shravankumar147
shravankumar147 / MNIST on Colaboratory using GPU.ipynb
Created January 21, 2018 13:38
MNIST on Colaboratory using GPU
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shravankumar147
shravankumar147 / get_audio.py
Created March 20, 2018 18:24
Extract audio from online video files
import pafy
from pydub import AudioSegment
import argparse
# construct the argument parser and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-u", "--url", required=True, help="download link")
args = vars(ap.parse_args())
@shravankumar147
shravankumar147 / file_download_os.py
Created March 20, 2018 18:31
File download using different methods
import os
cmd = "wget -c --progress=bar https://docs.microsoft.com/en-us/azure/cognitive-services/face/images/landmarks.1.jpg"
os.system(cmd)
@shravankumar147
shravankumar147 / build_face_dataset.py
Created June 28, 2018 03:32 — forked from machinelearning147/build_face_dataset.py
build_face_dataset using webcam
# USAGE
# python build_face_dataset.py --cascade haarcascade_frontalface_default.xml --output dataset/adrian
# import the necessary packages
from imutils.video import VideoStream
import argparse
import imutils
import time
import cv2
import os