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
@kingardor
kingardor / hm10.ino
Last active November 20, 2018 09:44
Code to use HM-10 with Arduino/ESP8266
/*Method to enter AT
* Connections:
* Arduino/Esp8266 HM10
* GND GND
* 5V 5V
* RX RX
* TX TX
* Open Serial Monitor. Set the Baud to 9600 with NL&CR. Test for AT.
*/
/*
Connections
VCC ----- 5V/3.3V
GND ----- GND
SCL -----> D12
SDO -----> D13
Note: If using 3.3V logic boards like Pro Mini or ESP8266, connect VCC to 3.3V.
*/
@kingardor
kingardor / fix.sh
Created March 25, 2018 14:15
Hashsum mismatch fix for apt
sudo rm -rf /var/lib/apt/lists/partial
sudo apt-get update -o Acquire::CompressionTypes::Order::=gz
@kingardor
kingardor / renamer.py
Last active January 11, 2019 08:20
To rename images for easier annotation and handling while training models
'''
Usage: python3 rename.py --input path1 --output path2
'''
import os
import argparse
def argsparser():
'''
To use arguments from command line.
@kingardor
kingardor / traingen.py
Last active June 1, 2021 13:26
To generate train.txt/test.txt for YOLO object detection
'''
Usage: python3 classgen.py --input path >> train.txt
'''
import os
import argparse
def argsparser():
'''
To use arguments from command line.
@kingardor
kingardor / tkinter-webcam.py
Last active May 6, 2021 22:09
To display Webcam in a tkinter display box
import PIL
from PIL import Image,ImageTk
import pytesseract
import cv2
from tkinter import *
width, height = 1920, 1080
cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, width)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, height)
@kingardor
kingardor / pycrypt.py
Created January 21, 2019 13:48
Encryption and Decryption of text/files using pycrypto
#!/usr/bin/python3
import sys
from Crypto import Random
from Crypto.Cipher import AES
import argparse
class Initialize:
def argsparser(self):
#!/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)
@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():
# 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"