Commit 8a20419264871520202ad5101722355e9a11005e
Merge branch 'master' of https://github.com/biometrics/openbr
Showing
8 changed files
with
27 additions
and
16 deletions
.gitignore
openbr/plugins/algorithms.cpp
| ... | ... | @@ -52,7 +52,7 @@ class AlgorithmsInitializer : public Initializer |
| 52 | 52 | Globals->abbreviations.insert("AgeGenderDemo", "Stream(SaveMat(original)+Cvt(Gray)+Cascade(FrontalFace)+Expand+<FaceClassificationRegistration>+<FaceClassificationExtraction>+<AgeRegressor>/<GenderClassifier>+Discard+RestoreMat(original)+Draw(inPlace=true)+DrawPropertiesPoint([Age,Gender],Affine_0,inPlace=true)+SaveMat(original)+Discard+Contract+RestoreMat(original)+FPSCalc+Show(false,[AvgFPS,Age,Gender])+Discard)"); |
| 53 | 53 | Globals->abbreviations.insert("ShowOpticalFlowField", "Stream(SaveMat(original)+AggregateFrames(2)+OpticalFlow(useMagnitude=false)+Grid(100,100)+DrawOpticalFlow+FPSLimit(30)+Show(false)+Discard)"); |
| 54 | 54 | Globals->abbreviations.insert("ShowOpticalFlowMagnitude", "Stream(AggregateFrames(2)+OpticalFlow+Normalize(Range,false,0,255)+Cvt(Color)+Draw+FPSLimit(30)+Show(false)+Discard)"); |
| 55 | - Globals->abbreviations.insert("ShowMotionSegmentation", "Stream(DropFrames(5)+SaveMat(original)+AggregateFrames(2)+OpticalFlow+CvtUChar+Segmentation+DrawSegmentation+Draw+FPSLimit(30)+Show(false)+Discard)"); | |
| 55 | + Globals->abbreviations.insert("ShowMotionSegmentation", "Stream(DropFrames(5)+AggregateFrames(2)+OpticalFlow+CvtUChar+WatershedSegmentation+DrawSegmentation+Draw+FPSLimit(30)+Show(false)+Discard)"); | |
| 56 | 56 | |
| 57 | 57 | Globals->abbreviations.insert("HOG", "Stream(DropFrames(5)+Cvt(Gray)+Grid(5,5)+ROIFromPts(32,24)+Expand+Resize(32,32)+Gradient+RectRegions+Bin(0,360,8)+Hist(8)+Cat)+Contract+CatRows+KMeans(500)+Hist(500)+SVM"); |
| 58 | 58 | Globals->abbreviations.insert("HOF", "Stream(DropFrames(5)+Grid(5,5)+AggregateFrames(2)+OpticalFlow+ROIFromPts(32,24)+Expand+Resize(32,32)+Gradient+RectRegions+Bin(0,360,8)+Hist(8)+Cat)+Contract+CatRows+KMeans(500)+Hist(500)"); | ... | ... |
openbr/plugins/draw.cpp
| ... | ... | @@ -384,8 +384,6 @@ class DrawSegmentation : public UntrainableTransform |
| 384 | 384 | Q_OBJECT |
| 385 | 385 | Q_PROPERTY(bool fillSegment READ get_fillSegment WRITE set_fillSegment RESET reset_fillSegment STORED false) |
| 386 | 386 | BR_PROPERTY(bool, fillSegment, true) |
| 387 | - Q_PROPERTY(QString original READ get_original WRITE set_original RESET reset_original STORED false) | |
| 388 | - BR_PROPERTY(QString, original, "original") | |
| 389 | 387 | |
| 390 | 388 | void project(const Template &src, Template &dst) const |
| 391 | 389 | { |
| ... | ... | @@ -394,14 +392,7 @@ class DrawSegmentation : public UntrainableTransform |
| 394 | 392 | int numSegments = src.file.get<int>("NumSegments"); |
| 395 | 393 | |
| 396 | 394 | dst.file = src.file; |
| 397 | - Mat drawn; | |
| 398 | - if (fillSegment) { | |
| 399 | - drawn = Mat(segments.size(), CV_8UC3, Scalar::all(0)); | |
| 400 | - } else { | |
| 401 | - if (!dst.file.contains(original)) qFatal("You must store the original image in the metadata with SaveMat."); | |
| 402 | - drawn = dst.file.get<Mat>(original); | |
| 403 | - dst.file.remove(original); | |
| 404 | - } | |
| 395 | + Mat drawn = fillSegment ? Mat(segments.size(), CV_8UC3, Scalar::all(0)) : src.m(); | |
| 405 | 396 | |
| 406 | 397 | for (int i=1; i<numSegments+1; i++) { |
| 407 | 398 | Mat mask = segments == i; | ... | ... |
openbr/plugins/gallery.cpp
| ... | ... | @@ -985,7 +985,7 @@ class vbbGallery : public Gallery |
| 985 | 985 | void init() |
| 986 | 986 | { |
| 987 | 987 | MatlabIO matio; |
| 988 | - QString filename = file.name; | |
| 988 | + QString filename = (Globals->path.isEmpty() ? "" : Globals->path + "/") + file.name; | |
| 989 | 989 | bool ok = matio.open(filename.toStdString(), "r"); |
| 990 | 990 | if (!ok) qFatal("Couldn't open the vbb file"); |
| 991 | 991 | ... | ... |
openbr/plugins/stream.cpp
| ... | ... | @@ -433,10 +433,12 @@ public: |
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | #ifdef CVMATIO |
| 436 | - QString f = basis.file.name; | |
| 437 | - QString vbb = f.replace(f.lastIndexOf("."), 4, ".vbb"); | |
| 438 | - vbb.replace(vbb.lastIndexOf("vid"), 3, "annotations"); | |
| 439 | - annotations = TemplateList::fromGallery(File(vbb)); | |
| 436 | + if (basis.file.contains("vbb")) { | |
| 437 | + QString vbb = basis.file.get<QString>("vbb"); | |
| 438 | + annotations = TemplateList::fromGallery(File(vbb)); | |
| 439 | + } | |
| 440 | +#else | |
| 441 | + qWarning("cvmatio not installed, bounding boxes will not be available. Add -DBR_WITH_CVMATIO cmake flag to install."); | |
| 440 | 442 | #endif |
| 441 | 443 | |
| 442 | 444 | return true; | ... | ... |
scripts/downloadDatasets.sh
| ... | ... | @@ -51,6 +51,8 @@ if [ ! -d ../data/CaltechPedestrians/vid ]; then |
| 51 | 51 | tar -xf $fname |
| 52 | 52 | done |
| 53 | 53 | rm *.tar |
| 54 | + ./writeCaltechPedestrianSigset.sh 0 5 train > ../data/CaltechPedestrians/train.xml | |
| 55 | + ./writeCaltechPedestrianSigset.sh 6 10 test > ../data/CaltechPedestrians/test.xml | |
| 54 | 56 | mv set* ../data/CaltechPedestrians/vid |
| 55 | 57 | if hash curl 2>/dev/null; then |
| 56 | 58 | curl -OL "$prefix/annotations.zip" | ... | ... |
scripts/writeCaltechPedestrianSigset.sh
0 → 100755
| 1 | +#!/bin/bash | |
| 2 | + | |
| 3 | +echo '<?xml version="1.0" encoding="UTF-8"?>' | |
| 4 | +echo '<biometric-signature-set>' | |
| 5 | +for ((set=$1; set <= $2; set++)); do | |
| 6 | + echo -e "\t<biometric-signature name=\"\">" | |
| 7 | + for vid in `printf "set%02d/*.seq" $set`; do | |
| 8 | + if [ $3 == "train" ]; then | |
| 9 | + vbb=`echo "vbb=\"annotations/$vid\"" | sed s/seq/vbb/` | |
| 10 | + fi | |
| 11 | + printf "\t\t<presentation file-name=\"vid/$vid\" $vbb />\n" | |
| 12 | + done | |
| 13 | + echo -e "\t</biometric-signature>" | |
| 14 | +done | |
| 15 | +echo '</biometric-signature-set>' | ... | ... |
scripts/writeKTHSigset.sh
100644 → 100755