Skip to content

Instantly share code, notes, and snippets.

View machinelearning147's full-sized avatar
🎯
Focusing

Machine Learning AI machinelearning147

🎯
Focusing
View GitHub Profile
@machinelearning147
machinelearning147 / build_face_dataset.py
Created June 16, 2018 18:26
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
@machinelearning147
machinelearning147 / min-char-rnn.py
Created June 19, 2018 02:42 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@machinelearning147
machinelearning147 / mnist_estimator.py
Created July 3, 2018 18:39 — forked from shravankumar147/mnist_estimator.py
Example using TensorFlow Estimator, Experiment & Dataset on MNIST data.
"""Script to illustrate usage of tf.estimator.Estimator in TF v1.3"""
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data as mnist_data
from tensorflow.contrib import slim
from tensorflow.contrib.learn import ModeKeys
from tensorflow.contrib.learn import learn_runner
# Show debugging output
@machinelearning147
machinelearning147 / np_to_tfrecords.py
Created August 12, 2018 18:55 — forked from swyoon/np_to_tfrecords.py
From numpy ndarray to tfrecords
import numpy as np
import tensorflow as tf
__author__ = "Sangwoong Yoon"
def np_to_tfrecords(X, Y, file_path_prefix, verbose=True):
"""
Converts a Numpy array (or two Numpy arrays) into a tfrecord file.
For supervised learning, feed training inputs to X and training labels to Y.
For unsupervised learning, only feed training inputs to X, and feed None to Y.
import cv2
import matplotlib.pyplot as plt
import numpy as np
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
webcam=cv2.VideoCapture(1)
cv2.namedWindow("faceWindow", cv2.WINDOW_GUI_NORMAL)
PADDING = 10
try:
@machinelearning147
machinelearning147 / build_face_dataset.py
Last active November 20, 2018 14:29
Build face-dataset for face recognition application
# USAGE
# python build_face_dataset.py --cascade haarcascade_frontalface_default.xml --output dataset/shravan
# import the necessary packages
from imutils.video import VideoStream
import argparse
import imutils
import time
import cv2
import os
# usage:
# python simple_cameratest_opencv.py 1
import numpy as np
import cv2
import sys
n = sys.argv[1]
cap = cv2.VideoCapture(int(n))
@machinelearning147
machinelearning147 / gradient-descent-intutive-understanding.ipynb
Created August 8, 2019 04:32
Gradient Descent Intutive understanding
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@machinelearning147
machinelearning147 / aws_instance_advisor_pyscpraping.ipynb
Created June 13, 2021 11:13
aws_instance_advisor_pyscpraping.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@machinelearning147
machinelearning147 / aws_instance_advisor_pyscpraping.ipynb
Created June 13, 2021 15:58
aws_instance_advisor_pyscpraping.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.