Skip to content

Instantly share code, notes, and snippets.

Uzzal Podder uzl

Block or report user

Report or block uzl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
uzl /
Created Jul 2, 2019
get usb camera id automatically for opencv
def get_usb_camera_id():
from subprocess import check_output
out = check_output(["ls /dev/video*"], shell=True)
out = out.decode('utf-8').strip().split('\n')
if len(out) == 0:
raise Exception('No camera Module Found')
cam_id = None
for dev in out:
uzl /
Last active Jun 5, 2019
Install Latest Nvidia Driver in Ubuntu 18.04

Install Latest Nvidia Driver in Ubuntu 18.04 LTS

Step: 1

Remove previous installation

sudo apt-get purge nvidia*
sudo apt-get autoremove 

uzl /
Created May 22, 2019
Generate number array based on a range, std and mean condition
import numpy as np
import scipy.stats
from pprint import pprint
import matplotlib.pyplot as plt
import logging
# source:
def my_distribution(min_val, max_val, mean, std):
scale = max_val - min_val
uzl /
Created May 21, 2019
Plot multiple image in Matplotlib
def my_plot():
import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(8, 8))
columns, rows = 4, 5
for i in range(1, columns * rows + 1):
img = np.random.randint(10, size=(10, 10))
uzl /
Last active May 13, 2019
Jupyter Notebook commands

Run remote jupyter in localhost using ssh tunnel

in remote server

jupyter notebook --no-browser --port=8889

in local server

uzl /
Last active Apr 26, 2019
Useful git CLI

Upload a new local repository to gitlab

This will create a new project on Gitlab without creating it manually on the server

git push --set-upstream address/your-project.git

Changing/Switching remote URLs

uzl /
Created Apr 11, 2019
Capturing Usb Industrial Camera
from harvesters.core import Harvester
import numpy as np
import matplotlib.pyplot as plt
import cv2
import time
from harvesters.util.pfnc import mono_location_formats, \
rgb_formats, bgr_formats, bayer_location_formats, \
rgba_formats, bgra_formats
uzl /
Created Apr 10, 2019
Quadrilateral bounding box to LabelImg xml generation
import numpy as np
from pathlib import Path
import xml.etree.cElementTree as ET
from PIL import Image
def create_labimg_xml(image_path, annotation_list):
image_path = Path(image_path)
img = np.array('RGB'))
uzl / installing_aravis.txt
Created Apr 9, 2019
Compiling and Installing Aravis with USB support
View installing_aravis.txt
# download source from
# Note: I found problem for USB support in github source
./configure --enable-viewer --enable-usb --enable-gst-plugin --enable-introspection=yes
sudo make install
uzl / directory_scanning.ipynb
Created Mar 15, 2019
scanning directory and sub directory
View directory_scanning.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.