Skip to content

Instantly share code, notes, and snippets.

@daien
daien / tracks_pytables_demo.py
Created January 15, 2011 16:46
Pytables demo to store tracks of a video database
#!/usr/bin/env python
import numpy as np
import tables
# class containing infos to identify a track
class Track(tables.IsDescription):
id = tables.IntCol() # track ID (should be unique)
frame = tables.IntCol() # frame where the current track bounding box was found
ulx = tables.IntCol() # upper left corner's x coordinate of the bbox (upper left is origin (0,0) of frame)
@daien
daien / simplex_projection.py
Created October 8, 2011 16:56
Compute Euclidean projections on the simplex or L1-ball
""" Module to compute projections on the positive simplex or the L1-ball
A positive simplex is a set X = { \mathbf{x} | \sum_i x_i = s, x_i \geq 0 }
The (unit) L1-ball is the set X = { \mathbf{x} | || x ||_1 \leq 1 }
Adrien Gaidon - INRIA - 2011
"""
@daien
daien / multidim_digitize.py
Created December 22, 2011 10:34
Build a regular grid and assigns each data point to a cell
import numpy as np
def regular_multidim_digitize(data, n_bins=3, lbes=None, rbes=None):
""" Build a regular grid and assigns each data point to a cell
Parameters
----------
data: (n_points, n_dims) array,
the data that we which to digitize
@daien
daien / video_stabilize.py
Created January 2, 2012 18:23
Video stabilization with OpenCV and Hugin
#!/usr/bin/env python
""" Video stabilization with OpenCV (>=2.3) and Hugin
Adrien Gaidon
INRIA - 2012
TODO: add cropping, clean-up and improve doc-strings
"""
@daien
daien / multinomial_logistic_regression.py
Created March 6, 2012 22:01
Multinomial Logistic Regression draft
"""
Multinomial Logistic Regression (MLR)
=====================================
Multiclass-classification with the MLR classifier
Authors: Adrien Gaidon & Jakob Verbeek
"""
@daien
daien / examples_mlr.py
Created March 6, 2012 22:02
MLR classification 2D toy examples
# -*- coding: utf-8 -*-
# <nbformat>3</nbformat>
# <codecell>
import numpy as np
import pylab as pl
import sklearn.datasets as skdata
import multinomial_logistic_regression as mlr
@daien
daien / actom_sequence_model.ipynb
Last active September 2, 2015 13:48
Modeling actions in videos with the Actom Sequence Model
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""Tree structure and hierarchical divisive algorithm for spectral clustering
Used in the paper:
@article{Gaidon2014,
author = {Gaidon, Adrien and Harchaoui, Zaid and Schmid, Cordelia},
title = {{Activity representation with motion hierarchies}},
journal = {IJCV},
year = {2014}
}