Skip to content

Instantly share code, notes, and snippets.

View thepycoder's full-sized avatar

Victor Sonck thepycoder

View GitHub Profile
# Linux and MacOS
export GOOGLE_APPLICATION_CREDENTIALS="[PATH]"
# Windows cmd
set GOOGLE_APPLICATION_CREDENTIALS=[PATH]
# Windows PowerShell
$env:GOOGLE_APPLICATION_CREDENTIALS="[PATH]"
pip install --upgrade google-cloud-vision Pillow
from google.cloud import vision
from PIL import Image, ImageDraw
import io
import os
# We create the vision image annotator client
# This line authenticates you using the keyfile stored
# in your environment and presents you with an object that
# can talk to autoML
client = vision.ImageAnnotatorClient()
def detect_license_plate(path):
"""Detects document features in an image."""
client = vision.ImageAnnotatorClient()
def mask_faces(path):
"""Detects faces in an image."""
with io.open(path, 'rb') as image_file:
content = image_file.read()
image = vision.types.Image(content=content)
@thepycoder
thepycoder / hello_world.sh
Created March 23, 2021 10:10
docker hello world
sudo docker run hello-world
[application]
enable-perf-measurement=1
perf-measurement-interval-sec=1
[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP
type=3
uri=file://../data/towncentre.mp4
num-sources=1
[property]
gpu-id=0
net-scale-factor=0.0039215697906911373
model-file=/opt/nvidia/deepstream/deepstream/samples/models/Primary_Detector/resnet10.caffemodel
proto-file=/opt/nvidia/deepstream/deepstream/samples/models/Primary_Detector/resnet10.prototxt
model-engine-file=../engines/resnet10.caffemodel_b30_gpu0.engine
labelfile-path=/opt/nvidia/deepstream/deepstream/samples/models/Primary_Detector/labels.txt
int8-calib-file=/opt/nvidia/deepstream/deepstream/samples/models/Primary_Detector/cal_trt.bin
force-implicit-batch-dim=1
batch-size=1
[property]
gpu-id=0
net-scale-factor=0.0039215697906911373
model-color-format=0
custom-network-config=/opt/nvidia/deepstream/deepstream/sources/project/weights/yolov4.cfg
model-file=/opt/nvidia/deepstream/deepstream/sources/project/weights/yolov4.weights
model-engine-file=model_b1_gpu0_fp16.engine
labelfile-path=labels.txt
batch-size=1
network-mode=2
[primary-gie]
enable=1
gpu-id=0
gie-unique-id=1
nvbuf-memory-type=0
config-file=model_yolo.txt