Skip to content

Instantly share code, notes, and snippets.

View Nannigalaxy's full-sized avatar
🚀

Nandan Manjunatha Nannigalaxy

🚀
View GitHub Profile
@Nannigalaxy
Nannigalaxy / feed.yaml
Last active August 14, 2024 19:34
feed YAML
map:
environment: name
url: api_url
status: api_ping
docs: docs_url
status-check:
api_ping: status
target:
@Nannigalaxy
Nannigalaxy / install_opencv.sh
Created September 20, 2021 08:24
OpenCV for C++ and Python (without contrib modules)
# Date: 20 Sept 2021
# Script for installing opencv for c++ and python (without contrib modules)
# Tested on Pop!_OS 20.04
echo "Installing Pre-requisites"
sudo apt install build-essential cmake git pkg-config libgtk-3-dev \
libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \
libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev \
gfortran openexr libatlas-base-dev python3-dev python3-numpy \
libtbb2 libtbb-dev libdc1394-22-dev libopenexr-dev \
@Nannigalaxy
Nannigalaxy / install_opencv_with_contrib.sh
Created September 20, 2021 08:23
OpenCV for C++ and Python with contrib modules
# Date: 20 Sept 2021
# Script for installing opencv for c++ and python with contrib modules
# Tested on Pop!_OS 20.04
echo "Installing Pre-requisites"
sudo apt install build-essential cmake git pkg-config libgtk-3-dev \
libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \
libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev \
gfortran openexr libatlas-base-dev python3-dev python3-numpy \
libtbb2 libtbb-dev libdc1394-22-dev libopenexr-dev \
@Nannigalaxy
Nannigalaxy / voc_rename_label.py
Last active July 1, 2021 08:01
VOC dataset manipulation scripts. XML to CSV, Rename labels, Resizes Images.
import pandas as pd
import os
import cv2 as cv
import gc
from tqdm import tqdm
import shutil
from PIL import Image
import xml.etree.ElementTree as ET
@Nannigalaxy
Nannigalaxy / img_scraper.py
Last active June 14, 2021 12:46
Image scraping script
'''
Image scrapping script
Install libraries
$pip install requests bs4
'''
# import required modules
import requests # for get requests
from bs4 import BeautifulSoup as bs # for scraping
@Nannigalaxy
Nannigalaxy / downgrade_gcc_version.md
Last active August 16, 2023 17:24
Ubuntu 18.04 downgrade the gcc version to version 5.5

Ubuntu 18.04 downgrade the gcc version to version 5.5

First check your own gcc version, the default is 7.3 on Ubuntu18.04

$ gcc --version
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
  1. Download gcc/g++ 5
@Nannigalaxy
Nannigalaxy / auto_annotate.py
Last active May 31, 2021 18:27
Auto annotation for plain background images.
import cv2
import numpy as np
from matplotlib import pyplot as plt
def get_bbox(path, plot=False):
img = cv2.imread(path)
orig = img.copy()
################
# denoise
@Nannigalaxy
Nannigalaxy / audio_format_convert.py
Last active July 6, 2021 15:46
Convert audio file format using ffmpeg in ubuntu
''' convert file format using ffmpeg in ubuntu
windows install: https://video.stackexchange.com/questions/20495/how-do-i-set-up-and-use-ffmpeg-in-windows
or https://www.wikihow.com/Install-FFmpeg-on-Windows
Usage:
$ python ./format_convert.py --input <dir/path> --output <dir/path>
'''
import os
import argparse
@Nannigalaxy
Nannigalaxy / center_crop_scale.py
Last active May 17, 2022 09:21
Center Crop and Image Scaling functions in OpenCV using Python
# Center Crop and Image Scaling functions in OpenCV
# Date: 11/10/2020
# Written by Nandan M
import cv2
def center_crop(img, dim):
"""Returns center cropped image
Args:
@Nannigalaxy
Nannigalaxy / opencv_webcam.py
Created September 7, 2020 03:44
Simple Webcam Video Streaming with FPS count using OpenCV Python 3
'''
Date: 07/09/2020
Written by Nandan M
'''
import cv2
import time
# 0 is default webcam. Change to switch between multiple cameras or IP address.
vc = cv2.VideoCapture(0)