Github command tips

*Init Github
$ git init
Initialized empty Git repository in ~/djangogirls/.git/
$ git config --global user.name "yourname"
$ git config --global user.emai yourname@mail.com

*Making ignore file -> .ignore

*Status check
$ git status
On branch master
Initial commit
Untracked files:  (use "git add <file>..." to include in what will be committed)
        .gitignore        blog/        manage.py        mysite/
nothing added to commit but untracked files present (use "git add" to track)

*add and commit
$ git add --all . #git add .
$ git commit -m "My Django Girls app, first commit"
 [...] 13 files changed, 200 insertions(+) create mode 100644 .gitignore [...] create mode 100644 mysite/wsgi.py

*Set remote repository
$ git remote add origin https://github.com/MareArts/CVLecture_djangocms.git
$ git push -u origin master

*Command arrangement
Working computer
$ git status
$ git add --all .
$ git status
$ git commit -m "Changed the HTML for the site."
$ git push

Deploy computer
$ git pull

*tip force pull
$git fetch --all
$git reset --hard origin/master
$git reset --hard origin/<branch_name>

*tip to set user/pass don't ask every time
save username / pass
$git config credential.helper store
$git pull

change information
$git config credential.helper store 
$git pull

*tip when .igore file not working
git rm -r --cached .
git add .
git commit -m "fixed untracked files"


Extract the value of interest rows and copy that to new Mat

Simple example code.

using push_back

#end code

using concate
#start code

#end code

Check the rect contains point, opencv tip


Use this function "Rect.contains(Point)".

Rect roi(10,10,20,20);
Point pt(14,14);

if (roi.contains(pt))
  cout << "The pt inside in the rect" << endl;

Thank you.


simple tip: int to string in stl

memo for me.. ^^

for(int i=0; i<10; ++i)
     std::string index1("string_" + std::to_string(i) + ".jpg");


Tensorflow RNN LSTM weight save and restore example code

I have been struggled for long time for save and restore the result of LSTM params.
Today, I have succeeded, I hope anyone helping this my example code.

Below code is example to learning for
input: hihell -> output: ihello

gist code start
This code is referenced by this(https://github.com/MareArts/DeepLearningZeroToAll/blob/master/lab-12-1-hello-rnn.py)

gist code end

There are 4 variable for trainable
name rnn/basic_lstm_cell/weights:0, shape (10, 20)
name rnn/basic_lstm_cell/biases:0, shape (20,1)
name fully_connected/weights:0, shape (5, 5)
name fully_connected/biases:0, shape (5,1)

And I have checked the values which are same after "global_variables_initializer"
The result is same and prediction result is also same.

OK, then let's move more complicated RNN design.
This example code for 2 layer LSTM and 2 batch condition.
gist code start

gist code end




python csv file data simple handler.

I made simple class witch is to handle element datas in csv file.

Basically, we can get elements by indexing.
For example) Get first line row data, or 2~3 line row data.

And we also can get some part of elements in csv.
For example) row 2~3 and col 2~4.

refer to this image

And we can save new csv file.

Actually, I made this class for handle MNIST data file.
And the source code uploaded in GitHub repository.
I hope someone updated this code.
Anyone can do contributor.

And I hope to help this code to someone. ^^




Histogram Equalization, Stretching, origin histo compare and example source code

Example source code for histogram equalization
and compare with origin histogram and stretching histogram.

result is like that:

origin image & histogram

stretching image and histogram

Equalization image and histogram



equalizeHist, cvtColor, normalize, calcHist