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
# Assuming the origin is in the top left corner | |
# x axis facing right | |
# y axis facing downwards | |
# r.x, r.y -- are top left corners of the rectangle | |
# with corresponding r.height and r.width | |
def intersection_area(r_1, r_2): | |
intersection = 0.0 |
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
%matplotlib inline | |
import tensorflow as tf | |
import numpy as np | |
import skimage.io as io | |
import os, sys | |
from PIL import Image | |
from matplotlib import pyplot as plt | |
sys.path.append("tf-image-segmentation/") |
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
%matplotlib inline | |
from __future__ import division | |
import os | |
import sys | |
import tensorflow as tf | |
import skimage.io as io | |
import numpy as np |
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
%matplotlib inline | |
from __future__ import division | |
import numpy as np | |
import tensorflow as tf | |
import sys | |
import os | |
from matplotlib import pyplot as plt | |
import urllib2 |
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
%%cython -a | |
# cython: cdivision=True | |
# cython: boundscheck=False | |
# cython: nonecheck=False | |
# cython: wraparound=False | |
# distutils: language = c++ | |
from libcpp.vector cimport vector | |
from libcpp.pair cimport pair | |
import skimage.io as io |
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
def intersection_ratio(rect_a, rect_b): | |
r_a_1 = rect_a["r"] | |
r_a_2 = rect_a["r"] + rect_a["height"] | |
c_a_1 = rect_a["c"] | |
c_a_2 = rect_a["c"] + rect_a["width"] | |
r_b_1 = rect_b["r"] | |
r_b_2 = rect_b["r"] + rect_b["height"] | |
c_b_1 = rect_b["c"] |
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
%%cython -a | |
# cython: cdivision=True | |
# cython: boundscheck=False | |
# cython: nonecheck=False | |
# cython: wraparound=False | |
import numpy as np | |
cimport numpy as cnp | |
from skimage._shared.transform cimport integrate |
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 skimage.io as io | |
from skimage.transform import pyramid_gaussian, rescale | |
from skimage.util import view_as_windows | |
from opencv_trainfile_test import detect_face | |
from matplotlib import pyplot as plt | |
import matplotlib.patches as patches | |
current_img = io.imread('roi.jpg') |
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
# Use local scikit-image | |
import sys | |
sys.path.insert(0, "/home/dan/University/projects/gsoc_face_detection/scikit-image/") | |
from skimage.feature import multiblock_local_binary_pattern | |
from skimage.transform import integral_image | |
import numpy as np | |
import skimage.io as io | |
import xml.etree.ElementTree as ET |
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 numpy as np | |
cimport numpy as cnp | |
def get_scale_local_maximas_cython(cnp.ndarray[cnp.int_t, ndim=2] cube_coordinates, cnp.ndarray[cnp.double_t, ndim=3] laplacian_cube): | |
""" | |
Check provided cube coordinate for scale space local maximas. | |
Returns only the points that satisfy the criteria. | |
A point is considered to be a local maxima if its value is greater |
NewerOlder