Archive for the ‘Uncategorized’ Category

Windows, setting environment in jupyter for tensorflow

April 28, 2018 Leave a comment

After installing Anacoda and tensorflow, you might face challenge of running jupyter and choosing the environment. First you should install ipykernel.

activate tensorflow
conda install ipykernel

Then add your environment to the jupyter

python -m ipykernel install --user --name tensorflow --display-name "Python (tensorflow)"

For more details have a look at


Starting with Tensorflow on Windows

April 28, 2018 Leave a comment

As usual, follow all the paths stated in the Tensorflow’s official post. If you chose the option of Anaconda (I will strongly urge to choose that) after the installation, you will be stuck into what to do.

  • Begin by starting conda environment.
  • If you have python2.7, typing in python you will be taken to python2.7 environment. Tensorflow does not work in 2.7 for windows, why? I wish I knew. At this moment I just want to move forward, so do following.  (following is copied from the above mentioned official post)
:> activate tensorflow
  • You command prompt will change
(tensorflow)C:>  # Your prompt should change
  • Now type in python and you are in the game.


working with fastHOG; moving towards fast object detection

July 9, 2013 Leave a comment

Although HOG calculations don’t take much portion of time when running object detectors, but the dot products do. Sending HOG pyramid to the GPU steals away all the benefits of calculating dot product on GPU, only way is to calculate HOG also on GPU for different scales of pyramid.

Therefore I am trying to fastHOG. It requires quite a bit of libraries.

one of the libray is FLTK

if you don’t want to put it in the default location (which might be restricted) the following will help make install prefix=New_Dictionary_location

or you can set up through configure file

./configure –bindir=/location/fltk/bin –libdir=/location/fltk/lib –includedir=/location/fltk/include/ –prefix=/location/fltk

Categories: Uncategorized Tags: , ,

matlab and OpenCV development kit

January 26, 2013 Leave a comment

mexopencv comes from Kota Yamaguchi. It is a development kit which is collection of mex functions for bridging matlab and OpenCV. I have not used it till now, but it looks easy to use. Especially interesting to me is it provides the data conversion utility to transfer matlab data to OpenCV datatypes, so one can use them to write their own mex functions. 

So do use and provide feed back.

Categories: Uncategorized Tags: ,

2012 in review

January 2, 2013 Leave a comment

The stats helper monkeys prepared a 2012 annual report for this blog.

Here’s an excerpt:

4,329 films were submitted to the 2012 Cannes Film Festival. This blog had 23,000 views in 2012. If each view were a film, this blog would power 5 Film Festivals

Click here to see the complete report.

Categories: Uncategorized

Yi Ma’s Robust Face Recognition using Sparse Representation; matlab code

June 29, 2012 3 comments

Following is a matlab version of simple Face Recognition algorithm given by Yi Ma.

%build the dictionary from training
imgTrain = double(Tr_dataMatrix);
imgTest  = double(Tt_dataMatrix);

mx = mean(imgTrain,2);
D = imgTrain - repmat(mx, 1, size(imgTrain,2));

imgTest = imgTest - repmat(mx, 1, size(imgTest,2));

totalTest = size(imgTest,2);
lambda2 = 3;
addpath D:\mohsen\matlabCode\sparseCoding\elad\;
[U S V] = svd(D);
[egVal ind] = sort(diag(S), 'descend');
egV = U;
egV = egV(:, ind);

D = egV(:,1:200)'*D;
D = D./repmat(sqrt(sum(D.^2)),size(D,1),1);
imgTest = egV(:,1:200)'*imgTest;
 ci = zeros(size(D,2), size(imgTest,2));
ci = GetSparseFast(D,imgTest,0*zeros(size(D,2), size(imgTest,2)),500,1, 40);
testImgId = [];
rejectedI = [];
for i=1:totalTest
 recEr = 0;
 recMinid = -1;
 for p=1:totalPeople
   recErt = norm(imgTest(:,i)-D*(ci(:,i).*(imgTrainLabel'==p)));
   if recErt < recEr || p == 1
        recMinid = p; recEr = recErt;
 testImgId(i) = recMinid;

Matlab and Object orientation

March 3, 2012 Leave a comment

It’s high time to start implementing the object orientation in the matlab. If you are good in C/C++ you know how to develop classes and why to develop them.
Few caveats however, changes inside the method of any class member does not mean that object has been updated. Remember to return the object itself and re-assign it to iself. Unless you define it as subclass of ‘handle’.


When Pre-Allocating (i.e. array of classes )use the “empty”
have a look at