⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 torch tracking code, it is a good code
💻
字号:
Download data, pca and lda eigenface stuff from http://www.idiap.ch/~marcel/Databases/frontalfaces/main.html## computes PCA matrix using #trainPCA##> tar -zxvf data-eigenface.tar.gz> tar -zxvf pca-eigenface.tar.gz> ls -1 `pwd`/data/*.bindata > files.list> trainPCA files.list 1280 -verbose -save pca/model.pca## visualize Eigenfaces using #pca2pgm##> pca2pgm pca/model.pca 32 40 -verbose -verbose_level 1 -eigenface 10> ls *.pgm## project data into PCA subspace one file using #bindata2pca##> bindata2pca data/003.bindata pca/model.pca 1280 -variance 0.5 -verbose -verbose_level 1 -o pca/003.bindataProjection bindata file into PCA space (1280 -> 12) ...Loading PCA model: pca/model.pca ...Total variance = 57.6157Eigenvalue max = 6.54322Eigenvalue min = -5.34598e-160.5 per cent of variance => 12 Eigenvectors selectedn_inputs : 1280n_patterns : 6## Reconstruct an image using #bindata2ipca##> bindata2pgm data/003.bindata 32 40 -unnorm> bindata2ipca data/003.bindata pca/model.pca 1280 -verbose -verbose_level 1 -variance -1Loading PCA model: pca/model.pca ...Keeping all eigenvectors: 1280Copying eigenvectors ...Transpose the eigenvectors matrix ...n_inputs : 1280n_patterns : 6Projection bindata file into PCA space (1280 -> 1280) ... mse = 5.05303e-14 mse = 4.89166e-14 mse = 5.52089e-14 mse = 5.25584e-14 mse = 4.2167e-14 mse = 4.40198e-14Total MSE = 4.89002e-14> bindata2ipca data/003.bindata pca/model.pca 1280 -verbose -verbose_level 1 -variance 0.9Loading PCA model: pca/model.pca ...Total variance = 57.6157Eigenvalue max = 6.54322Eigenvalue min = -5.34598e-160.9 per cent of variance => 136 Eigenvectors selectedCopying eigenvectors ...Transpose the eigenvectors matrix ...n_inputs : 1280n_patterns : 6Projection bindata file into PCA space (1280 -> 136) ... mse = 0.0046822 mse = 0.0046822 mse = 0.00511003 mse = 0.00511003 mse = 0.00365963 mse = 0.00365963Total MSE = 0.00448395> bindata2pgm ipca.bindata 32 40 -unnorm> ls *.pgm> bindata2ipca data/003.bindata pca/model.pca 1280 -verbose -verbose_level 1 -variance 0.6Loading PCA model: pca/model.pca ...Total variance = 57.6157Eigenvalue max = 6.54322Eigenvalue min = -5.34598e-160.6 per cent of variance => 19 Eigenvectors selectedCopying eigenvectors ...Transpose the eigenvectors matrix ...n_inputs : 1280n_patterns : 6Projection bindata file into PCA space (1280 -> 19) ... mse = 0.0203495 mse = 0.0203496 mse = 0.0272404 mse = 0.0272404 mse = 0.0139989 mse = 0.0139989Total MSE = 0.0205296> bindata2pgm ipca.bindata 32 40 -unnorm> ls *.pgm> bindata2ipca data/003.bindata pca/model.pca 1280 -verbose -verbose_level 1 -variance 0.4Loading PCA model: pca/model.pca ...Total variance = 57.6157Eigenvalue max = 6.54322Eigenvalue min = -5.34598e-160.4 per cent of variance => 7 Eigenvectors selectedCopying eigenvectors ...Transpose the eigenvectors matrix ...n_inputs : 1280n_patterns : 6Projection bindata file into PCA space (1280 -> 7) ... mse = 0.0266148 mse = 0.0266148 mse = 0.0362658 mse = 0.0362657 mse = 0.0195848 mse = 0.0195848Total MSE = 0.0274884> bindata2pgm ipca.bindata 32 40 -unnorm> ls *.pgm## The reconstruction error increases while the variance decreases##   variance       MSE          # Eigenfaces#     1.0        4.89002e-14        1280#     0.9        0.00448395         136#     0.6        0.0205296          19#     0.4        0.0274884          7### project data into PCA subspace all files using #bindata2pca##> foreach c (`cat data/id.list`)bindata2pca data/${c}.bindata pca/model.pca 1280 -variance 0.5 -verbose -verbose_level 1 -o pca/${c}.bindataend## computes LDA matrix using #trainLDA##> tar -zxvf lda-eigenface.tar.gz> ls -1 `pwd`/pca/*.bindata > pcafiles.list> trainLDA pcafiles.list 12 -verbose -verbose_level 1 -classprovided -save model.lda## project PCA data into LDA subspace one file using #bindata2lda##> bindata2lda pca/003.bindata lda/model.lda 12 -variance 0.9 -verbose -verbose_level 1 -o lda/003.bindataor> bindata2lda pca/003.bindata lda/model.lda 12 -n_output 4 -verbose -verbose_level 1 -o lda/003.bindata> readbindata lda/003.bindata -verbose2.62094 0.542036 -3.01483 -0.58694 2.62094 0.542036 -3.01483 -0.586771 1.90149 -1.78666 0.413847 -2.16976 1.90149 -1.78666 0.413847 -2.16974 2.03724 0.533189 -1.09041 -0.811657 2.03724 0.533189 -1.09041 -0.811561 > bindata2lda pca/004.bindata lda/model.lda 12 -n_output 4 -verbose -verbose_level 1 -o lda/004.bindata> readbindata lda/004.bindata -verbose0.723977 1.59523 2.14267 -0.737938 0.723977 1.59523 2.14267 -0.737825 0.492157 1.11423 2.67814 -0.546292 0.492157 1.11423 2.67814 -0.546134 0.616704 1.34138 2.84853 -0.853059 0.616704 1.34138 2.84853 -0.85286 ## project image data into PCAxLDA subspace one file using #bindata2pcalda##> bindata2pcalda data/003.bindata pca/model.pca lda/model.lda 1280 -o pcalda.bindata -variancepca 0.5 -noutputlda 4 -verbose -verbose_level 1Loading PCA model: pca/model.pca ...Total variance = 57.6157Eigenvalue max = 6.54322Eigenvalue min = -5.34598e-160.5 per cent of variance => 12 Eigenvectors selectedLoading LDA model: lda/model.lda ...Total variance = 2.64757Eigenvalue max = 0.649401Eigenvalue min = -4.07529e-160.95 per cent of variance => 9 Eigenvectors selectedn_inputs : 1280n_patterns : 6Projection bindata file into PCAxLDA space (1280 -> 4) ...> readbindata pcalda.bindata -verbose2.62094 0.542036 -3.01483 -0.58694 2.62094 0.542036 -3.01483 -0.586771 1.90149 -1.78666 0.413847 -2.16976 1.90149 -1.78666 0.413847 -2.16974 2.03724 0.533189 -1.09041 -0.811657 2.03724 0.533189 -1.09041 -0.811561 ## Plot PCA#> foreach c (003 004 005 006 009)readbindata pca/${c}.bindata -verbose > pca/${c}.txtend> cd pca> gnuplot plot.gnu> gv plot.ps## Plot LDA#> foreach c (003 004 005 006 009)bindata2lda pca/${c}.bindata lda/model.lda 12 -n_output 4 -o lda/${c}.bindataend> foreach c (003 004 005 006 009)readbindata lda/${c}.bindata -verbose > lda/${c}.txtend> cd lda> gnuplot plot.gnu> gv plot.ps

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -