Skip to content

Instantly share code, notes, and snippets.

@shadimsaleh
shadimsaleh / fill_depth_colorization.py
Created April 20, 2023 19:58 — forked from ialhashim/fill_depth_colorization.py
Python implementation of depth filling from NYU Depth v2 toolbox
# Original Matlab code https://cs.nyu.edu/~silberman/datasets/nyu_depth_v2.html
#
#
# Python port of depth filling code from NYU toolbox
# Speed needs to be improved
#
# Uses 'pypardiso' solver
#
import scipy
import skimage

Build tensorflow on OSX with NVIDIA CUDA support (GPU acceleration)

These instructions are based on Mistobaan's gist but expanded and updated to work with the latest tensorflow OSX CUDA PR.

Requirements

OS X 10.10 (Yosemite) or newer

@shadimsaleh
shadimsaleh / tensorflow_cuda_osx.md
Created February 13, 2019 13:08 — forked from Mistobaan/tensorflow_cuda_osx.md
How to enable cuda support for tensor flow on Mac OS X (Updated on April:2016 Tensorflow 0.8)

These instructions will explain how to install tensorflow on mac with cuda enabled GPU suport. I assume you know what tensorflow is and why you would want to have a deep learning framework running on your computer.

Prerequisites

Make sure to update your homebrew formulas

brew update
@shadimsaleh
shadimsaleh / jupyter_shortcuts.md
Created March 12, 2018 12:48 — forked from kidpixo/jupyter_shortcuts.md
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

Toc

Keyboard shortcuts

The IPython Notebook has two different keyboard input modes. Edit mode allows you to type code/text into a cell and is indicated by a green cell border. Command mode binds the keyboard to notebook level actions and is indicated by a grey cell border.

MacOS modifier keys:

  • ⌘ : Command
# https://www.youtube.com/watch?v=Y3ac5rFMNZ0&t=318s
# avconv -i rtsp://admin:admin@192.168.1.68/play1.sdp -c copy -map 0 -f segment -segment_time 300 -segment_format mp4 "capture-%03d-`date +%Y-%m-%d_%H:%M:%S`.mp4"
import cv2
backsub = cv2.BackgroundSubtractorMOG() #background subtraction to isolate moving cars
capture = cv2.VideoCapture("/home/ubuntu/Downloads/traffic_video.avi")
i = 0
minArea=1
while True:
ret, frame = capture.read()
@shadimsaleh
shadimsaleh / cluster_extraction.cpp
Created November 22, 2016 07:34 — forked from tanmayshankar/cluster_extraction.cpp
A ROS (Robot Operating System) adaptation of the Euclidean Cluster Extraction tutorial (http://www.pointclouds.org/documentation/tutorials/cluster_extraction.php#cluster-extraction)
#include <ros/ros.h>
#include <iostream>
// PCL specific includes
#include <pcl/ModelCoefficients.h>
#include <pcl/point_types.h>
#include <pcl/io/pcd_io.h>
#include <pcl/filters/extract_indices.h>
#include <pcl/filters/voxel_grid.h>
#include <pcl/features/normal_3d.h>
#include <pcl/kdtree/kdtree.h>
@shadimsaleh
shadimsaleh / Python concave hull ( alpha shape ) .md
Created November 10, 2016 14:14 — forked from hellpanderrr/Python concave hull ( alpha shape ) .md
Concave hull in python using scipy and networkx
from scipy.spatial import Delaunay, ConvexHull
import networkx as nx
 
points = [ [0,0],[0,50],[50,50],[50,0],[0,400],[0,450],[50,400],[50,450],[700,300],[700,350],[750,300],[750,350],
          [900,600],[950,650],[950,600],[900,650]
]
def concave(points,alpha_x=150,alpha_y=250):
    points = [(i[0],i[1]) if type(i) <> tuple else i for i in points]
    de = Delaunay(points)
@shadimsaleh
shadimsaleh / ALTERNATIVES.adoc
Created October 23, 2016 12:53 — forked from mbbx6spp/ALTERNATIVES.adoc
Super quick list of alternatives to Jira and/or Confluence, Stash, Crucible, etc.
/*
http://benjithian.sg/2012/12/simple-background-subtraction/
Simple Background Subtraction. Simple stuff.
*/
#include <stdio.h>
#include <curl/curl.h>
#include <sstream>
#include <iostream>
#include <vector>
#include <opencv2/opencv.hpp>