Skip to content

Instantly share code, notes, and snippets.

View kingardor's full-sized avatar
🚀
Diving Deeper Into Deep Learning

Akash James kingardor

🚀
Diving Deeper Into Deep Learning
View GitHub Profile
import os
from scipy.io import wavfile
import scipy.signal as sps
import numpy as np
if __name__ == '__main__':
dir = 'train/audio/'
newdir = 'trainnew/audio/'
files = os.listdir(dir)
import os
import numpy as np
import scipy.io.wavfile
import scipy.signal
if __name__ == '__main__':
dir = 'test/audio/'
newdir = 'testnew/audio/'
files = os.listdir(dir)
@kingardor
kingardor / install-zsh.io
Created May 12, 2021 07:31
zsh and oh-my-zsh setup
# Install dependencies
sudo apt install curl wget git
# Install zsh and oh-my zsh
sudo apt install zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Install Spaceship theme
git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1
ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"
@kingardor
kingardor / avatarify_easy_run.sh
Created March 8, 2021 09:55
Run Avatarify with Avengers
# Python dependencies
sudo apt install python3-dev python3-pip
pip3 install numpy
pip3 install opencv-python
pip3 install blosc
pip3 install scikit-image
pip3 install torch==1.7.0 torchvision==0.8.0
pip3 install face_alignment
pip3 install pyzmq
@kingardor
kingardor / resize_pad.py
Created December 10, 2020 10:36
To resize and pad images
import cv2
import os
desired_size = (540,960)
path = ""
path2 = ""
files = os.listdir(path)
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "timer.h"
#include "check.h"
#define SOFTENING 1e-9f
/*
* Each body contains x, y, and z coordinate positions,
@kingardor
kingardor / topology.json
Last active October 30, 2020 06:40
Topology for FaceRec demo with Microsoft Live Video Analytics
{
"@apiVersion": "1.0",
"name": "InferencingWithHttpExtension",
"properties": {
"description": "Analyzing live video using HTTP Extension to send images to an external inference engine",
"parameters": [
{
"name": "rtspUrl",
"type": "String",
"description": "rtsp Url"
# CUDA
export PATH=/usr/local/cuda-10.1/bin${PATH:+:${PATH}}
export CUDA_PATH=/usr/local/cuda-10.1
export CUDA_HOME=/usr/local/cuda-10.1
export LIBRARY_PATH=$CUDA_HOME/lib64:$LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH
export NVCC=/usr/local/cuda-10.1/bin/nvcc
export CFLAGS="-I$CUDA_HOME/include $CFLAGS"
@kingardor
kingardor / LocalFFMEGStreamAccess.py
Created March 4, 2019 17:53
Access RTSP or UDP video stream that is streamed using FFMPEG
# ffmpeg -i video.mp4 -v 0 -vcodec mpeg4 -f mpegts udp://192.168.0.101:23000
import os
cap = cv2.VideoCapture('udp://192.168.0.101:23000?overrun_nonfatal=1&fifo_size=50000000')
# cap = cv2.VideoCapture('rtsp://192.168.0.101')
os.environ["OPENCV_FFMPEG_CAPTURE_OPTIONS"] = "udp_transport;0"
# os.environ["OPENCV_FFMPEG_CAPTURE_OPTIONS"] = "rtsp_transport;0"
while cap.isOpened():
#!/usr/bin/env python
import signal
import sys
def signal_handler(signal, frame):
# Perform your actions here
print('Ctrl+c occured')
signal.signal(signal.SIGINT, signal_handler)