Skip to content

Instantly share code, notes, and snippets.

View Laurence-Cullen's full-sized avatar
🛠️
Building

Laurence Cullen Laurence-Cullen

🛠️
Building
View GitHub Profile
@Laurence-Cullen
Laurence-Cullen / install.sh
Created December 28, 2020 16:40
Install CUDA for TensorFlow on Ubuntu 20.04
# Add NVIDIA package repositories
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
sudo apt-get update
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64/nvidia-machine-learning-repo-ubuntu2004_1.0.0-1_amd64.deb
sudo apt install ./nvidia-machine-learning-repo-ubuntu2004_1.0.0-1_amd64.deb
@Laurence-Cullen
Laurence-Cullen / find_circles.py
Created April 8, 2017 22:25
Open CV example for finding the number of circles in an image
# Tuned to find the number of balls/circles in this image https://i.redd.it/z092hx3k89qy.jpg
import cv2
import cv2.cv as cv
import numpy as np
img = cv2.imread('circles.jpg')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
circles = cv2.HoughCircles(gray, cv2.cv.CV_HOUGH_GRADIENT, 1, 3,