Skip to content
csol3108 edited this page Oct 3, 2014 · 10 revisions

Welcome to the satdetect project wiki!

Where to get data

All data is stored in a shared folder on Google Drive. This folder has structure like so

Tukul Detector/
-- datasets/
---- Country-Location-Data/
------ data in [flat file format](Spec-JPEGWithFlatFileAnnotations)

Email Mike to get access to the shared folder.

To Train a Detector

python -m satdetect.TrainDetector <imgsrcpath> <outpath> [TRAIN OPTIONS]

EXAMPLE

To train the detector on imagery from Sudan, using a logistic classifier:

IPATH=$HOME/Google\ Drive/Tukul\ Detector/datasets/Sudan-MakerAwat-20101219/sudanma-scene1.jpg
OPATH="$HOME/data/tukuls/huts_25x25_stride4/"
python -m satdetect.TrainDetector "$IPATH" $OPATH --cname logistic

Note that the double-quotes around IPATH avoid problems with white-space in the file name.

INPUT

  • imgsrcpath : path to annotated JPEG imagery for training detector

This can be a path to a single JPEG file, or a pattern for many JPEG files, using '*' wildcards as appropriate (which will trigger a call to glob).

See JPEG with Annotations Spec for details about the format of the annotations (which must be in the same directory as the provided JPEG).

  • outpath : directory for storing intermediate and final results

See Output Directory Spec for details.

  • [TRAIN OPTIONS]

    • --cname : string name of classifier (logistic,svm-linear)
    • --feat : string name of feature extractor (just 'hog' for now)

OUTPUT

Trained classifier is saved in the provided output directory, in a "*.dump" file. You can see the name of this file in stdout.

stdout should look like

<<<<<<<<<<<<<<<<<<<<<<<<<<<<< This is BasicTrainSetBuilder.transform
Dataset stats:
 pos examples 38
 neg examples 20000
        total 20038
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< This is Classifier.trainClassifier
Training classifier of type:  logistic
Training complete after 0.493 sec
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< This is Classifier.saveClassifier
Classifier and TrainDataInfo saved to:
/data/tukuls/huts_25x25_stride4/trained-classifiers/2419-hog-nBins9-pxPerCell5-logistic.dump
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< This is Classifier.testClassifier
FN:    0/38   FP: 8408/20000   acc:11630/20038 0.580   decisionThr 0.001
FN:    1/38   FP: 4300/20000   acc:15737/20038 0.785   decisionThr 0.002
FN:    2/38   FP: 3977/20000   acc:16059/20038 0.801   decisionThr 0.002
FN:    3/38   FP: 2695/20000   acc:17340/20038 0.865   decisionThr 0.003
FN:    4/38   FP:  541/20000   acc:19493/20038 0.973   decisionThr 0.009
...

To Run the detector on new data

python -m satdetect.RunDetector <imgsrcpath> <outpath> <cpath> [DETECT OPTIONS]

EXAMPLE

To evaluate the detector from the example above on the same data it was trained on, using a decision threshold of 0.1, do

CPATH="$HOME/data/tukuls/huts_25x25_stride4/trained-classifiers/2419-hog-nBins9-pxPerCell5-logistic.dump"
python -m satdetect.RunDetector "$IPATH" $CPATH --decisionThr 0.1

INPUT

  • imgsrcpath : path to annotated JPEG imagery for training detector

This can be a path to a single JPEG file, or a pattern for many JPEG files, using '*' wildcards as appropriate (which will trigger a call to glob).

See JPEG with Annotations Spec for details about the format of the annotations (which must be in the same directory as the provided JPEG).

  • outpath : directory for storing intermediate and final results

See Output Directory Spec for details.

  • cpath : full path to .dump file containing stored classifier

See Classifier.saveClassifier for details.

OUTPUT

This will output images to disk that show detected positive windows (in yellow) and true positive windows (in green) side by side on all images.

stdout will look like

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< This is Detector.runDetector
Saving annotated image tiles...
/data/tukuls/huts_25x25_stride4/detection-results/sudanma-scene1_tile01-decisionThr0.10.jpg
/data/tukuls/huts_25x25_stride4/detection-results/sudanma-scene1_tile02-decisionThr0.10.jpg
/data/tukuls/huts_25x25_stride4/detection-results/sudanma-scene1_tile03-decisionThr0.10.jpg
/data/tukuls/huts_25x25_stride4/detection-results/sudanma-scene1_tile04-decisionThr0.10.jpg

What are Tiles?

See the TileFile Spec for all the gory details.