Skip to content

Instantly share code, notes, and snippets.

View vardanagarwal's full-sized avatar
🌚

Vardan Agarwal vardanagarwal

🌚
View GitHub Profile
import numpy as np
import tensorflow as tf
import cv2
import visualization_utils as vis_util
def create_category_index(label_path='coco_ssd_mobilenet/labelmap.txt'):
"""
To create dictionary of label map
Parameters
import cv2
import numpy as np
import tensorflow as tf
from tensorflow import keras
def get_face_detector(modelFile = "models/res10_300x300_ssd_iter_140000.caffemodel",
configFile = "models/deploy.prototxt"):
"""
Get the face detection caffe model of OpenCV's DNN module
"""Human facial landmark detector based on Convolutional Neural Network."""
import cv2
import numpy as np
import tensorflow as tf
from tensorflow import keras
import math
class FaceDetector:
"""Detect human face from image"""
import cv2
import numpy as np
import tensorflow as tf
from tensorflow import keras
class FaceDetector:
"""Detect human face from image"""
def __init__(self,
import numpy as np
import cv2
from sklearn.externals import joblib
def calc_hist(img):
histogram = [0] * 3
for j in range(3):
histr = cv2.calcHist([img], [j], None, [256], [0, 256])
histr *= 255.0 / histr.max()
histogram[j] = histr
@vardanagarwal
vardanagarwal / opencv_inpainting.ipynb
Last active December 27, 2021 13:37
opencv_inpainting.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from itertools import combinations_with_replacement
from collections import defaultdict
import numpy as np
from numpy.linalg import inv
B, G, R = 0, 1, 2 # index for convenience
def boxfilter(I, r):
"""Fast box filter implementation.
import speech_recognition as sr
import pyaudio
import wave
import time
import threading
import os
def read_audio(stream, filename):
chunk = 1024 # Record in chunks of 1024 samples
sample_format = pyaudio.paInt16 # 16 bits per sample
import cv2
import dlib
import numpy as np
import threading
from yolo_helper import YoloV3, load_darknet_weights, draw_outputs
from dlib_helper import (shape_to_np,
eye_on_mask,
contouring,
process_thresh,
print_eye_pos,
@vardanagarwal
vardanagarwal / style_combining.ipynb
Created May 31, 2020 15:51
style_combining.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.