Skip to content

Instantly share code, notes, and snippets.

View melvincabatuan's full-sized avatar
💭
deep learning

Melvin Cabatuan melvincabatuan

💭
deep learning
View GitHub Profile
@melvincabatuan
melvincabatuan / jaccard.py
Created July 27, 2020 11:26 — forked from ramhiser/jaccard.py
Jaccard cluster similarity in Python
import itertools
def jaccard(labels1, labels2):
"""
Computes the Jaccard similarity between two sets of clustering labels.
The value returned is between 0 and 1, inclusively. A value of 1 indicates
perfect agreement between two clustering algorithms, whereas a value of 0
indicates no agreement. For details on the Jaccard index, see:
http://en.wikipedia.org/wiki/Jaccard_index
@melvincabatuan
melvincabatuan / NasNet Layers
Created December 22, 2018 00:46 — forked from didacroyo/NasNet Layers
NasNetLayers.txt
0 input_1
1 stem_conv1
2 stem_bn1
3 activation_1
4 reduction_conv_1_stem_1
5 reduction_bn_1_stem_1
6 activation_2
7 activation_4
8 separable_conv_1_reduction_left1_stem_1
9 separable_conv_1_reduction_1_stem_1
@melvincabatuan
melvincabatuan / The Technical Interview Cheat Sheet.md
Created July 28, 2017 22:39 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@melvincabatuan
melvincabatuan / gist:2e39bf6a6fe1389b160e4b8ed14d97d0
Created July 19, 2017 23:41 — forked from psayre23/gist:c30a821239f4818b0709
Runtime Complexity of Java Collections
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array
@melvincabatuan
melvincabatuan / Motempl.java
Created April 8, 2016 23:18 — forked from b95505017/Motempl.java
Java version of motion detection sample using OpenCV, referenced from motempl.c. The functionality of showing the output is using Processing.
import org.opencv.core.*;
import org.opencv.highgui.Highgui;
import org.opencv.highgui.VideoCapture;
import processing.core.PApplet;
import processing.core.PConstants;
import processing.core.PImage;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
@melvincabatuan
melvincabatuan / opencvni.cpp
Created April 8, 2016 02:17 — forked from vins31/opencvni.cpp
Sample to grab depth frames from an Asus Xtion or Occipital Structure depth sensor with OpenNI2 and OpenCV3
/*
* Build command:
* g++ -o opencvni opencvni.cpp `pkg-config --cflags --libs opencv`
*/
#include "opencv2/videoio/videoio.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <iostream>
@melvincabatuan
melvincabatuan / dlib_plus_osm.md
Created November 11, 2015 03:54 — forked from iandees/dlib_plus_osm.md
Detecting Road Signs in Mapillary Images with dlib C++

image

I've been interested in computer vision for a long time, but I haven't had any free time to make any progress until this holiday season. Over Christmas and the New Years I experimented with various methodologies in OpenCV to detect road signs and other objects of interest to OpenStreetMap. After some failed experiments with thresholding and feature detection, the excellent /r/computervision suggested using the dlib C++ module because it has more consistently-good documentation and the pre-built tools are faster.

After a day or two figuring out how to compile the examples, I finally made some progress:

Compiling dlib C++ on a Mac with Homebrew

  1. Clone dlib from Github to your local machine:
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update