This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = 1 | |
def test(): | |
x = 2 | |
test() | |
print(x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make sure you grab the latest version | |
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip | |
# Unzip | |
unzip protoc-3.2.0-linux-x86_64.zip -d protoc3 | |
# Move protoc to /usr/local/bin/ | |
sudo mv protoc3/bin/* /usr/local/bin/ | |
# Move protoc3/include to /usr/local/include/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
def create_blank(width, height, rgb_color=(0, 0, 0)): | |
"""Create new image(numpy array) filled with certain color in RGB""" | |
# Create black blank image | |
image = np.zeros((height, width, 3), np.uint8) | |
# Since OpenCV uses BGR, convert the color first |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import ImageFont, ImageDraw, Image | |
import textwrap | |
import requests | |
from io import BytesIO | |
# # load image from file | |
# image = Image.open("e1.jpg") | |
# loading image from url | |
image_from_url = requests.get("https://dummyimage.com/600x1000/000/fff&text=+") |