Skip to content

Instantly share code, notes, and snippets.

View tejastank's full-sized avatar

Tejas Tank tejastank

  • India
View GitHub Profile
@tejastank
tejastank / distFace.py
Created March 31, 2021 06:35
Distance to face calculation Windows10 web cam. OpenCv 3.4 Python 3.6
import numpy as np
import imutils
import cv2
from imutils.video import VideoStream
from imutils.video import FPS
import time
def distance_to_camera(knownWidth, focalLength, perWidth):
@tejastank
tejastank / video_facial_landmarks.py
Created March 31, 2021 06:31 — forked from hizkifw/video_facial_landmarks.py
some face tracking thing
# USAGE
# wget https://github.com/AKSHAYUBHAT/TensorFace/raw/master/openface/models/dlib/shape_predictor_68_face_landmarks.dat
# python3 video_facial_landmarks.py
# import the necessary packages
from socket import *
from imutils.video import VideoStream
from imutils import face_utils
from scipy import signal
import datetime
@tejastank
tejastank / facerecognition.py
Created March 31, 2021 06:30 — forked from progerjkd/facerecognition.py
A simple face recognition system using opencv2 and dlib to perform face encodings, and calculate Euclidean distances from a database of previously encoded faces.
import face_recognition
import cv2
import numpy as np
import glob
import os
import logging
import pickle
# adapted from the Deep Learning: Face Recognition course from LinkedIn Learning
@tejastank
tejastank / main-webcam.py
Created March 31, 2021 06:29 — forked from JvGinkel/main-webcam.py
face recognotion python script
# brew install cmake
# python3 -m venv face-recognition
# source face-recognition/bin/activate
# pip install dlib
# pip install face_recognition
# pip install opencv-python
import face_recognition
import cv2
import numpy as np
#!/usr/bin/env python
import rospy
import sys
import cv2
import cv2 as cv
from sensor_msgs.msg import Image, CameraInfo
from cv_bridge import CvBridge, CvBridgeError
from std_msgs.msg import String
import numpy as np
@tejastank
tejastank / derhuff.c
Created March 31, 2021 05:14 — forked from danielrothfus/derhuff.c
A very simple Huffman implementation I wrote for bit-by-bit I/O practice.
/** \file derhuff.c
\author Daniel Rothfus
\version 1.0
\brief A really simple Huffman implementation.
Derhuff is a simple utility to compress files using the Huffman coding scheme.
To compress a file, it analyzes the frequencies of all the bytes in the file
and builds a tree using these frequencies, which it writes to the output. With
this tree, the program then converts each byte of the input to the path to get
to the corresponding leaf in the tree. To decode, it just reads the tree from
@tejastank
tejastank / rushsolver.py
Created March 31, 2021 05:13 — forked from danielrothfus/rushsolver.py
A simple Python 3 script to brute force a minimal solution to the Rush Hour game.
# Rush Hour Solver
# rushsolver.py
# Daniel Rothfus
# This is a fairly slow brute force solver for the game Rush Hour. This solver
# was inspired by http://acm2013.cct.lsu.edu/localdoc/problems-scripting/1.pdf
# Please note that this solver was made for Python 3, not Python 2.
#
# To use this script, first input the character that will represent the special
# car to remove from the right side of the grid in the following board. Next,
# input the board in ASCII art on the next 6 rows. Periods should be used to
@tejastank
tejastank / nginx-tuning.md
Created March 23, 2021 15:24 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@tejastank
tejastank / index.html
Created February 17, 2021 10:03 — forked from mac2000/index.html
brain.js demo
<!DOCTYPE html>
<html>
<head>
<title>brain.js</title>
<script src="https://cdn.rawgit.com/BrainJS/brain.js/develop/browser.js"></script>
<script>
function DrawableCanvas(el) {
const px = 10
const ctx = el.getContext('2d')
let x = []
@tejastank
tejastank / trilateration.js
Created February 5, 2021 14:53 — forked from kdzwinel/trilateration.js
Simple trilateration algorithm implementation in JavaScript.
function getTrilateration(position1, position2, position3) {
var xa = position1.x;
var ya = position1.y;
var xb = position2.x;
var yb = position2.y;
var xc = position3.x;
var yc = position3.y;
var ra = position1.distance;
var rb = position2.distance;
var rc = position3.distance;