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
- Download gcc/g++ 5
''' | |
Simple YOLOv5 Inference in Pytorch | |
Run following commands: | |
git clone https://github.com/ultralytics/yolov5.git | |
cd yolov5 | |
pip install -r requirements.txt | |
run this script in /path/to/yolov5 directory | |
''' |
import cv2 | |
import pytesseract | |
def get_captcha(path): | |
img = cv2.imread(path) | |
h,w=img.shape[:2] | |
# cropping borders | |
# img = img[5:h-4,5:w-5] |
''' | |
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) |
# 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: |
''' 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 |
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 |
''' | |
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 |
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 | |
# 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 \ |