MyCaffe  1.11.7.7
Deep learning software for Windows C# programmers.
MyCaffe.db.image.MyCaffeImageDatabase2 Class Reference

[V2 Image Database] The MyCaffeImageDatabase2 provides an enhanced in-memory image database used for quick image retrieval. More...

Inheritance diagram for MyCaffe.db.image.MyCaffeImageDatabase2:

Public Member Functions

 MyCaffeImageDatabase2 (Log log=null, string strId="default", int nSeed=0)
 The MyCaffeImageDatabase2 constructor. More...
 
 MyCaffeImageDatabase2 (IContainer container)
 The MyCaffeImageDatabase constructor. More...
 
IMGDB_VERSION GetVersion ()
 Returns the version of the MyCaffe Image Database being used. More...
 
void SetConnection (ConnectInfo ci)
 Set the database connection to use. More...
 
long InitializeWithDsName (SettingsCaffe s, string strDs, string strEvtCancel=null)
 Initializes the image database. More...
 
long InitializeWithDs (SettingsCaffe s, DatasetDescriptor ds, string strEvtCancel=null)
 Initializes the image database. More...
 
long InitializeWithDsId (SettingsCaffe s, int nDataSetID, string strEvtCancel=null, int nPadW=0, int nPadH=0)
 Initializes the image database. More...
 
bool InitializeWithDsName1 (SettingsCaffe s, string strDs, string strEvtCancel=null)
 Initializes the image database. More...
 
bool InitializeWithDs1 (SettingsCaffe s, DatasetDescriptor ds, string strEvtCancel=null)
 Initializes the image database. More...
 
bool InitializeWithDsId1 (SettingsCaffe s, int nDataSetID, string strEvtCancel=null, int nPadW=0, int nPadH=0)
 Initializes the image database. More...
 
void CleanUp (int nDsId=0, bool bForce=false)
 Releases the image database, and if this is the last instance using the in-memory database, frees all memory used. More...
 
bool WaitForDatasetToLoad (int nDsId, bool bTraining, bool bTesting, int nWait=int.MaxValue)
 Wait for the dataset loading to complete. More...
 
bool WaitForDatasetToLoad (string strDs, bool bTraining, bool bTesting, int nWait=int.MaxValue)
 Wait for the dataset loading to complete. More...
 
bool ReloadIndexing (int nDsId)
 Reload the indexing for a data set. More...
 
bool ReloadIndexing (string strDs)
 Reload the indexing for a data set. More...
 
bool WaitForDatasetToRefresh (int nDsId, bool bTraining, bool bTesting, int nWait=int.MaxValue)
 Wait for the dataset refreshing to complete. More...
 
bool WaitForDatasetToRefresh (string strDs, bool bTraining, bool bTesting, int nWait=int.MaxValue)
 Wait for the dataset refreshing to complete. More...
 
bool IsRefreshRunning (int nDsId, bool bTraining, bool bTesting)
 Returns true if the refresh operation running. More...
 
bool IsRefreshRunning (string strDs, bool bTraining, bool bTesting)
 Returns true if the refresh operation running. More...
 
bool StartRefresh (string strDs, bool bTraining, bool bTesting, double dfReplacementPct)
 Start a refresh on the dataset by replacing a specified percentage of the images with images from the physical database. More...
 
bool StopRefresh (string strDs, bool bTraining, bool bTesting)
 Stop a refresh operation running on the dataset. More...
 
bool StartRefresh (int nDsID, bool bTraining, bool bTesting, double dfReplacementPct)
 Start a refresh on the dataset by replacing a specified percentage of the images with images from the physical database. More...
 
bool StopRefresh (int nDsID, bool bTraining, bool bTesting)
 Stop a refresh operation running on the dataset. More...
 
bool StartAutomaticRefreshSchedule (string strDs, bool bTraining, bool bTesting, int nPeriodInMs, double dfReplacementPct)
 Start the automatic refresh cycle to occur on specified period increments. More...
 
bool StopAutomaticRefreshSchedule (string strDs, bool bTraining, bool bTesting)
 Stop the automatic refresh schedule running on a dataset. More...
 
bool GetScheduledAutoRefreshInformation (string strDs, out int nPeriodInMs, out double dfReplacementPct, out int nTrainingRefreshCount, out int nTestingRefreshCount)
 Returns whether or not a scheduled refresh is running and if so at what period and replacement percent. More...
 
bool StartAutomaticRefreshSchedule (int nDsID, bool bTraining, bool bTesting, int nPeriodInMs, double dfReplacementPct)
 Start the automatic refresh cycle to occur on specified period increments. More...
 
bool StopAutomaticRefreshSchedule (int nDsID, bool bTraining, bool bTesting)
 Stop the automatic refresh schedule running on a dataset. More...
 
bool GetScheduledAutoRefreshInformation (int nDsID, out int nPeriodInMs, out double dfReplacementPct, out int nTrainingRefreshCount, out int nTestingRefreshCount)
 Returns whether or not a scheduled refresh is running and if so at what period and replacement percent. More...
 
long CreateQueryState (int nDsId, bool bUseUniqueLabelIndexes=true, bool bUseUniqueImageIndexes=true, IMGDB_SORT sort=IMGDB_SORT.NONE)
 Create a query state for a data set, optionally using a specific sorting method. More...
 
long CreateQueryState (string strDs, bool bUseUniqueLabelIndexes=true, bool bUseUniqueImageIndexes=true, IMGDB_SORT sort=IMGDB_SORT.NONE)
 Create a query state for a data set, optionally using a specific sorting method. More...
 
bool SetDefaultQueryState (int nDsId, long lQueryState)
 Set the default query state to the query state specified for the dataset specified. More...
 
bool SetDefaultQueryState (string strDs, long lQueryState)
 Set the default query state to the query state specified for the dataset specified. More...
 
bool FreeQueryState (int nDsId, long lHandle)
 Frees a query state from a given dataset. More...
 
bool FreeQueryState (string strDs, long lHandle)
 Frees a query state from a given dataset. More...
 
string GetBoostQueryHitPercentsAsTextFromSourceName (long lQueryState, string strSource)
 Returns the percentage of boosted images queried as text. More...
 
string GetLabelQueryHitPercentsAsTextFromSourceName (long lQueryState, string strSource)
 Returns a string with the query hit percent for each label (e.g. the percentage that each label has been queried). More...
 
string GetLabelQueryEpocsAsTextFromSourceName (long lQueryState, string strSource)
 Returns a string with the query epoch counts for each label (e.g. the number of times all images with the label have been queried). More...
 
string GetBoostQueryHitPercentsAsTextFromSourceName (string strSource)
 Returns a string with the query hit percent for each boost (e.g. the percentage that each boost value has been queried). More...
 
string GetLabelQueryHitPercentsAsTextFromSourceName (string strSource)
 Returns a string with the query hit percent for each label (e.g. the percentage that each label has been queried). More...
 
string GetLabelQueryEpocsAsTextFromSourceName (string strSource)
 Returns a string with the query epoch counts for each label (e.g. the number of times all images with the label have been queried). More...
 
bool GetLoadImageDataCriteria ()
 Returns whether or not the image data criteria is loaded with each image. More...
 
bool GetLoadImageDebugData ()
 Returns whether or not the image debug data is loaded with each image. More...
 
int GetImageCount (int nSrcId)
 Returns the number of images in a given data source. More...
 
int GetImageCount (int nSrcId, string strFilterVal=null, int? nBoostVal=null, bool bBoostValIsExact=false)
 Returns the number of images in a given data source, optionally only counting the boosted images. More...
 
int GetImageCount (long lQueryState, int nSrcId, string strFilterVal=null, int? nBoostVal=null, bool bBoostValIsExact=false)
 Returns the number of images in a given data source, optionally only counting the boosted images. More...
 
Tuple< IMGDB_LABEL_SELECTION_METHOD, IMGDB_IMAGE_SELECTION_METHODGetSelectionMethod ()
 Returns the label and image selection method used. More...
 
void SetSelectionMethod (IMGDB_LABEL_SELECTION_METHOD? lbl, IMGDB_IMAGE_SELECTION_METHOD? img)
 Sets the label and image selection methods. More...
 
void Enable (bool bEnable)
 Sets whether or not the image database is enabled. More...
 
List< SimpleDatumGetImagesFromIndex (int nSrcId, int nStartIdx, int nQueryCount=int.MaxValue, string strFilterVal=null, int? nBoostVal=null, bool bBoostValIsExact=false, bool bAttemptDirectLoad=false)
 Returns the array of images in the image set, possibly filtered with the filtering parameters. More...
 
List< SimpleDatumGetImagesFromTime (int nSrcId, DateTime dtStart, int nQueryCount=int.MaxValue, string strFilterVal=null, int? nBoostVal=null, bool bBoostValIsExact=false)
 Returns the array of images in the image set, possibly filtered with the filtering parameters. More...
 
List< SimpleDatumGetImagesFromIndex (long lQueryState, int nSrcId, int nStartIdx, int nQueryCount=int.MaxValue, string strFilterVal=null, int? nBoostVal=null, bool bBoostValIsExact=false, bool bAttemptDirectLoad=false)
 Returns the array of images in the image set, possibly filtered with the filtering parameters. More...
 
List< SimpleDatumGetImagesFromTime (long lQueryState, int nSrcId, DateTime dtStart, int nQueryCount=int.MaxValue, string strFilterVal=null, int? nBoostVal=null, bool bBoostValIsExact=false)
 Returns the array of images in the image set, possibly filtered with the filtering parameters. More...
 
List< SimpleDatumGetImages (int nSrcId, int[] rgIdx, string strFilterVal, int? nBoostVal, bool bBoostValIsExact=false)
 Returns the array of images in the image set, possibly filtered with the filtering parameters. More...
 
SimpleDatum QueryImage (long lQueryState, int nSrcId, int nIdx, IMGDB_LABEL_SELECTION_METHOD? labelSelectionOverride=null, IMGDB_IMAGE_SELECTION_METHOD? imageSelectionOverride=null, int? nLabel=null, bool bLoadDataCriteria=false, bool bLoadDebugData=false)
 Query an image in a given data source. More...
 
SimpleDatum QueryImage (int nSrcId, int nIdx, IMGDB_LABEL_SELECTION_METHOD? labelSelectionOverride=null, IMGDB_IMAGE_SELECTION_METHOD? imageSelectionOverride=null, int? nLabel=null, bool bLoadDataCriteria=false, bool bLoadDebugData=false)
 Query an image in a given data source. More...
 
SimpleDatum GetImage (int nImageID, params int[] rgSrcId)
 Returns the image with a given Raw Image ID. More...
 
int FindImageIndex (int nSrcId, DateTime dt, string strDescription)
 Searches fro the image index of an image within a data source matching a DateTime/description pattern. More...
 
SimpleDatum GetImageMean (int nSrcId)
 Returns the image mean for a data source. More...
 
void SetImageMean (int nSrcId, SimpleDatum d)
 Sets the image mean for a data source. More...
 
SimpleDatum QueryImageMeanFromDataset (int nDatasetId)
 Returns the image mean for the Training data source of a given data set. More...
 
SimpleDatum QueryImageMeanFromDb (int nSrcId)
 Queries the image mean for a data source from the database on disk. More...
 
void SaveImageMean (int nSrcId, SimpleDatum d, bool bUpdate)
 Saves the image mean to a data source on the database on disk. More...
 
SimpleDatum QueryImageMean (int nSrcId)
 Query the image mean for a data source and mask out (set to 0) all of the image except for the last columns. More...
 
bool DoesImageMeanExists (int nSrcId)
 Returns whether or not the image mean exists in the disk-based database for a given data source. More...
 
long LoadDatasetByName (string strDs, string strEvtCancel=null)
 Load another 'secondary' dataset. More...
 
long LoadDatasetByID (int nDsId, string strEvtCancel=null)
 Load another 'secondary' dataset. More...
 
bool LoadDatasetByID1 (int nDsId, string strEvtCancel=null)
 Load another, 'secondary' dataset. More...
 
bool LoadDatasetByName1 (string strDs, string strEvtCancel=null)
 Load another, 'secondary' dataset. More...
 
bool ReloadDataset (int nDsId)
 Reload a data set. More...
 
bool UnloadDatasetByName (string strDataset)
 The UnloadDataset method removes the dataset specified from memory. More...
 
bool UnloadDatasetById (int nDataSetID)
 The UnloadDataset method removes the dataset specified from memory. More...
 
double GetDatasetLoadedPercentByName (string strDataset, out double dfTraining, out double dfTesting)
 Returns the percentage that a dataset is loaded into memory. More...
 
double GetDatasetLoadedPercentById (int nDatasetID, out double dfTraining, out double dfTesting)
 Returns the percentage that a dataset is loaded into memory. More...
 
DatasetDescriptor GetDatasetById (int nDsId)
 Returns the DatasetDescriptor for a given data set ID. More...
 
DatasetDescriptor GetDatasetByName (string strDs)
 Returns the DatasetDescriptor for a given data set name. More...
 
int GetDatasetID (string strDs)
 Returns a data set ID given its name. More...
 
string GetDatasetName (int nDsId)
 Returns a data set name given its ID. More...
 
bool ReloadImageSet (int nSrcID)
 Reloads the images of a data source. More...
 
SourceDescriptor GetSourceById (int nSrcId)
 Returns the SourceDescriptor for a given data source ID. More...
 
SourceDescriptor GetSourceByName (string strSrc)
 Returns the SourceDescriptor for a given data source name. More...
 
int GetSourceID (string strSrc)
 Returns a data source ID given its name. More...
 
string GetSourceName (int nSrcId)
 Returns a data source name given its ID. More...
 
List< LabelDescriptorGetLabels (int nSrcId)
 Returns a list of LabelDescriptors associated with the labels within a data source. More...
 
string GetLabelName (int nSrcId, int nLabel)
 Returns the text name of a given label within a data source. More...
 
void SetLabelMapping (int nSrcId, LabelMapping map)
 Sets the label mapping to the database for a given data source. More...
 
void UpdateLabelMapping (int nSrcId, int nNewLabel, List< int > rgOriginalLabels)
 Updates the label mapping in the database for a given data source. More...
 
void ResetLabels (int nProjectId, int nSrcId)
 Resets all labels within a data source, used by a project, to their original labels. More...
 
void UpdateLabelCounts (int nProjectID, int nSrcId)
 Updates the number of images of each label within a data source. More...
 
Dictionary< int, int > LoadLabelCounts (int nSrcId)
 Returns a label lookup of counts for a given data source. More...
 
string GetLabelCountsAsTextFromSourceId (int nSrcId)
 Returns a string with all label counts for a data source. More...
 
string GetLabelCountsAsTextFromSourceName (string strSource)
 Returns a string with all label counts for a data source. More...
 
void ResetAllBoosts (int nSrcId)
 Reset all in-memory image boosts. More...
 
List< SimpleResultGetAllResults (string strSource, bool bRequireExtraData, int nMax=-1)
 Query all results for a given data source. More...
 

Static Public Member Functions

static void CreateDatabase (ConnectInfo ci, string strPath)
 Create the database used by the MyCaffeImageDatabase. More...
 
static Tuple< IMGDB_LABEL_SELECTION_METHOD, IMGDB_IMAGE_SELECTION_METHODGetSelectionMethod (SettingsCaffe s)
 Returns the label/image selection methods based on the SettingsCaffe settings. More...
 
static Tuple< IMGDB_LABEL_SELECTION_METHOD, IMGDB_IMAGE_SELECTION_METHODGetSelectionMethod (ProjectEx p)
 Returns the label/image selection methods based on the ProjectEx settings. More...
 

Protected Member Functions

override void Dispose (bool disposing)
 Clean up any resources being used. More...
 

Properties

Log OutputLog [getset]
 Get/set the output log. More...
 
bool UseTrainingImagesForTesting [getset]
 Get/set whether or not to use training images for the test set (default = false). More...
 
double SuperBoostProbability [getset]
 Get/set the super-boost probability which increases/decreases the probability of selecting a boosted image (default = 0). More...
 
bool SelectFromBoostOnly [get]
 Returns whether or not to select ONLY from boosted images. More...
 
bool IsEnabled [get]
 Returns whether or not the image database is enabled. More...
 
bool IsInitialized [get]
 Returns whether or not the image database is initialized. More...
 

Events

EventHandler< CalculateImageMeanArgsOnCalculateImageMean
 The OnCalculateImageMean event fires each time the MyCaffeImageDatabase wants to access the image mean for a data set. More...
 

Detailed Description

[V2 Image Database] The MyCaffeImageDatabase2 provides an enhanced in-memory image database used for quick image retrieval.

The MyCaffeImageDatbase2 manages a set of data sets, where each data sets comprise a pair of data sources: one source for training and another source for testing. Each data source contains a list of images and a list of label sets that point back into the list of images. This organization allows for quick image selection by image or by label set and then by image from within the label set.

Definition at line 27 of file MyCaffeImageDatabase2.cs.

Constructor & Destructor Documentation

◆ MyCaffeImageDatabase2() [1/2]

MyCaffe.db.image.MyCaffeImageDatabase2.MyCaffeImageDatabase2 ( Log  log = null,
string  strId = "default",
int  nSeed = 0 
)

The MyCaffeImageDatabase2 constructor.

Parameters
logThe Log for output.
strIdSpecifies an identifier for this in memory database instance (default = "default").
nSeedOptionally, specifies a seed for the random number generator (default = null).

Definition at line 64 of file MyCaffeImageDatabase2.cs.

◆ MyCaffeImageDatabase2() [2/2]

MyCaffe.db.image.MyCaffeImageDatabase2.MyCaffeImageDatabase2 ( IContainer  container)

The MyCaffeImageDatabase constructor.

Parameters
containerSpecifies a container.

Definition at line 80 of file MyCaffeImageDatabase2.cs.

Member Function Documentation

◆ CleanUp()

void MyCaffe.db.image.MyCaffeImageDatabase2.CleanUp ( int  nDsId = 0,
bool  bForce = false 
)

Releases the image database, and if this is the last instance using the in-memory database, frees all memory used.

Parameters
nDsIdOptionally, specifies the dataset previously loaded.
bForceOptionally, force the cleanup even if other users are using the database.

Definition at line 331 of file MyCaffeImageDatabase2.cs.

◆ CreateDatabase()

static void MyCaffe.db.image.MyCaffeImageDatabase2.CreateDatabase ( ConnectInfo  ci,
string  strPath 
)
static

Create the database used by the MyCaffeImageDatabase.

Parameters
ciSpecifies the connection information for the database (recommended value: db = 'DNN', server = '.')
strPathSpecifies the file path where the database is to be created.

Definition at line 465 of file MyCaffeImageDatabase2.cs.

◆ CreateQueryState() [1/2]

long MyCaffe.db.image.MyCaffeImageDatabase2.CreateQueryState ( int  nDsId,
bool  bUseUniqueLabelIndexes = true,
bool  bUseUniqueImageIndexes = true,
IMGDB_SORT  sort = IMGDB_SORT.NONE 
)

Create a query state for a data set, optionally using a specific sorting method.

Parameters
nDsIdSpecifies the ID of the data set.
bUseUniqueLabelIndexesOptionally, specifies to use unique label indexes which is slightly slower, but ensures each label is hit per epoch equally (default = true).
bUseUniqueImageIndexesOptionally, specifies to use unique image indexes which is slightly slower, but ensures each image is hit per epoch (default = true).
sortSpecifies the sorting method.
Returns
The new query state handle is returned.

Definition at line 757 of file MyCaffeImageDatabase2.cs.

◆ CreateQueryState() [2/2]

long MyCaffe.db.image.MyCaffeImageDatabase2.CreateQueryState ( string  strDs,
bool  bUseUniqueLabelIndexes = true,
bool  bUseUniqueImageIndexes = true,
IMGDB_SORT  sort = IMGDB_SORT.NONE 
)

Create a query state for a data set, optionally using a specific sorting method.

Parameters
strDsSpecifies the name of the data set.
bUseUniqueLabelIndexesOptionally, specifies to use unique label indexes which is slightly slower, but ensures each label is hit per epoch equally (default = true).
bUseUniqueImageIndexesOptionally, specifies to use unique image indexes which is slightly slower, but ensures each image is hit per epoch (default = true).
sortSpecifies the sorting method.
Returns
The new query state handle is returned.

Definition at line 774 of file MyCaffeImageDatabase2.cs.

◆ Dispose()

override void MyCaffe.db.image.MyCaffeImageDatabase2.Dispose ( bool  disposing)
protected

Clean up any resources being used.

Parameters
disposingtrue if managed resources should be disposed; otherwise, false.

Definition at line 14 of file MyCaffeImageDatabase2.Designer.cs.

◆ DoesImageMeanExists()

bool MyCaffe.db.image.MyCaffeImageDatabase2.DoesImageMeanExists ( int  nSrcId)

Returns whether or not the image mean exists in the disk-based database for a given data source.

Parameters
nSrcIdSpecifies the ID of the data source.
Returns
Returns true if the image mean exists, false otherwise.

Definition at line 1440 of file MyCaffeImageDatabase2.cs.

◆ Enable()

void MyCaffe.db.image.MyCaffeImageDatabase2.Enable ( bool  bEnable)

Sets whether or not the image database is enabled.

Parameters
bEnable

Definition at line 1113 of file MyCaffeImageDatabase2.cs.

◆ FindImageIndex()

int MyCaffe.db.image.MyCaffeImageDatabase2.FindImageIndex ( int  nSrcId,
DateTime  dt,
string  strDescription 
)

Searches fro the image index of an image within a data source matching a DateTime/description pattern.

Optionally, images may have a time-stamp and/or description associated with each image. In such cases searching by the time-stamp + description can be useful in some instances.

Parameters
nSrcIdSpecifies the data source ID of the data source to be searched.
dtSpecifies the time-stamp to search for.
strDescriptionSpecifies the description to search for.
Returns
If found the zero-based index of the image is returned, otherwise -1 is returned.

Definition at line 1324 of file MyCaffeImageDatabase2.cs.

◆ FreeQueryState() [1/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.FreeQueryState ( int  nDsId,
long  lHandle 
)

Frees a query state from a given dataset.

Parameters
nDsIdSpecifies the dataset on which to free the query state.
lHandleSpecifies the handle to the query state to free.
Returns
If found and freed, true is returned, otherwise false.

Definition at line 819 of file MyCaffeImageDatabase2.cs.

◆ FreeQueryState() [2/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.FreeQueryState ( string  strDs,
long  lHandle 
)

Frees a query state from a given dataset.

Parameters
strDsSpecifies the dataset name on which to free the query state.
lHandleSpecifies the handle to the query state to free.
Returns
If found and freed, true is returned, otherwise false.

Definition at line 830 of file MyCaffeImageDatabase2.cs.

◆ GetAllResults()

List< SimpleResult > MyCaffe.db.image.MyCaffeImageDatabase2.GetAllResults ( string  strSource,
bool  bRequireExtraData,
int  nMax = -1 
)

Query all results for a given data source.

Parameters
strSourceSpecifies the data source who's results are to be returned.
bRequireExtraDataspecifies whether or not the Extra 'target' data is required or not.
nMaxOptionally, specifies the maximum number of items to load.
Returns
Each result is returned in a SimpleResult object.

Definition at line 1961 of file MyCaffeImageDatabase2.cs.

◆ GetBoostQueryHitPercentsAsTextFromSourceName() [1/2]

string MyCaffe.db.image.MyCaffeImageDatabase2.GetBoostQueryHitPercentsAsTextFromSourceName ( long  lQueryState,
string  strSource 
)

Returns the percentage of boosted images queried as text.

Parameters
lQueryStateSpecifies the handle to the query state.
strSourceSpecifies the source to query.
Returns
The query boost percentage hit is returned as text.

Definition at line 841 of file MyCaffeImageDatabase2.cs.

◆ GetBoostQueryHitPercentsAsTextFromSourceName() [2/2]

string MyCaffe.db.image.MyCaffeImageDatabase2.GetBoostQueryHitPercentsAsTextFromSourceName ( string  strSource)

Returns a string with the query hit percent for each boost (e.g. the percentage that each boost value has been queried).

Parameters
strSourceSpecifies the data source who's hit percentages are to be retrieved.
Returns
A string representing the query hit percentages is returned.

Definition at line 873 of file MyCaffeImageDatabase2.cs.

◆ GetDatasetById()

DatasetDescriptor MyCaffe.db.image.MyCaffeImageDatabase2.GetDatasetById ( int  nDsId)

Returns the DatasetDescriptor for a given data set ID.

Parameters
nDsIdSpecifies the data set ID.
Returns
The dataset Descriptor is returned.

Definition at line 1711 of file MyCaffeImageDatabase2.cs.

◆ GetDatasetByName()

DatasetDescriptor MyCaffe.db.image.MyCaffeImageDatabase2.GetDatasetByName ( string  strDs)

Returns the DatasetDescriptor for a given data set name.

Parameters
strDsSpecifies the data set name.
Returns
The dataset Descriptor is returned.

Definition at line 1722 of file MyCaffeImageDatabase2.cs.

◆ GetDatasetID()

int MyCaffe.db.image.MyCaffeImageDatabase2.GetDatasetID ( string  strDs)

Returns a data set ID given its name.

Parameters
strDsSpecifies the data set name.
Returns
The data set ID is returned.

Definition at line 1733 of file MyCaffeImageDatabase2.cs.

◆ GetDatasetLoadedPercentById()

double MyCaffe.db.image.MyCaffeImageDatabase2.GetDatasetLoadedPercentById ( int  nDatasetID,
out double  dfTraining,
out double  dfTesting 
)

Returns the percentage that a dataset is loaded into memory.

Parameters
nDatasetIDSpecifies the ID of the dataset.
dfTrainingSpecifies the percent of training images that are loaded.
dfTestingSpecifies the percent of testing images that are loaded.
Returns
The current image load percent for the dataset is returned..

Definition at line 1689 of file MyCaffeImageDatabase2.cs.

◆ GetDatasetLoadedPercentByName()

double MyCaffe.db.image.MyCaffeImageDatabase2.GetDatasetLoadedPercentByName ( string  strDataset,
out double  dfTraining,
out double  dfTesting 
)

Returns the percentage that a dataset is loaded into memory.

Parameters
strDatasetSpecifies the name of the dataset.
dfTrainingSpecifies the percent of training images that are loaded.
dfTestingSpecifies the percent of testing images that are loaded.
Returns
The current image load percent for the dataset is returned..

Definition at line 1665 of file MyCaffeImageDatabase2.cs.

◆ GetDatasetName()

string MyCaffe.db.image.MyCaffeImageDatabase2.GetDatasetName ( int  nDsId)

Returns a data set name given its ID.

Parameters
nDsIdSpecifies the data set ID.
Returns
The data set name is returned.

Definition at line 1747 of file MyCaffeImageDatabase2.cs.

◆ GetImage()

SimpleDatum MyCaffe.db.image.MyCaffeImageDatabase2.GetImage ( int  nImageID,
params int[]  rgSrcId 
)

Returns the image with a given Raw Image ID.

Parameters
nImageIDSpecifies the Raw Image ID.
rgSrcIdSpecifies a set of source ID's to query from.
Returns
If found, the SimpleDatum of the Raw Image is returned, otherwise, null is returned.

Definition at line 1294 of file MyCaffeImageDatabase2.cs.

◆ GetImageCount() [1/3]

int MyCaffe.db.image.MyCaffeImageDatabase2.GetImageCount ( int  nSrcId)

Returns the number of images in a given data source.

Parameters
nSrcIdSpecifies the data source ID.
Returns
The number of images is returned.

Definition at line 932 of file MyCaffeImageDatabase2.cs.

◆ GetImageCount() [2/3]

int MyCaffe.db.image.MyCaffeImageDatabase2.GetImageCount ( int  nSrcId,
string  strFilterVal = null,
int?  nBoostVal = null,
bool  bBoostValIsExact = false 
)

Returns the number of images in a given data source, optionally only counting the boosted images.

Parameters
nSrcIdSpecifies the data source ID.
strFilterValOptionally, specifies the filter value that the description must match (default = null, which ignores this parameter).
nBoostValOptionally, specifies the boost value that the boost must match (default = null, which ignores this parameter).
bBoostValIsExactOptionally, specifies whether or the boost value (if specified) is to be used literally (exact = true), or as a minimum boost value.
Returns
The number of images is returned.

When using the 'nBoostValue' negative values are used to test the exact match of the boost value with the absolute value of the 'nBoostValue', ande positive values are used to test for boost values that are greater than or equal to the 'nBoostValue'.

Definition at line 952 of file MyCaffeImageDatabase2.cs.

◆ GetImageCount() [3/3]

int MyCaffe.db.image.MyCaffeImageDatabase2.GetImageCount ( long  lQueryState,
int  nSrcId,
string  strFilterVal = null,
int?  nBoostVal = null,
bool  bBoostValIsExact = false 
)

Returns the number of images in a given data source, optionally only counting the boosted images.

Parameters
lQueryStateSpecifies a handle to the query state to use.
nSrcIdSpecifies the data source ID.
strFilterValOptionally, specifies the filter value that the description must match (default = null, which ignores this parameter).
nBoostValOptionally, specifies the boost value that the boost must match (default = null, which ignores this parameter).
bBoostValIsExactOptionally, specifies whether or the boost value (if specified) is to be used literally (exact = true), or as a minimum boost value.
Returns
The number of images is returned.

When using the 'nBoostValue' negative values are used to test the exact match of the boost value with the absolute value of the 'nBoostValue', ande positive values are used to test for boost values that are greater than or equal to the 'nBoostValue'.

Definition at line 968 of file MyCaffeImageDatabase2.cs.

◆ GetImageMean()

SimpleDatum MyCaffe.db.image.MyCaffeImageDatabase2.GetImageMean ( int  nSrcId)

Returns the image mean for a data source.

Parameters
nSrcIdSpecifies the ID of the data source.
Returns
The image mean is returned as a SimpleDatum.

Definition at line 1338 of file MyCaffeImageDatabase2.cs.

◆ GetImages()

List< SimpleDatum > MyCaffe.db.image.MyCaffeImageDatabase2.GetImages ( int  nSrcId,
int[]  rgIdx,
string  strFilterVal,
int?  nBoostVal,
bool  bBoostValIsExact = false 
)

Returns the array of images in the image set, possibly filtered with the filtering parameters.

Parameters
nSrcIdSpecifies the data source ID.
rgIdxSpecifies an array of indexes to query.
strFilterValOptionally, specifies the filter value that the description must match (default = null, which ignores this parameter).
nBoostValOptionally, specifies the boost value that the boost must match (default = null, which ignores this parameter).
bBoostValIsExactOptionally, specifies whether or the boost value (if specified) is to be used literally (exact = true), or as a minimum boost value - currently, not used in Version 2.
Returns
The list of images is returned.

When using the 'nBoostValue' negative values are used to test the exact match of the boost value with the absolute value of the 'nBoostValue', ande positive values are used to test for boost values that are greater than or equal to the 'nBoostValue'.

Definition at line 1227 of file MyCaffeImageDatabase2.cs.

◆ GetImagesFromIndex() [1/2]

List< SimpleDatum > MyCaffe.db.image.MyCaffeImageDatabase2.GetImagesFromIndex ( int  nSrcId,
int  nStartIdx,
int  nQueryCount = int.MaxValue,
string  strFilterVal = null,
int?  nBoostVal = null,
bool  bBoostValIsExact = false,
bool  bAttemptDirectLoad = false 
)

Returns the array of images in the image set, possibly filtered with the filtering parameters.

Parameters
nSrcIdSpecifies the data source ID.
nStartIdxSpecifies a starting index from which the query is to start within the set of images.
nQueryCountOptionally, specifies a number of images to retrieve within the set (default = int.MaxValue).
strFilterValOptionally, specifies the filter value that the description must match (default = null, which ignores this parameter).
nBoostValOptionally, specifies the boost value that the boost must match (default = null, which ignores this parameter).
bBoostValIsExactOptionally, specifies whether or the boost value (if specified) is to be used literally (exact = true), or as a minimum boost value.
bAttemptDirectLoadOptionaly, specifies to directly load all images not already loaded.
Returns
The list of images is returned.

When using the 'nBoostValue' negative values are used to test the exact match of the boost value with the absolute value of the 'nBoostValue', ande positive values are used to test for boost values that are greater than or equal to the 'nBoostValue'.

Definition at line 1143 of file MyCaffeImageDatabase2.cs.

◆ GetImagesFromIndex() [2/2]

List< SimpleDatum > MyCaffe.db.image.MyCaffeImageDatabase2.GetImagesFromIndex ( long  lQueryState,
int  nSrcId,
int  nStartIdx,
int  nQueryCount = int.MaxValue,
string  strFilterVal = null,
int?  nBoostVal = null,
bool  bBoostValIsExact = false,
bool  bAttemptDirectLoad = false 
)

Returns the array of images in the image set, possibly filtered with the filtering parameters.

Parameters
lQueryStateSpecifies a handle to the query state to use.
nSrcIdSpecifies the data source ID.
nStartIdxSpecifies a starting index from which the query is to start within the set of images.
nQueryCountOptionally, specifies a number of images to retrieve within the set (default = int.MaxValue).
strFilterValOptionally, specifies the filter value that the description must match (default = null, which ignores this parameter).
nBoostValOptionally, specifies the boost value that the boost must match (default = null, which ignores this parameter).
bBoostValIsExactOptionally, specifies whether or the boost value (if specified) is to be used literally (exact = true), or as a minimum boost value.
bAttemptDirectLoadOptionaly, specifies to directly load all images not already loaded.
Returns
The list of images is returned.

When using the 'nBoostValue' negative values are used to test the exact match of the boost value with the absolute value of the 'nBoostValue', ande positive values are used to test for boost values that are greater than or equal to the 'nBoostValue'.

Definition at line 1179 of file MyCaffeImageDatabase2.cs.

◆ GetImagesFromTime() [1/2]

List< SimpleDatum > MyCaffe.db.image.MyCaffeImageDatabase2.GetImagesFromTime ( int  nSrcId,
DateTime  dtStart,
int  nQueryCount = int.MaxValue,
string  strFilterVal = null,
int?  nBoostVal = null,
bool  bBoostValIsExact = false 
)

Returns the array of images in the image set, possibly filtered with the filtering parameters.

Parameters
nSrcIdSpecifies the data source ID.
dtStartSpecifies a starting time from which the query is to start within the set of images.
nQueryCountOptionally, specifies a number of images to retrieve within the set (default = int.MaxValue).
strFilterValOptionally, specifies the filter value that the description must match (default = null, which ignores this parameter).
nBoostValOptionally, specifies the boost value that the boost must match (default = null, which ignores this parameter).
bBoostValIsExactOptionally, specifies whether or the boost value (if specified) is to be used literally (exact = true), or as a minimum boost value.
Returns
The list of images is returned.

When using the 'nBoostValue' negative values are used to test the exact match of the boost value with the absolute value of the 'nBoostValue', ande positive values are used to test for boost values that are greater than or equal to the 'nBoostValue'.

Definition at line 1160 of file MyCaffeImageDatabase2.cs.

◆ GetImagesFromTime() [2/2]

List< SimpleDatum > MyCaffe.db.image.MyCaffeImageDatabase2.GetImagesFromTime ( long  lQueryState,
int  nSrcId,
DateTime  dtStart,
int  nQueryCount = int.MaxValue,
string  strFilterVal = null,
int?  nBoostVal = null,
bool  bBoostValIsExact = false 
)

Returns the array of images in the image set, possibly filtered with the filtering parameters.

Parameters
lQueryStateSpecifies a handle to the query state to use.
nSrcIdSpecifies the data source ID.
dtStartSpecifies a starting time from which the query is to start within the set of images.
nQueryCountOptionally, specifies a number of images to retrieve within the set (default = int.MaxValue).
strFilterValOptionally, specifies the filter value that the description must match (default = null, which ignores this parameter).
nBoostValOptionally, specifies the boost value that the boost must match (default = null, which ignores this parameter).
bBoostValIsExactOptionally, specifies whether or the boost value (if specified) is to be used literally (exact = true), or as a minimum boost value.
Returns
The list of images is returned.

When using the 'nBoostValue' negative values are used to test the exact match of the boost value with the absolute value of the 'nBoostValue', ande positive values are used to test for boost values that are greater than or equal to the 'nBoostValue'.

Definition at line 1204 of file MyCaffeImageDatabase2.cs.

◆ GetLabelCountsAsTextFromSourceId()

string MyCaffe.db.image.MyCaffeImageDatabase2.GetLabelCountsAsTextFromSourceId ( int  nSrcId)

Returns a string with all label counts for a data source.

Parameters
nSrcIdSpecifies the ID of the data source.
Returns
A string containing all label counts is returned.

Definition at line 1914 of file MyCaffeImageDatabase2.cs.

◆ GetLabelCountsAsTextFromSourceName()

string MyCaffe.db.image.MyCaffeImageDatabase2.GetLabelCountsAsTextFromSourceName ( string  strSource)

Returns a string with all label counts for a data source.

Parameters
strSourceSpecifies the name of the data source.
Returns
A string containing all label counts is returned.

Definition at line 1924 of file MyCaffeImageDatabase2.cs.

◆ GetLabelName()

string MyCaffe.db.image.MyCaffeImageDatabase2.GetLabelName ( int  nSrcId,
int  nLabel 
)

Returns the text name of a given label within a data source.

Parameters
nSrcIdSpecifies the data source ID.
nLabelSpecifies the label.
Returns
The laben name is returned as a string.

Definition at line 1853 of file MyCaffeImageDatabase2.cs.

◆ GetLabelQueryEpocsAsTextFromSourceName() [1/2]

string MyCaffe.db.image.MyCaffeImageDatabase2.GetLabelQueryEpocsAsTextFromSourceName ( long  lQueryState,
string  strSource 
)

Returns a string with the query epoch counts for each label (e.g. the number of times all images with the label have been queried).

Parameters
lQueryStateSpecifies the handle to the query state.
strSourceSpecifies the data source who's query epochs are to be retrieved.
Returns
A string representing the query epoch counts is returned.

Definition at line 863 of file MyCaffeImageDatabase2.cs.

◆ GetLabelQueryEpocsAsTextFromSourceName() [2/2]

string MyCaffe.db.image.MyCaffeImageDatabase2.GetLabelQueryEpocsAsTextFromSourceName ( string  strSource)

Returns a string with the query epoch counts for each label (e.g. the number of times all images with the label have been queried).

Parameters
strSourceSpecifies the data source who's query epochs are to be retrieved.
Returns
A string representing the query epoch counts is returned.

Definition at line 893 of file MyCaffeImageDatabase2.cs.

◆ GetLabelQueryHitPercentsAsTextFromSourceName() [1/2]

string MyCaffe.db.image.MyCaffeImageDatabase2.GetLabelQueryHitPercentsAsTextFromSourceName ( long  lQueryState,
string  strSource 
)

Returns a string with the query hit percent for each label (e.g. the percentage that each label has been queried).

Parameters
lQueryStateSpecifies the handle to the query state.
strSourceSpecifies the data source who's hit percentages are to be retrieved.
Returns
A string representing the query hit percentages is returned.

Definition at line 852 of file MyCaffeImageDatabase2.cs.

◆ GetLabelQueryHitPercentsAsTextFromSourceName() [2/2]

string MyCaffe.db.image.MyCaffeImageDatabase2.GetLabelQueryHitPercentsAsTextFromSourceName ( string  strSource)

Returns a string with the query hit percent for each label (e.g. the percentage that each label has been queried).

Parameters
strSourceSpecifies the data source who's hit percentages are to be retrieved.
Returns
A string representing the query hit percentages is returned.

Definition at line 883 of file MyCaffeImageDatabase2.cs.

◆ GetLabels()

List< LabelDescriptor > MyCaffe.db.image.MyCaffeImageDatabase2.GetLabels ( int  nSrcId)

Returns a list of LabelDescriptors associated with the labels within a data source.

Parameters
nSrcIdSpecifies the data source ID.
Returns
The list of LabelDescriptors is returned.

Definition at line 1842 of file MyCaffeImageDatabase2.cs.

◆ GetLoadImageDataCriteria()

bool MyCaffe.db.image.MyCaffeImageDatabase2.GetLoadImageDataCriteria ( )

Returns whether or not the image data criteria is loaded with each image.

Definition at line 914 of file MyCaffeImageDatabase2.cs.

◆ GetLoadImageDebugData()

bool MyCaffe.db.image.MyCaffeImageDatabase2.GetLoadImageDebugData ( )

Returns whether or not the image debug data is loaded with each image.

Definition at line 922 of file MyCaffeImageDatabase2.cs.

◆ GetScheduledAutoRefreshInformation() [1/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.GetScheduledAutoRefreshInformation ( int  nDsID,
out int  nPeriodInMs,
out double  dfReplacementPct,
out int  nTrainingRefreshCount,
out int  nTestingRefreshCount 
)

Returns whether or not a scheduled refresh is running and if so at what period and replacement percent.

Parameters
nDsIDSpecifies the dataset name for which the automatic refresh cycle is to run.
nPeriodInMsReturns the period in milliseconds over which the auto refresh cycle is run.
dfReplacementPctReturns the percentage of replacement to use on each cycle.
nTrainingRefreshCountReturns the training refrsh count.
nTestingRefreshCountReturns the testing refresh count.
Returns
If the refresh schedule is running, true is returned, otherwise false.

Definition at line 731 of file MyCaffeImageDatabase2.cs.

◆ GetScheduledAutoRefreshInformation() [2/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.GetScheduledAutoRefreshInformation ( string  strDs,
out int  nPeriodInMs,
out double  dfReplacementPct,
out int  nTrainingRefreshCount,
out int  nTestingRefreshCount 
)

Returns whether or not a scheduled refresh is running and if so at what period and replacement percent.

Parameters
strDsSpecifies the dataset name for which the automatic refresh cycle is to run.
nPeriodInMsReturns the period in milliseconds over which the auto refresh cycle is run.
dfReplacementPctReturns the percentage of replacement to use on each cycle.
nTrainingRefreshCountReturns the training refrsh count.
nTestingRefreshCountReturns the testing refresh count.
Returns
If the refresh schedule is running, true is returned, otherwise false.

Definition at line 671 of file MyCaffeImageDatabase2.cs.

◆ GetSelectionMethod() [1/3]

Tuple< IMGDB_LABEL_SELECTION_METHOD, IMGDB_IMAGE_SELECTION_METHOD > MyCaffe.db.image.MyCaffeImageDatabase2.GetSelectionMethod ( )

Returns the label and image selection method used.

Returns
A KeyValue containing the Label and Image selection method.

Definition at line 1045 of file MyCaffeImageDatabase2.cs.

◆ GetSelectionMethod() [2/3]

static Tuple< IMGDB_LABEL_SELECTION_METHOD, IMGDB_IMAGE_SELECTION_METHOD > MyCaffe.db.image.MyCaffeImageDatabase2.GetSelectionMethod ( ProjectEx  p)
static

Returns the label/image selection methods based on the ProjectEx settings.

Parameters
pSpecifies the project.
Returns
The label/image selection method is returned.

Definition at line 1017 of file MyCaffeImageDatabase2.cs.

◆ GetSelectionMethod() [3/3]

static Tuple< IMGDB_LABEL_SELECTION_METHOD, IMGDB_IMAGE_SELECTION_METHOD > MyCaffe.db.image.MyCaffeImageDatabase2.GetSelectionMethod ( SettingsCaffe  s)
static

Returns the label/image selection methods based on the SettingsCaffe settings.

Parameters
sSpecifies the caffe settings.
Returns
The label/image selection method is returned.

Definition at line 985 of file MyCaffeImageDatabase2.cs.

◆ GetSourceById()

SourceDescriptor MyCaffe.db.image.MyCaffeImageDatabase2.GetSourceById ( int  nSrcId)

Returns the SourceDescriptor for a given data source ID.

Parameters
nSrcIdSpecifies the data source ID.
Returns
The SourceDescriptor is returned.

Definition at line 1782 of file MyCaffeImageDatabase2.cs.

◆ GetSourceByName()

SourceDescriptor MyCaffe.db.image.MyCaffeImageDatabase2.GetSourceByName ( string  strSrc)

Returns the SourceDescriptor for a given data source name.

Parameters
strSrcSpecifies the data source name.
Returns
The SourceDescriptor is returned.

Definition at line 1796 of file MyCaffeImageDatabase2.cs.

◆ GetSourceID()

int MyCaffe.db.image.MyCaffeImageDatabase2.GetSourceID ( string  strSrc)

Returns a data source ID given its name.

Parameters
strSrcSpecifies the data source name.
Returns
The data source ID is returned.

Definition at line 1810 of file MyCaffeImageDatabase2.cs.

◆ GetSourceName()

string MyCaffe.db.image.MyCaffeImageDatabase2.GetSourceName ( int  nSrcId)

Returns a data source name given its ID.

Parameters
nSrcIdSpecifies the data source ID.
Returns
The data source name is returned.

Definition at line 1824 of file MyCaffeImageDatabase2.cs.

◆ GetVersion()

IMGDB_VERSION MyCaffe.db.image.MyCaffeImageDatabase2.GetVersion ( )

Returns the version of the MyCaffe Image Database being used.

Returns
Returns the version.

Definition at line 92 of file MyCaffeImageDatabase2.cs.

◆ InitializeWithDs()

long MyCaffe.db.image.MyCaffeImageDatabase2.InitializeWithDs ( SettingsCaffe  s,
DatasetDescriptor  ds,
string  strEvtCancel = null 
)

Initializes the image database.

Parameters
sSpecifies the caffe settings.
dsSpecifies the data set to load.
strEvtCancelSpecifies the name of the CancelEvent used to cancel load operations.
Returns
Upon loading the dataset a handle to the default QueryState is returned (which is ordered by Index), or 0 on cancel.

Definition at line 127 of file MyCaffeImageDatabase2.cs.

◆ InitializeWithDs1()

bool MyCaffe.db.image.MyCaffeImageDatabase2.InitializeWithDs1 ( SettingsCaffe  s,
DatasetDescriptor  ds,
string  strEvtCancel = null 
)

Initializes the image database.

Parameters
sSpecifies the caffe settings.
dsSpecifies the data set to load.
strEvtCancelSpecifies the name of the CancelEvent used to cancel load operations.
Returns
Returns true on success, false otherwise.

Definition at line 287 of file MyCaffeImageDatabase2.cs.

◆ InitializeWithDsId()

long MyCaffe.db.image.MyCaffeImageDatabase2.InitializeWithDsId ( SettingsCaffe  s,
int  nDataSetID,
string  strEvtCancel = null,
int  nPadW = 0,
int  nPadH = 0 
)

Initializes the image database.

Parameters
sSpecifies the caffe settings.
nDataSetIDSpecifies the database ID of the data set to load.
strEvtCancelSpecifies the name of the CancelEvent used to cancel load operations.
nPadWSpecifies the padding to add to each image width (default = 0).
nPadHSpecifies the padding to add to each image height (default = 0).
Returns
Upon loading the dataset a handle to the default QueryState is returned (which is ordered by Index), or 0 on cancel.

Definition at line 152 of file MyCaffeImageDatabase2.cs.

◆ InitializeWithDsId1()

bool MyCaffe.db.image.MyCaffeImageDatabase2.InitializeWithDsId1 ( SettingsCaffe  s,
int  nDataSetID,
string  strEvtCancel = null,
int  nPadW = 0,
int  nPadH = 0 
)

Initializes the image database.

Parameters
sSpecifies the caffe settings.
nDataSetIDSpecifies the database ID of the data set to load.
strEvtCancelSpecifies the name of the CancelEvent used to cancel load operations.
nPadWSpecifies the padding to add to each image width (default = 0).
nPadHSpecifies the padding to add to each image height (default = 0).
Returns
Returns true on success, false otherwise.

Definition at line 305 of file MyCaffeImageDatabase2.cs.

◆ InitializeWithDsName()

long MyCaffe.db.image.MyCaffeImageDatabase2.InitializeWithDsName ( SettingsCaffe  s,
string  strDs,
string  strEvtCancel = null 
)

Initializes the image database.

Parameters
sSpecifies the caffe settings.
strDsSpecifies the data set to load.
strEvtCancelSpecifies the name of the CancelEvent used to cancel load operations.
Returns
Upon loading the dataset a handle to the default QueryState is returned (which is ordered by Index), or 0 on cancel.

Definition at line 115 of file MyCaffeImageDatabase2.cs.

◆ InitializeWithDsName1()

bool MyCaffe.db.image.MyCaffeImageDatabase2.InitializeWithDsName1 ( SettingsCaffe  s,
string  strDs,
string  strEvtCancel = null 
)

Initializes the image database.

Parameters
sSpecifies the caffe settings.
strDsSpecifies the data set to load.
strEvtCancelSpecifies the name of the CancelEvent used to cancel load operations.
Returns
Returns true on success, false otherwise.

Definition at line 271 of file MyCaffeImageDatabase2.cs.

◆ IsRefreshRunning() [1/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.IsRefreshRunning ( int  nDsId,
bool  bTraining,
bool  bTesting 
)

Returns true if the refresh operation running.

Parameters
nDsIdSpecifies the dataset ID.
bTrainingSpecifies to check the training data source for refresh.
bTestingSpecifies to check the testing data source for refresh.
Returns
If the refresh is running, true is returned, otherwise false.

Definition at line 522 of file MyCaffeImageDatabase2.cs.

◆ IsRefreshRunning() [2/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.IsRefreshRunning ( string  strDs,
bool  bTraining,
bool  bTesting 
)

Returns true if the refresh operation running.

Parameters
strDsSpecifies the dataset name.
bTrainingSpecifies to check the training data source for refresh.
bTestingSpecifies to check the testing data source for refresh.
Returns
If the refresh is running, true is returned, otherwise false.

Definition at line 538 of file MyCaffeImageDatabase2.cs.

◆ LoadDatasetByID()

long MyCaffe.db.image.MyCaffeImageDatabase2.LoadDatasetByID ( int  nDsId,
string  strEvtCancel = null 
)

Load another 'secondary' dataset.

The primary dataset should be loaded using one of the 'Initialize' methods. This method is provided to allow for loading multiple datasets.

Parameters
nDsIdSpecifies the ID of the data set.
strEvtCancelSpecifies the name of the CancelEvent used to cancel load operations.
Returns
When loaded, the handle to the default query state is returned, otherwise 0 is returned.

Definition at line 1490 of file MyCaffeImageDatabase2.cs.

◆ LoadDatasetByID1()

bool MyCaffe.db.image.MyCaffeImageDatabase2.LoadDatasetByID1 ( int  nDsId,
string  strEvtCancel = null 
)

Load another, 'secondary' dataset.

The primary dataset should be loaded using one of the 'Initialize' methods. This method is provided to allow for loading multiple datasets.

Parameters
nDsIdSpecifies the ID of the data set.
strEvtCancelSpecifies the name of the CancelEvent used to cancel load operations.
Returns
When loaded, the handle to the default query state is returned, otherwise 0 is returned.

Definition at line 1546 of file MyCaffeImageDatabase2.cs.

◆ LoadDatasetByName()

long MyCaffe.db.image.MyCaffeImageDatabase2.LoadDatasetByName ( string  strDs,
string  strEvtCancel = null 
)

Load another 'secondary' dataset.

The primary dataset should be loaded using one of the 'Initialize' methods. This method is provided to allow for loading multiple datasets.

Parameters
strDsSpecifies the name of the data set.
strEvtCancelSpecifies the name of the CancelEvent used to cancel load operations.
Returns
When loaded, the handle to the default query state is returned, otherwise 0 is returned.

Definition at line 1474 of file MyCaffeImageDatabase2.cs.

◆ LoadDatasetByName1()

bool MyCaffe.db.image.MyCaffeImageDatabase2.LoadDatasetByName1 ( string  strDs,
string  strEvtCancel = null 
)

Load another, 'secondary' dataset.

The primary dataset should be loaded using one of the 'Initialize' methods. This method is provided to allow for loading multiple datasets.

Parameters
strDsSpecifies the name of the data set.
strEvtCancelSpecifies the name of the CancelEvent used to cancel load operations.
Returns
When loaded, the handle to the default query state is returned, otherwise 0 is returned.

Definition at line 1565 of file MyCaffeImageDatabase2.cs.

◆ LoadLabelCounts()

Dictionary< int, int > MyCaffe.db.image.MyCaffeImageDatabase2.LoadLabelCounts ( int  nSrcId)

Returns a label lookup of counts for a given data source.

Parameters
nSrcIdSpecifies the ID of the data source.
Returns
A dictionary containing label,count pairs is returned.

Definition at line 1904 of file MyCaffeImageDatabase2.cs.

◆ QueryImage() [1/2]

SimpleDatum MyCaffe.db.image.MyCaffeImageDatabase2.QueryImage ( int  nSrcId,
int  nIdx,
IMGDB_LABEL_SELECTION_METHOD labelSelectionOverride = null,
IMGDB_IMAGE_SELECTION_METHOD imageSelectionOverride = null,
int?  nLabel = null,
bool  bLoadDataCriteria = false,
bool  bLoadDebugData = false 
)

Query an image in a given data source.

Parameters
nSrcIdSpecifies the databse ID of the data source.
nIdxSpecifies the image index to query. Note, the index is only used in non-random image queries.
labelSelectionOverrideOptionally, specifies the label selection method override. The default = null, which directs the method to use the label selection method specified during Initialization.
imageSelectionOverrideOptionally, specifies the image selection method override. The default = null, which directs the method to use the image selection method specified during Initialization.
nLabelOptionally, specifies a label set to use for the image selection. When specified only images of this label are returned using the image selection method.
bLoadDataCriteriaSpecifies to load the data criteria data (default = false).
bLoadDebugDataSpecifies to load the debug data (default = false).
Returns
The image SimpleDatum is returned.

Definition at line 1283 of file MyCaffeImageDatabase2.cs.

◆ QueryImage() [2/2]

SimpleDatum MyCaffe.db.image.MyCaffeImageDatabase2.QueryImage ( long  lQueryState,
int  nSrcId,
int  nIdx,
IMGDB_LABEL_SELECTION_METHOD labelSelectionOverride = null,
IMGDB_IMAGE_SELECTION_METHOD imageSelectionOverride = null,
int?  nLabel = null,
bool  bLoadDataCriteria = false,
bool  bLoadDebugData = false 
)

Query an image in a given data source.

Parameters
lQueryStateSpecifies a handle to the query state to use.
nSrcIdSpecifies the databse ID of the data source.
nIdxSpecifies the image index to query. Note, the index is only used in non-random image queries.
labelSelectionOverrideOptionally, specifies the label selection method override. The default = null, which directs the method to use the label selection method specified during Initialization.
imageSelectionOverrideOptionally, specifies the image selection method override. The default = null, which directs the method to use the image selection method specified during Initialization.
nLabelOptionally, specifies a label set to use for the image selection. When specified only images of this label are returned using the image selection method.
bLoadDataCriteriaSpecifies to load the data criteria data (default = false).
bLoadDebugDataSpecifies to load the debug data (default = false).
Returns
The image SimpleDatum is returned.

Definition at line 1248 of file MyCaffeImageDatabase2.cs.

◆ QueryImageMean()

SimpleDatum MyCaffe.db.image.MyCaffeImageDatabase2.QueryImageMean ( int  nSrcId)

Query the image mean for a data source and mask out (set to 0) all of the image except for the last columns.

Parameters
nSrcIdSpecifies the ID of the data source.
Returns

Definition at line 1427 of file MyCaffeImageDatabase2.cs.

◆ QueryImageMeanFromDataset()

SimpleDatum MyCaffe.db.image.MyCaffeImageDatabase2.QueryImageMeanFromDataset ( int  nDatasetId)

Returns the image mean for the Training data source of a given data set.

Parameters
nDatasetIdSpecifies the data set to use.
Returns
The image mean is returned as a SimpleDatum.

Definition at line 1379 of file MyCaffeImageDatabase2.cs.

◆ QueryImageMeanFromDb()

SimpleDatum MyCaffe.db.image.MyCaffeImageDatabase2.QueryImageMeanFromDb ( int  nSrcId)

Queries the image mean for a data source from the database on disk.

If the image mean does not exist in the database, one is created, saved and then returned.

Parameters
nSrcIdSpecifies the ID of the data source.
Returns
The image mean is returned as a SimpleDatum.

Definition at line 1397 of file MyCaffeImageDatabase2.cs.

◆ ReloadDataset()

bool MyCaffe.db.image.MyCaffeImageDatabase2.ReloadDataset ( int  nDsId)

Reload a data set.

Parameters
nDsIdSpecifies the ID of the data set.
Returns
If the data set is found, true is returned, otherwise false is returned.

Definition at line 1579 of file MyCaffeImageDatabase2.cs.

◆ ReloadImageSet()

bool MyCaffe.db.image.MyCaffeImageDatabase2.ReloadImageSet ( int  nSrcID)

Reloads the images of a data source.

Parameters
nSrcIDSpecifies the ID of the data source.
Returns
If the data source is found, true is returned, otherwise false is returned.

Definition at line 1761 of file MyCaffeImageDatabase2.cs.

◆ ReloadIndexing() [1/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.ReloadIndexing ( int  nDsId)

Reload the indexing for a data set.

Parameters
nDsIdSpecifies the dataset ID.
Returns
If the data source(s) have their indexing reloaded, true is returned, otherwise false.

Definition at line 435 of file MyCaffeImageDatabase2.cs.

◆ ReloadIndexing() [2/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.ReloadIndexing ( string  strDs)

Reload the indexing for a data set.

Parameters
strDsSpecifies the dataset name.
Returns
If the data source(s) have their indexing reloaded, true is returned, otherwise false.

Definition at line 450 of file MyCaffeImageDatabase2.cs.

◆ ResetAllBoosts()

void MyCaffe.db.image.MyCaffeImageDatabase2.ResetAllBoosts ( int  nSrcId)

Reset all in-memory image boosts.

This does not impact the boost setting within the physical database.

Parameters
nSrcIdSpecifies the source ID of the data set to reset.

Definition at line 1940 of file MyCaffeImageDatabase2.cs.

◆ ResetLabels()

void MyCaffe.db.image.MyCaffeImageDatabase2.ResetLabels ( int  nProjectId,
int  nSrcId 
)

Resets all labels within a data source, used by a project, to their original labels.

Parameters
nProjectIdSpecifies the ID of the project.
nSrcIdSpecifies the ID of the data source.

Definition at line 1884 of file MyCaffeImageDatabase2.cs.

◆ SaveImageMean()

void MyCaffe.db.image.MyCaffeImageDatabase2.SaveImageMean ( int  nSrcId,
SimpleDatum  d,
bool  bUpdate 
)

Saves the image mean to a data source on the database on disk.

Parameters
nSrcIdSpecifies the ID of the data source.
dSpecifies a SimpleDatum containing the image mean.
bUpdateSpecifies whether or not to update the mean image.

Definition at line 1416 of file MyCaffeImageDatabase2.cs.

◆ SetConnection()

void MyCaffe.db.image.MyCaffeImageDatabase2.SetConnection ( ConnectInfo  ci)

Set the database connection to use.

Parameters
ciSpecifies the dataase connection information to use.

Definition at line 103 of file MyCaffeImageDatabase2.cs.

◆ SetDefaultQueryState() [1/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.SetDefaultQueryState ( int  nDsId,
long  lQueryState 
)

Set the default query state to the query state specified for the dataset specified.

Parameters
nDsIdSpecifies the dataset ID.
lQueryStateSpecifies the query state to set.
Returns
Returns true on success, false on failure.

Definition at line 789 of file MyCaffeImageDatabase2.cs.

◆ SetDefaultQueryState() [2/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.SetDefaultQueryState ( string  strDs,
long  lQueryState 
)

Set the default query state to the query state specified for the dataset specified.

Parameters
strDsSpecifies the dataset name.
lQueryStateSpecifies the query state to set.
Returns
Returns true on success, false on failure.

Definition at line 804 of file MyCaffeImageDatabase2.cs.

◆ SetImageMean()

void MyCaffe.db.image.MyCaffeImageDatabase2.SetImageMean ( int  nSrcId,
SimpleDatum  d 
)

Sets the image mean for a data source.

Parameters
nSrcIdSpecifies the ID of the data source.
dSpecifies a SimpleDatum containing the image mean.

Definition at line 1364 of file MyCaffeImageDatabase2.cs.

◆ SetLabelMapping()

void MyCaffe.db.image.MyCaffeImageDatabase2.SetLabelMapping ( int  nSrcId,
LabelMapping  map 
)

Sets the label mapping to the database for a given data source.

Parameters
nSrcIdSpecifies the ID of the data source.
mapSpecifies the label mapping to set.

Definition at line 1863 of file MyCaffeImageDatabase2.cs.

◆ SetSelectionMethod()

void MyCaffe.db.image.MyCaffeImageDatabase2.SetSelectionMethod ( IMGDB_LABEL_SELECTION_METHOD lbl,
IMGDB_IMAGE_SELECTION_METHOD img 
)

Sets the label and image selection methods.

Parameters
lblSpecifies the label selection method or null to ignore.
imgSpecifies the image selection method or null to ignore.

Definition at line 1055 of file MyCaffeImageDatabase2.cs.

◆ StartAutomaticRefreshSchedule() [1/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.StartAutomaticRefreshSchedule ( int  nDsID,
bool  bTraining,
bool  bTesting,
int  nPeriodInMs,
double  dfReplacementPct 
)

Start the automatic refresh cycle to occur on specified period increments.

Parameters
nDsIDSpecifies the dataset ID for which the automatic refresh cycle is to run.
bTrainingSpecifies the training data source to start refreshing.
bTestingSpecifies the testing data source to start refreshing.
nPeriodInMsSpecifies the period in milliseconds over which the auto refresh cycle is to run.
dfReplacementPctSpecifies the percentage of replacement to use on each cycle.
Returns
If successfully started, true is returned, otherwise false.

Definition at line 694 of file MyCaffeImageDatabase2.cs.

◆ StartAutomaticRefreshSchedule() [2/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.StartAutomaticRefreshSchedule ( string  strDs,
bool  bTraining,
bool  bTesting,
int  nPeriodInMs,
double  dfReplacementPct 
)

Start the automatic refresh cycle to occur on specified period increments.

Parameters
strDsSpecifies the dataset name for which the automatic refresh cycle is to run.
bTrainingSpecifies the training data source to start refreshing.
bTestingSpecifies the testing data source to start refreshing.
nPeriodInMsSpecifies the period in milliseconds over which the auto refresh cycle is to run.
dfReplacementPctSpecifies the percentage of replacement to use on each cycle.
Returns
If successfully started, true is returned, otherwise false.

Definition at line 634 of file MyCaffeImageDatabase2.cs.

◆ StartRefresh() [1/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.StartRefresh ( int  nDsID,
bool  bTraining,
bool  bTesting,
double  dfReplacementPct 
)

Start a refresh on the dataset by replacing a specified percentage of the images with images from the physical database.

Note, this method is only valid when initialized with LoadLimit > 0.

Parameters
nDsIDSpecifies the dataset ID.
bTrainingSpecifies the training data source to refresh.
bTestingSpecifies the testing data source to refresh.
dfReplacementPctOptionally, specifies the replacement percentage to use (default = 0.25 for 25%).
Returns
On succes, true is returned, otherwise false is returned.

Definition at line 597 of file MyCaffeImageDatabase2.cs.

◆ StartRefresh() [2/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.StartRefresh ( string  strDs,
bool  bTraining,
bool  bTesting,
double  dfReplacementPct 
)

Start a refresh on the dataset by replacing a specified percentage of the images with images from the physical database.

Note, this method is only valid when initialized with LoadLimit > 0.

Parameters
strDsSpecifies the dataset name.
bTrainingSpecifies the training data source to refresh.
bTestingSpecifies the testing data source to refresh.
dfReplacementPctOptionally, specifies the replacement percentage to use (default = 0.25 for 25%).
Returns
On succes, true is returned, otherwise false is returned.

Definition at line 558 of file MyCaffeImageDatabase2.cs.

◆ StopAutomaticRefreshSchedule() [1/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.StopAutomaticRefreshSchedule ( int  nDsID,
bool  bTraining,
bool  bTesting 
)

Stop the automatic refresh schedule running on a dataset.

Parameters
nDsIDSpecifies the dataset ID for which the automatic refresh cycle is to run.
bTrainingSpecifies the training data source to stop refreshing.
bTestingSpecifies the testing data source to stop refreshing.
Returns
If successfully stopped, true is returned, otherwise false.

Definition at line 713 of file MyCaffeImageDatabase2.cs.

◆ StopAutomaticRefreshSchedule() [2/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.StopAutomaticRefreshSchedule ( string  strDs,
bool  bTraining,
bool  bTesting 
)

Stop the automatic refresh schedule running on a dataset.

Parameters
strDsSpecifies the dataset name for which the automatic refresh cycle is to run.
bTrainingSpecifies the training data source to stop refreshing.
bTestingSpecifies the testing data source to stop refreshing.
Returns
If successfully stopped, true is returned, otherwise false.

Definition at line 653 of file MyCaffeImageDatabase2.cs.

◆ StopRefresh() [1/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.StopRefresh ( int  nDsID,
bool  bTraining,
bool  bTesting 
)

Stop a refresh operation running on the dataset.

Note, this method is only valid when initialized with LoadLimit > 0.

Parameters
nDsIDSpecifies the dataset ID.
bTrainingSpecifies the training data source to strop refreshing.
bTestingSpecifies the testing data source to stop refreshing.
Returns
On succes, true is returned, otherwise false is returned.

Definition at line 616 of file MyCaffeImageDatabase2.cs.

◆ StopRefresh() [2/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.StopRefresh ( string  strDs,
bool  bTraining,
bool  bTesting 
)

Stop a refresh operation running on the dataset.

Note, this method is only valid when initialized with LoadLimit > 0.

Parameters
strDsSpecifies the dataset name.
bTrainingSpecifies the training data source to strop refreshing.
bTestingSpecifies the testing data source to stop refreshing.
Returns
On succes, true is returned, otherwise false is returned.

Definition at line 577 of file MyCaffeImageDatabase2.cs.

◆ UnloadDatasetById()

bool MyCaffe.db.image.MyCaffeImageDatabase2.UnloadDatasetById ( int  nDataSetID)

The UnloadDataset method removes the dataset specified from memory.

Parameters
nDataSetIDSpecifies the dataset ID to remove.

Specifiying a dataset ID of -1 directs the UnloadDatasetById to unload ALL datasets loaded.

Returns
If found and removed, this function returns true, otherwise false is returned.

Definition at line 1627 of file MyCaffeImageDatabase2.cs.

◆ UnloadDatasetByName()

bool MyCaffe.db.image.MyCaffeImageDatabase2.UnloadDatasetByName ( string  strDataset)

The UnloadDataset method removes the dataset specified from memory.

Parameters
strDatasetSpecifies the dataset to remove.
Returns
If found and removed, this function returns true, otherwise false is returned.

Definition at line 1596 of file MyCaffeImageDatabase2.cs.

◆ UpdateLabelCounts()

void MyCaffe.db.image.MyCaffeImageDatabase2.UpdateLabelCounts ( int  nProjectID,
int  nSrcId 
)

Updates the number of images of each label within a data source.

Parameters
nProjectIDSpecifies a project ID.
nSrcIdSpecifies the ID of the data source.

Definition at line 1894 of file MyCaffeImageDatabase2.cs.

◆ UpdateLabelMapping()

void MyCaffe.db.image.MyCaffeImageDatabase2.UpdateLabelMapping ( int  nSrcId,
int  nNewLabel,
List< int >  rgOriginalLabels 
)

Updates the label mapping in the database for a given data source.

Parameters
nSrcIdSpecifies the ID of the data source.
nNewLabelSpecifies a new label.
rgOriginalLabelsSpecifies the original lables that are mapped to the new label.

Definition at line 1874 of file MyCaffeImageDatabase2.cs.

◆ WaitForDatasetToLoad() [1/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.WaitForDatasetToLoad ( int  nDsId,
bool  bTraining,
bool  bTesting,
int  nWait = int.MaxValue 
)

Wait for the dataset loading to complete.

Parameters
nDsIdSpecifies the dataset ID.
bTrainingSpecifies to wait for the training data source to load.
bTestingSpecifies to wait for the testing data source to load.
nWaitSpecifies the amount of time to wait in ms. (default = int.MaxValue).
Returns
If the data source(s) complete loading, true is returned, otherwise false.

Definition at line 404 of file MyCaffeImageDatabase2.cs.

◆ WaitForDatasetToLoad() [2/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.WaitForDatasetToLoad ( string  strDs,
bool  bTraining,
bool  bTesting,
int  nWait = int.MaxValue 
)

Wait for the dataset loading to complete.

Parameters
strDsSpecifies the dataset name.
bTrainingSpecifies to wait for the training data source to load.
bTestingSpecifies to wait for the testing data source to load.
nWaitSpecifies the amount of time to wait in ms. (default = int.MaxValue).
Returns
If the data source(s) complete loading, true is returned, otherwise false.

Definition at line 421 of file MyCaffeImageDatabase2.cs.

◆ WaitForDatasetToRefresh() [1/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.WaitForDatasetToRefresh ( int  nDsId,
bool  bTraining,
bool  bTesting,
int  nWait = int.MaxValue 
)

Wait for the dataset refreshing to complete.

Parameters
nDsIdSpecifies the dataset ID.
bTrainingSpecifies to wait for the training data source to refresh.
bTestingSpecifies to wait for the testing data source to refresh.
nWaitSpecifies the amount of time to wait in ms. (default = int.MaxValue).
Returns
If the data source(s) complete refreshing, true is returned, otherwise false.

Definition at line 489 of file MyCaffeImageDatabase2.cs.

◆ WaitForDatasetToRefresh() [2/2]

bool MyCaffe.db.image.MyCaffeImageDatabase2.WaitForDatasetToRefresh ( string  strDs,
bool  bTraining,
bool  bTesting,
int  nWait = int.MaxValue 
)

Wait for the dataset refreshing to complete.

Parameters
strDsSpecifies the dataset name.
bTrainingSpecifies to wait for the training data source to refresh.
bTestingSpecifies to wait for the testing data source to refresh.
nWaitSpecifies the amount of time to wait in ms. (default = int.MaxValue).
Returns
If the data source(s) complete refreshing, true is returned, otherwise false.

Definition at line 506 of file MyCaffeImageDatabase2.cs.

Property Documentation

◆ IsEnabled

bool MyCaffe.db.image.MyCaffeImageDatabase2.IsEnabled
get

Returns whether or not the image database is enabled.

Definition at line 1104 of file MyCaffeImageDatabase2.cs.

◆ IsInitialized

bool MyCaffe.db.image.MyCaffeImageDatabase2.IsInitialized
get

Returns whether or not the image database is initialized.

Definition at line 1121 of file MyCaffeImageDatabase2.cs.

◆ OutputLog

Log MyCaffe.db.image.MyCaffeImageDatabase2.OutputLog
getset

Get/set the output log.

Definition at line 905 of file MyCaffeImageDatabase2.cs.

◆ SelectFromBoostOnly

bool MyCaffe.db.image.MyCaffeImageDatabase2.SelectFromBoostOnly
get

Returns whether or not to select ONLY from boosted images.

Definition at line 1085 of file MyCaffeImageDatabase2.cs.

◆ SuperBoostProbability

double MyCaffe.db.image.MyCaffeImageDatabase2.SuperBoostProbability
getset

Get/set the super-boost probability which increases/decreases the probability of selecting a boosted image (default = 0).

Definition at line 1076 of file MyCaffeImageDatabase2.cs.

◆ UseTrainingImagesForTesting

bool MyCaffe.db.image.MyCaffeImageDatabase2.UseTrainingImagesForTesting
getset

Get/set whether or not to use training images for the test set (default = false).

Definition at line 1067 of file MyCaffeImageDatabase2.cs.

Event Documentation

◆ OnCalculateImageMean

EventHandler<CalculateImageMeanArgs> MyCaffe.db.image.MyCaffeImageDatabase2.OnCalculateImageMean

The OnCalculateImageMean event fires each time the MyCaffeImageDatabase wants to access the image mean for a data set.

Definition at line 56 of file MyCaffeImageDatabase2.cs.


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