EasyCV
0.9.36
Easy! Computer Vision
|
Typedefs | |
typedef bool(* | GetImageSizeFunction )(std::string filename, int &width, int &height) |
typedef ResultSet(* | DoDetectFunc )(DetectorPtr detector, const char *filename) |
typedef pair< string, MediaConverter * > | rsMediaPair |
typedef string | rsMediaType |
typedef std::set< std::string > | StringSet |
Enumerations | |
enum | PurposeType { UNPURPOSED, POSITIVE, NEGATIVE, MULTICLASS, ANY } |
enum | Interpolation { DISCRETE, LINEAR, POLYNOMIAL } |
Functions | |
VLogger & | getVLogger () |
void | localAndClientMsg (VLogger::Levels level, const CallbackHandlerPrx &callbackHandler, const char *fmt,...) |
bool | directoryExists (const std::string &directory) |
bool | fileExists (const std::string &abspath) |
std::string | getFileDirectory (const std::string &fileName) |
std::string | getCurrentWorkingDirectory () |
bool | makeDirectories (const std::string &path) |
bool | makeDirectory (const std::string &path) |
std::string | getFileName (const std::string &fileName) |
std::string | getBaseFileName (const std::string &fileName) |
std::string | getFileExtension (const std::string &path) |
bool | deleteDirectory (const std::string &path) |
std::string | getPurposeName (const cvac::Purpose &purpose) |
bool | compatiblePurpose (const cvac::Purpose &actual, const cvac::Purpose &constraint) |
void | addFileToRunSet (cvac::RunSet &runSet, const std::string &relativePath, const std::string &filename, const cvac::Purpose &purpose) |
void | addFileToRunSet (cvac::RunSet &runSet, const std::string &relativePath, const std::string &filename, int classID) |
bool | makeSymlinkFile (const std::string linkFullPath, const std::string tgtFile) |
std::string | getTempFilename (const std::string &basedir="", const std::string &prefix="") |
std::string | getDateFilename (const std::string &basedir="", const std::string &prefix="") |
std::string | getFSPath (const cvac::FilePath &fp, const std::string &CVAC_DataDir="") |
bool | copyFile (const std::string &fromFile, const std::string &toFile) |
bool | pathAbsolute (const std::string &path) |
int | processLabelArtifactsToRects (cvac::RunSetWrapper &wrapper, cvac::RunSetConstraint &constraint, std::string cvacDataDir, cvac::ServiceManager *serviceMan, const CallbackHandlerPrx &callback, GetImageSizeFunction sfunc, int skipFrames, std::vector< RectangleLabels > *result, bool square) |
int | processLabelArtifactsToRects (LabelableList *artifacts, GetImageSizeFunction sfunc, std::vector< RectangleLabels > *result, bool square, std::string cvacDataDir) |
void | cleanupRectangleLabels (std::vector< RectangleLabels > *rects) |
void | processRunSet (DetectorPtr detector, const DetectorCallbackHandlerPrx &client, DoDetectFunc detectFunc, const RunSet &run, const std::string &pathPrefix, ServiceManager *servMan) |
void | sendResultsToClient (const DetectorCallbackHandlerPrx &client, const ResultSet &results) |
bool | containsIllegalChars (FilePath filePath) |
void | addToRunSet (RunSet &runSet, const std::string &relativePath, const std::string &filename, const Purpose &purpose, LocationPtr loc=NULL) |
void | addToRunSet (RunSet &runSet, const std::string &relativePath, const std::string &filename, int classID, LocationPtr loc=NULL) |
void | addFilenamePair (const std::string &filename, const std::string &symLinkName) |
std::string | getSymlinkSubstitution (const std::string &illegalFileName) |
std::string | getLegalPath (std::string tempDir, FilePath filePath, bool &newSymlink) |
std::string | fixupRunSet (RunSet &runset, const std::string &CVAC_DataDir) |
std::string | getClientConnectionName (const Ice::Current &cur) |
string | getLowercase (const string &_str) |
ResultSet | detect (const std::string &algorithm, const cvac::RunSet &runset, const cvac::FilePath &model, const cvac::DetectorProperties *props) |
std::string | getCVACDataDir (const std::string &algorithm) |
StringSet | startServices () |
void | sleep (int numberOfMilliseconds) |
Variables | |
sequence< Labelable > | LabelableList |
sequence< string > | StringList |
sequence< PurposedList > | PurposedListSequence |
dictionary< string, string > | LabelProperties |
const bool | CVACFALSE = false |
sequence< Point2D > | Point2DList |
sequence< FrameLocation > | FrameLocationList |
sequence< Result > | ResultList |
sequence< byte > | ByteSeq |
const int | MINUSONE = -1 |
dictionary< string, string > | Properties |
File handling and remote sychronization for CVAC. A remote site that provides CVAC services should run a FileService if it is expected to process media that is not already stored at the remote site, and/or if the clients are permitted to obtain the actual files on which processing was performed. The clients need to be configured to know about the FileServer location (host, port) next to the CVAC service. Utility functions exist that implement the client functionality.
A custom FileService is necessary as IcePatch2 does not meet our needs. To explain the differences: FileService can send and receive files, bidirectionally. FileService provides some security and privacy to shield multiple clients from each other. With FileService, clients can obtain media-related metadata without downloading the entire image or video. FileService can create and transfer a thumbnail image. Two IcePatch2 instances, one for each direction, could be used as the transport mechanism underneath FileService.
The OutputResults class sends results to the client based upon how the client has specified it wants to recieve these results.
Utilities to read in a LabelableList and return a vetector of file names and rectangles.
Utilities to read in a RunSet and then make callbacks to a user supplied routine to process each file of the RunSet.
Utilities to invoke a CVAC service.
Functions to manage a CVAC service. Programs that take a long time to complete need to periodically call stopRequested to see if the user has canceled the operation. If they have then the processing should stop and stopCompleted should be called. The service names should be the service names defined in config.services.
This is the public interface to the ServiceManager, which hides the Ice aspects. Ice aspects are introduced in the subclass which implements this interface, specified in ServiceManI.h.
typedef ResultSet(* cvac::DoDetectFunc)(DetectorPtr detector, const char *filename) |
This function is called from processRunSet() as the RunSet is traversed. It will be called for each file that needs to have the detector run on it. The detector is responsible for returning a filled out ResultSet (whether or not it found anything). Here it is assumed that the detector pointer really points to a DetectorI (a detector instance).
typedef bool(* cvac::GetImageSizeFunction)(std::string filename, int &width, int &height) |
A function to call to get the width and height in pixels of an image. Return true and the size if the image could be opened, else return false.
typedef pair<string,MediaConverter*> cvac::rsMediaPair |
typedef string cvac::rsMediaType |
typedef std::set<std::string> cvac::StringSet |
enum cvac::Interpolation |
A Track: A sequence of Locations in a Video - note that all Locations have the same label. The annotations can be interpreted as DISCRETE annotations on the keyframes, as linearly interpolated in frames between the specified keyframes; or polynomially interpolated. Interpolation only makes sense for some types of Locations.
Enumerator | |
---|---|
DISCRETE | |
LINEAR | |
POLYNOMIAL |
enum cvac::PurposeType |
void cvac::addFilenamePair | ( | const std::string & | filename, |
const std::string & | symLinkName | ||
) |
void cvac::addFileToRunSet | ( | cvac::RunSet & | runSet, |
const std::string & | relativePath, | ||
const std::string & | filename, | ||
const cvac::Purpose & | purpose | ||
) |
Add a file path to a RunSet reference, under the given purpopse.
runSet,: | The target runset |
relativePath,: | The media file path to be added, relative to working dir |
filename,: | The media file name to be added |
purpose | The purpose describing intent and content of the media file |
void cvac::addFileToRunSet | ( | cvac::RunSet & | runSet, |
const std::string & | relativePath, | ||
const std::string & | filename, | ||
int | classID | ||
) |
Add a file path to a RunSet reference, under the given purpopse.
runSet,: | The target runset |
relativePath,: | The media file path to be added, relative to working dir |
filename,: | The media file name to be added |
classID,: | Identifying class for media file |
void cvac::addToRunSet | ( | RunSet & | runSet, |
const std::string & | relativePath, | ||
const std::string & | filename, | ||
const Purpose & | purpose, | ||
LocationPtr | loc = NULL |
||
) |
void cvac::addToRunSet | ( | RunSet & | runSet, |
const std::string & | relativePath, | ||
const std::string & | filename, | ||
int | classID, | ||
LocationPtr | loc = NULL |
||
) |
void cvac::cleanupRectangleLabels | ( | std::vector< RectangleLabels > * | rects | ) |
Cleanup the memory allocated inside the RectangleLabels but not the RectangleLabels itself
Delete all the BBoxPtrs
bool cvac::compatiblePurpose | ( | const cvac::Purpose & | actual, |
const cvac::Purpose & | constraint | ||
) |
Ensure 'actual' purpose is compatible with the constraint
bool cvac::containsIllegalChars | ( | FilePath | filePath | ) |
bool cvac::copyFile | ( | const std::string & | fromFile, |
const std::string & | toFile | ||
) |
Copy a file
fromFile | source file |
toFile | destination file |
bool cvac::deleteDirectory | ( | const std::string & | path | ) |
Remove the contents of the directory and delete the directory.
path | of the directory to remove |
ResultSet cvac::detect | ( | const std::string & | algorithm, |
const cvac::RunSet & | runset, | ||
const cvac::FilePath & | model, | ||
const cvac::DetectorProperties * | detprops | ||
) |
A convenience function that creates the callback, collects results, and makes them available in the return argument. If you don't want to configure the detector beyond the default then pass NULL in props.
A convenience function that creates the callback, collects results, and makes them available in the return argument.
bool cvac::directoryExists | ( | const std::string & | directory | ) |
Does the supplied directory exist?
directory | The path to the directory to verify |
bool cvac::fileExists | ( | const std::string & | abspath | ) |
Does the supplied file exists? Must be specified as absolute path. This implementation may not be able to handle the file which is larger than 2GB.
abspath | (directory + filename) to verify |
std::string cvac::fixupRunSet | ( | RunSet & | run, |
const std::string & | CVAC_DataDir | ||
) |
Fix the Run Set by linking files with illegal names (containing spaces) to valid file names. These links are stored in the directory name returned and should be deleted after the run set is finished being processed.
Fixes the RunSet files so they don't contain spaces. Returns the directory of symbolic links created. This will need to be deleted after the run set is used.
std::string cvac::getBaseFileName | ( | const std::string & | fileName | ) |
Get the base of a file name without the path or extension. This contains all the characters of the file name up to the first '.' character.
fileName | The full file name, with or without path |
std::string cvac::getClientConnectionName | ( | const Ice::Current & | cur | ) |
Return the remote address name of the client given this current.
std::string cvac::getCurrentWorkingDirectory | ( | ) |
Return the working directory that exists at the time of this function call
string cvac::getCVACDataDir | ( | const std::string & | algorithm | ) |
Get The value of the CVAC_DataDir from the config file
std::string cvac::getDateFilename | ( | const std::string & | basedir = "" , |
const std::string & | prefix = "" |
||
) |
Return a filename formated by the date and time. If basedir is not defined then the file name is a relative filename
basedir | - Base directory of the dated filename. |
prefix | - Prefix the file name with prefix_. |
std::string cvac::getFileDirectory | ( | const std::string & | fileName | ) |
Extract just the path to the supplied fully-qualified file name.
fileName | the full path and file name |
std::string cvac::getFileExtension | ( | const std::string & | path | ) |
Get the file extension, excluding the path and the filename.
path | (directory + filename) |
std::string cvac::getFileName | ( | const std::string & | fileName | ) |
Get the file name, excluding the path.
fileName | The file name with path to extract just the file name from |
std::string cvac::getFSPath | ( | const cvac::FilePath & | fp, |
const std::string & | CVAC_DataDir = "" |
||
) |
Turn a CVAC path info a file system path
fp | The filepath to change |
CVAC_DataDir | The CVAC data directory |
Turn a CVAC path into a file system path
std::string cvac::getLegalPath | ( | std::string | putLinksDir, |
FilePath | filePath, | ||
bool & | newSymlink | ||
) |
Return path of a new symlink if fname contains illegal chars, or original path otherwise. The map between old and new names is managed directly by clients outside this function.
Return path of a new symlink if fname contains illegal chars, or original path otherwise. The map between old and new names is managed directly by clients outside this function. If links need to be created, they'll be put into putLinksDir, which will be created on demand.
string cvac::getLowercase | ( | const string & | _str | ) |
string cvac::getPurposeName | ( | const cvac::Purpose & | purpose | ) |
Produce a string identifier for the given Purpose.
Returns a string to identify the purpose or an int to identify a multiclass class ID.
std::string cvac::getSymlinkSubstitution | ( | const std::string & | illegalFileName | ) |
replace space with underscore in illegalFileName and return result
std::string cvac::getTempFilename | ( | const std::string & | basedir = "" , |
const std::string & | prefix = "" |
||
) |
Return a unique temporary file name. If basedir is not defined then the file name is in the current systems temporary file .
basedir | - Base directory of the temp filename. |
prefix | - Prefix the file name with this. |
VLogger & cvac::getVLogger | ( | ) |
Get The cvac logger
void cvac::localAndClientMsg | ( | VLogger::Levels | level, |
const CallbackHandlerPrx & | callbackHandler, | ||
const char * | fmt, | ||
... | |||
) |
Echo message both locally ('printv'), and by sending a client message only if there is adequate verbosity level.
level | Verbosity level inherent to the message. |
callbackHandler | A reference to the Ice client callbackHandler object. |
fmt | Format string and arguments akin to printf |
bool cvac::makeDirectories | ( | const std::string & | path | ) |
Make each directory based on the supplied path as required.
path | The directory tree to create. |
bool cvac::makeDirectory | ( | const std::string & | path | ) |
Make a directory based on the supplied path. This will only create one level of directory (i.e., it won't create every directory in the path).
path | The directory to create (assumes the path's parent exists) |
bool cvac::makeSymlinkFile | ( | const std::string | linkFullPath, |
const std::string | tgtFile | ||
) |
Create a symlink given the parameters using the appropriate Windows or Linux API command.
linkFullPath,: | Path to the link file which will be created. |
tgtFile |
bool cvac::pathAbsolute | ( | const std::string & | path | ) |
Returns true if the path is absolute
path | the file path or directory path in question |
int cvac::processLabelArtifactsToRects | ( | cvac::RunSetWrapper & | wrapper, |
cvac::RunSetConstraint & | constraint, | ||
std::string | cvacDataDir, | ||
cvac::ServiceManager * | serviceMan, | ||
const CallbackHandlerPrx & | callback, | ||
GetImageSizeFunction | sfunc, | ||
int | skipFrames, | ||
std::vector< RectangleLabels > * | result, | ||
bool | square | ||
) |
Return the filenames and rectangles listed in artifacts. If no artifacts listed then have a single rectangle of the size of the image file.
int cvac::processLabelArtifactsToRects | ( | LabelableList * | artifacts, |
GetImageSizeFunction | sfunc, | ||
std::vector< RectangleLabels > * | result, | ||
bool | square, | ||
std::string | cvacDataDir | ||
) |
Process a LabelableList and fill the result data with the information. If the LabelableList has no data but the sfunc is not null then there will be a single rectangle that is the size of the image.
artifacts | - the image list containing images and ploygons. |
sfunc | - The function to call to get the size of the image when LabelableList has no size data. This can be null. |
result | - vector of rectangles returned by the function. |
square | - If the function should return rectangles that are square. Default is false. |
cvacDataDir | - CVAC data folder root |
Return the filenames and rectangles listed in artifacts. If no artifacts listed then have a single rectangle of the size of the image file.
void cvac::processRunSet | ( | DetectorPtr | detector, |
const DetectorCallbackHandlerPrx & | client, | ||
DoDetectFunc | detectFunc, | ||
const RunSet & | run, | ||
const std::string & | pathPrefix, | ||
ServiceManager * | servMan | ||
) |
Process a RunSet calling the passed in DoDetectFunc for each file in to be processed and then calling the DetectorCallbacHandler with that result.
void cvac::sendResultsToClient | ( | const DetectorCallbackHandlerPrx & | client, |
const ResultSet & | results | ||
) |
void cvac::sleep | ( | int | numberOfMilliseconds | ) |
StringSet cvac::startServices | ( | ) |
Start the services as per config file; this won't re-start the services if they are already running. Still, avoid calling this multiple times because it will access the file system several times. It returns the names of running services.
sequence< byte > cvac::ByteSeq |
This is a placeholder for the algorithm-internal data that turns a generic "object" detection algorithm into a detector for, say, faces, or cars, etc.; We also use it to transfer files.
const bool cvac::CVACFALSE = false |
sequence<FrameLocation> cvac::FrameLocationList |
sequence<Labelable> cvac::LabelableList |
dictionary<string, string> cvac::LabelProperties |
LabelProperties are name-value pairs that can specify such aspects of Labelable image artifacts as their orientation towards the camera "face_orientation = frontal" or simply a collection of properties such as "hairy" "purrs" "has_claws" etc.
const int cvac::MINUSONE = -1 |
This is required to fix a defect with slice2c++ not initializing floats correctly (bad type cast).
sequence<Point2D> cvac::Point2DList |
dictionary<string, string> cvac::Properties |
sequence<PurposedList> cvac::PurposedListSequence |
sequence<Result> cvac::ResultList |
sequence<string> cvac::StringList |