EasyCV  0.9.36
Easy! Computer Vision
Private Member Functions | List of all members
cvac::CorpusService Class Reference
Inheritance diagram for cvac::CorpusService:
easy.corpus_service.CorpusServiceI

Private Member Functions

Corpus openCorpus (cvac::FilePath file)
 
void closeCorpus (Corpus corp)
 
void saveCorpus (Corpus corp, cvac::FilePath file)
 
bool getDataSetRequiresLocalMirror (Corpus corp)
 
bool localMirrorExists (Corpus corp)
 
void createLocalMirror (Corpus corp, Ice::Identity cb)
 
cvac::LabelableList getDataSet (Corpus corp)
 
void addLabelable (Corpus corp, cvac::LabelableList addme)
 
Corpus createCorpus (cvac::DirectoryPath dir)
 

Detailed Description

Handles download, mirror, extraction, modification of a Corpus. Corpus data items and functions are separated into "class Corpus" and "interface CorpusService" for two reasons: 1) ICE has to create fewer proxy classes, and 2) only one CorpusService has to run and can deal with many corpora.

Construction of a new Corpus can be accomplished through editing of a property file which contains all relevant information or through the createCorpus method which parses a few common file structures.

A single CorpusService instance generally runs alongside the client code, but in the case of a remote Corpus, that instance might talk to other CorpusService instances running on remote machines. The client should never have to deal with a remote Corpus directly.

Member Function Documentation

void cvac::CorpusService::addLabelable ( Corpus  corp,
cvac::LabelableList  addme 
)
private

Add a labeled or unlabeled artifact(s) to the Corpus. This method will fail if the Corpus isImmutableMirror.

void cvac::CorpusService::closeCorpus ( Corpus  corp)
private

A corpus, once opened, is cached in the CorpusService and does not update itself if the file system or properties file change. To re-open the corpus and re-load the cache, close it first. Otherwise, closing is optional.

Corpus cvac::CorpusService::createCorpus ( cvac::DirectoryPath  dir)
private

A few common file system structures can be parsed into a Corpus. Most notably, a path that has subdirectories with images in each is treated as a Corpus containing these images, each with a full-substrate label corresponding to the subdirectory name.

void cvac::CorpusService::createLocalMirror ( Corpus  corp,
Ice::Identity  cb 
)
private

Download, extract, and keep caller informed via CorpusCallback. A mirror can contain the actual files or just enough metadata about the files so as to construct a LabelableList. The callback adapter (cb) must be of type CorpusCallback.

cvac::LabelableList cvac::CorpusService::getDataSet ( Corpus  corp)
private

Obtain the actual data items in the corpus. This will fail if the Corpus isImmutableMirror and createLocalMirror has not been completed.

bool cvac::CorpusService::getDataSetRequiresLocalMirror ( Corpus  corp)
private

Does this Corpus require a "download" before the meta data can be obtained?

bool cvac::CorpusService::localMirrorExists ( Corpus  corp)
private

Has a local mirror already been created? This will return true only if this corpus requires a download, not for one that is local to begin with.

Corpus cvac::CorpusService::openCorpus ( cvac::FilePath  file)
private

Opens the Corpus from a metadata file. This does not download, extract, or otherwise prepare the Corpus, just create a Corpus object.

void cvac::CorpusService::saveCorpus ( Corpus  corp,
cvac::FilePath  file 
)
private

Write Corpus to a metadata file.


The documentation for this class was generated from the following file: