Cvpr2010 open source vision software, intro and training part ii - using git to track third party projects - vedaldi, fulkerson - arzneimittel-forschung - 2010
Similar a Cvpr2010 open source vision software, intro and training part ii - using git to track third party projects - vedaldi, fulkerson - arzneimittel-forschung - 2010
Similar a Cvpr2010 open source vision software, intro and training part ii - using git to track third party projects - vedaldi, fulkerson - arzneimittel-forschung - 2010 (20)
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
Cvpr2010 open source vision software, intro and training part ii - using git to track third party projects - vedaldi, fulkerson - arzneimittel-forschung - 2010
1. Part II
Development
Andrea Vedaldi Brian Fulkerson
Visual Geometry Group VisonLab
Oxford UCLA
2. Deadline workflow 66
• Typical workflow
- code
- import third party libraries
(e.g. LibSVM, OpenCV, GIL, VLFeat, ...)
- tweak
- submit paper
- tweak
- camera ready
• Can’t reproduce experiments anymore! Credit: phdcomics.com
• What changed?
- your own code?
- third party code?
- your customization of third party code?
- ??
Andrea Vedaldi and Brian Fulkerson
3. Version control 67
• A good version control system is a valuable tool
• With version control you can:
- track changes
- safely share code among multiple authors
- safely share code among multiple projects
- safely incorporate third party code
• Example: git
- flexible, solid, portable, well supported
- no central repository
- personal use or collaboration
- slightly harder to learn than CVS/SVN
Andrea Vedaldi and Brian Fulkerson
4. Cross platform git installation 68
• Linux • Mac
- sudo apt-get install git-core gitk - git (via MacPorts)
- gitx: http://gitx.frim.nl/
• Windows
- msysgit: http://code.google.com/p/msysgit/
- git-gui visual intro: http://nathanj.github.com/gitguide/tour.html
- gitextensions: http://code.google.com/p/gitextensions/
Andrea Vedaldi and Brian Fulkerson
5. Really basic git 69
• Creating aanew repository is simple:
# Create new git repo in the current folder
git init
• SoDuplicate aone: repo in the folder repo1 to folder repo2
#
is copying
git
git clone repo1 repo2
• Keeping track of new files:
# Add one file
git add file1
# Add everything
git add *
• Makingall“commit”: in one file and commit it
# Add
a
changes
git add file1
git commit
# Commit all changes on all tracked files
git commit -a
Andrea Vedaldi and Brian Fulkerson
6. Really basic git collaboration 70
• Create a new bare repository:
ssh me@server
mkdir repo.git
cd repo.git
git init --bare
• Tell your local repo aboutme@server:repo.git
git remote add origin
the server
• Pushpush origin master
git
a copy to the server
• Collaborator gets a copy and makes changes
git clone co@server:~me/repo.git
...
git commit -a -m “Best changes ever”
• And push they want to share
git
now
• And pullwant to get the changes
git
you
Andrea Vedaldi and Brian Fulkerson
7. Learning more about git 71
• Learning git
- web tutorial, podcasts, ...
- Version Control with Git
• Git keeps track of commits and trees
commit: a tree with a comment, author, date
tree: snapshot of your project (files, dirs, ...)
ECCV submission
fixed lethal bugs
improved ASCII arts
improved comments
initial version
Andrea Vedaldi and Brian Fulkerson
8. Version control with third party code 72
• Manage third party code:
- encapsulate third party code
- integrate with your project
• Benefits:
- track third party changes
- track your customization
- move customizations on top of third party changes
• Example
- package LibSVM 2.89-3
- make some changes
- add the new LibSVM 2.91-1
- move your changes on top of the new version
Andrea Vedaldi and Brian Fulkerson
9. Tracking LibSVM 73
• Track libsvm-mat-2.89-3 with Git
# download and unpack LibSVM 2.89-3
unzip libsvm-mat-2.89-3.zip
# initalize repository master
mkdir libsvm-mat 2.89-3
cd libsvm-mat
cp -r ../libsvm-mat-2.89-3 .
The libsvm-mat-2.89-3
git init source code
git add *
git commit -m "2.89-3"
Andrea Vedaldi and Brian Fulkerson
10. Tracking LibSVM: customize 74
• We make two changes:
- adds support for additional PD kernels
- adds host detection to the Makefile
cd libsvm
git branch 2.89-3-mods
git checkout 2.89-3-mods
# edit kernel code
Makefile: adds ...
git commit -a -m "adds support for ...”
# edit Makefile adds support ...
git commit -a -m "Makefile: adds ...”
2.89-3-mods
2.89-3 master
Andrea Vedaldi and Brian Fulkerson
11. Tracking LibSVM: upstream update 75
• 2.91-1 is out! Grab it.
# download and unpack LibSVM 2.91-1
unzip libsvm-mat-2.91-1.zip
# rewind
cd libsvm-mat
git checkout master 2.91-1
# create commit
2.89-3-mods
cp -r ../libsvm-mat-2.91-1/* .
Makefile: adds ...
git add *
git commit -m "2.91-1"
adds support ...
2.89-3 master
Andrea Vedaldi and Brian Fulkerson
12. Tracking LibSVM: rebase your mods 76
• Apply your changes to the new LibSVM
# checkout branch with your mods
cd libsvm-mat
git branch 2.91-3-mods 2.89-3-mods
git rebase master 2.91-1-mods
2.91-1 master
2.91-1-mods
2.89-3-mods
2.91-1-mods
Makefile: adds ...
adds support ...
2.89-3
Andrea Vedaldi and Brian Fulkerson
13. Contributing to VLFeat 77
• We handle git://github.com/vlfeat/vlfeat.git
git clone
collaboration using github.com:
• For minor changesorigin
git-format-patch
• For major changes and additions
- http://help.github.com/forking/
Andrea Vedaldi and Brian Fulkerson