cvpr2010 open source vision software, intro and training part ii - using git to track third party...
TRANSCRIPT
![Page 1: Cvpr2010 open source vision software, intro and training part ii - using git to track third party projects - vedaldi, fulkerson - arzneimittel-forschung - 2010](https://reader034.vdocument.in/reader034/viewer/2022052622/559751e81a28ab005c8b459c/html5/thumbnails/1.jpg)
Part IIDevelopment
Andrea VedaldiVisual Geometry Group
Oxford
Brian FulkersonVisonLabUCLA
![Page 2: Cvpr2010 open source vision software, intro and training part ii - using git to track third party projects - vedaldi, fulkerson - arzneimittel-forschung - 2010](https://reader034.vdocument.in/reader034/viewer/2022052622/559751e81a28ab005c8b459c/html5/thumbnails/2.jpg)
Andrea Vedaldi and Brian Fulkerson
Deadline workflow
• Typical workflow
- code- import third party libraries
(e.g. LibSVM, OpenCV, GIL, VLFeat, ...)- tweak- submit paper- tweak- camera ready
• Can’t reproduce experiments anymore!
• What changed?
- your own code?- third party code?- your customization of third party code?- ??
66
Credit: phdcomics.com
![Page 3: Cvpr2010 open source vision software, intro and training part ii - using git to track third party projects - vedaldi, fulkerson - arzneimittel-forschung - 2010](https://reader034.vdocument.in/reader034/viewer/2022052622/559751e81a28ab005c8b459c/html5/thumbnails/3.jpg)
Andrea Vedaldi and Brian Fulkerson
Version control
• 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
67
![Page 4: Cvpr2010 open source vision software, intro and training part ii - using git to track third party projects - vedaldi, fulkerson - arzneimittel-forschung - 2010](https://reader034.vdocument.in/reader034/viewer/2022052622/559751e81a28ab005c8b459c/html5/thumbnails/4.jpg)
Andrea Vedaldi and Brian Fulkerson
Cross platform git installation
• 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/
68
• Linux
- sudo apt-get install git-core gitk• Mac
- git (via MacPorts)- gitx: http://gitx.frim.nl/
![Page 5: Cvpr2010 open source vision software, intro and training part ii - using git to track third party projects - vedaldi, fulkerson - arzneimittel-forschung - 2010](https://reader034.vdocument.in/reader034/viewer/2022052622/559751e81a28ab005c8b459c/html5/thumbnails/5.jpg)
Andrea Vedaldi and Brian Fulkerson
Really basic git
• Creating a new repository is simple:# Create a new git repo in the current foldergit init
• So is copying one:# Duplicate a git repo in the folder repo1 to folder repo2git clone repo1 repo2
• Keeping track of new files:# Add one filegit add file1# Add everythinggit add *
• Making a “commit”:# Add all changes in one file and commit itgit add file1git commit# Commit all changes on all tracked filesgit commit -a
69
![Page 6: Cvpr2010 open source vision software, intro and training part ii - using git to track third party projects - vedaldi, fulkerson - arzneimittel-forschung - 2010](https://reader034.vdocument.in/reader034/viewer/2022052622/559751e81a28ab005c8b459c/html5/thumbnails/6.jpg)
Andrea Vedaldi and Brian Fulkerson
Really basic git collaboration
• Create a new bare repository:ssh me@servermkdir repo.gitcd repo.gitgit init --bare
• Tell your local repo about the servergit remote add origin me@server:repo.git
• Push a copy to the servergit push origin master
• Collaborator gets a copy and makes changesgit clone co@server:~me/repo.git...git commit -a -m “Best changes ever”
• And now they want to sharegit push
• And you want to get the changesgit pull
70
![Page 7: Cvpr2010 open source vision software, intro and training part ii - using git to track third party projects - vedaldi, fulkerson - arzneimittel-forschung - 2010](https://reader034.vdocument.in/reader034/viewer/2022052622/559751e81a28ab005c8b459c/html5/thumbnails/7.jpg)
Andrea Vedaldi and Brian Fulkerson
Learning more about git
• Learning git
- web tutorial, podcasts, ...- Version Control with Git
• Git keeps track of commits and trees
fixed lethal bugs
ECCV submission
improved comments
improved ASCII arts
initial version
tree: snapshot of your project (files, dirs, ...)
commit: a tree with a comment, author, date
71
![Page 8: Cvpr2010 open source vision software, intro and training part ii - using git to track third party projects - vedaldi, fulkerson - arzneimittel-forschung - 2010](https://reader034.vdocument.in/reader034/viewer/2022052622/559751e81a28ab005c8b459c/html5/thumbnails/8.jpg)
Andrea Vedaldi and Brian Fulkerson
Version control with third party code
• 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
72
![Page 9: Cvpr2010 open source vision software, intro and training part ii - using git to track third party projects - vedaldi, fulkerson - arzneimittel-forschung - 2010](https://reader034.vdocument.in/reader034/viewer/2022052622/559751e81a28ab005c8b459c/html5/thumbnails/9.jpg)
Andrea Vedaldi and Brian Fulkerson
Tracking LibSVM
• Track libsvm-mat-2.89-3 with Git
# download and unpack LibSVM 2.89-3unzip libsvm-mat-2.89-3.zip
# initalize repositorymkdir libsvm-matcd libsvm-matcp -r ../libsvm-mat-2.89-3 .
The libsvm-mat-2.89-3source codegit init
git add * git commit -m "2.89-3"
2.89-32.89-3
master
73
![Page 10: Cvpr2010 open source vision software, intro and training part ii - using git to track third party projects - vedaldi, fulkerson - arzneimittel-forschung - 2010](https://reader034.vdocument.in/reader034/viewer/2022052622/559751e81a28ab005c8b459c/html5/thumbnails/10.jpg)
Andrea Vedaldi and Brian Fulkerson
• We make two changes:
- adds support for additional PD kernels- adds host detection to the Makefile
Tracking LibSVM: customize
cd libsvmgit branch 2.89-3-modsgit checkout 2.89-3-mods
2.89-3 master
adds support ...
Makefile: adds ...
2.89-3-mods
# edit kernel codegit commit -a -m "adds support for ...”
# edit Makefilegit commit -a -m "Makefile: adds ...”
74
![Page 11: Cvpr2010 open source vision software, intro and training part ii - using git to track third party projects - vedaldi, fulkerson - arzneimittel-forschung - 2010](https://reader034.vdocument.in/reader034/viewer/2022052622/559751e81a28ab005c8b459c/html5/thumbnails/11.jpg)
Andrea Vedaldi and Brian Fulkerson
Tracking LibSVM: upstream update
• 2.91-1 is out! Grab it.# download and unpack LibSVM 2.91-1unzip libsvm-mat-2.91-1.zip
2.89-3
adds support ...
Makefile: adds ...2.89-3-mods
2.91-1
master
75
# rewindcd libsvm-matgit checkout master
# create commitcp -r ../libsvm-mat-2.91-1/* .git add *git commit -m "2.91-1"
adds support ...
Makefile: adds ...2.89-3-mods
![Page 12: Cvpr2010 open source vision software, intro and training part ii - using git to track third party projects - vedaldi, fulkerson - arzneimittel-forschung - 2010](https://reader034.vdocument.in/reader034/viewer/2022052622/559751e81a28ab005c8b459c/html5/thumbnails/12.jpg)
Andrea Vedaldi and Brian Fulkerson
Tracking LibSVM: rebase your mods
• Apply your changes to the new LibSVM# checkout branch with your modscd libsvm-matgit branch 2.91-3-mods 2.89-3-mods
2.89-3
master
adds support ...
Makefile: adds ...2.89-3-mods
2.91-1
git rebase master 2.91-1-mods
2.91-1-mods
adds support ...
Makefile: adds ...2.91-1-mods
76
![Page 13: Cvpr2010 open source vision software, intro and training part ii - using git to track third party projects - vedaldi, fulkerson - arzneimittel-forschung - 2010](https://reader034.vdocument.in/reader034/viewer/2022052622/559751e81a28ab005c8b459c/html5/thumbnails/13.jpg)
Andrea Vedaldi and Brian Fulkerson
Contributing to VLFeat
• We handle collaboration using github.com:git clone git://github.com/vlfeat/vlfeat.git
• For minor changesgit-format-patch origin
• For major changes and additions- http://help.github.com/forking/
77