Skip to content

Instantly share code, notes, and snippets.

@IAmSuyogJadhav
IAmSuyogJadhav / Transparent drawings in OpenCV.py
Created July 10, 2018 09:41
Add transparency to rectangles, circles, polgons, text or any shape drawn in OpenCV.
import cv2
image = cv2.imread('test.jpg')
overlay = image.copy()
x, y, w, h = 10, 10, 10, 10 # Rectangle parameters
cv2.rectangle(overlay, (x, y), (x+w, y+h), (0, 200, 0), -1) # A filled rectangle
alpha = 0.4 # Transparency factor.
@harisankarh
harisankarh / vw_test.py
Last active September 28, 2018 21:15
vowpal wabbit test
import os
import random as rand
iters = 1000
actual_threshold = 70
for i in range(iters):
score_sampled = rand.randint(0,100)
get_prob_command = " echo \" | f1:{} \" | netcat localhost 26542".format(score_sampled)
@tchiavegatti
tchiavegatti / check_version.py
Last active November 15, 2021 20:57
[Check python version on a Jupyter notebook] #jupyter
# Check version runing on Jupyter notebook
from platform import python_version
print(python_version())
# Check version inside your Python program
import sys
print(sys.version)
# Check version in command line or shell
python --version