MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.db.image.DatasetEx Class Reference

The DatasetEx class provides the in-memory dataset functionality that is used by the image database to manage data sets.
Both the Testing and Training ImageSet objects are managed by the DatasetEx, which in turn coordinates the loading and usage of each. More...

Inheritance diagram for MyCaffe.db.image.DatasetEx:

Public Member Functions

 DatasetEx (Guid user, DatasetFactory factory, CryptoRandom random)
 The DatasetEx constructor. More...
 
void Reset ()
 Reset the image indexes for both the training and testing image sets. More...
 
int AddUser (Guid user)
 Adds a user of the dataset. More...
 
int RemoveUser (Guid user)
 Remove a user of the dataset. More...
 
bool Initialize (DatasetDescriptor ds, WaitHandle[] rgAbort, int nPadW=0, int nPadH=0, Log log=null, DB_LOAD_METHOD loadMethod=DB_LOAD_METHOD.LOAD_ALL, int nImageDbLoadLimit=0, bool bSkipMeanCheck=false)
 Initialize the DatasetEx by loading the training and testing data sources into memory. More...
 
DatasetEx Clone (bool bReOrganizeByTime=false)
 Copy the DatasetEx and its contents. More...
 
void Relabel (LabelMappingCollection col)
 Relabels both the testing and training image sets using the label mapping collection. More...
 
void ReloadLabelSets ()
 Reloads bot the training and testing label sets. More...
 
bool SaveImageMean (int nSrcId, SimpleDatum sd, bool bUpdate)
 Saves the image mean in a SimpleDatum to the database. More...
 
SimpleDatum QueryImageMean (int nSrcId)
 Query the image mean for a data source. More...
 
void Unload ()
 Unload the images of the training and testing image sets. More...
 
double GetPercentageLoaded (out double dfTraining, out double dfTesting)
 Returns the total percentage of images loaded for testing, training and combined. More...
 
void Dispose ()
 Releases all resources used. More...
 
ImageSet Find (int nSourceID)
 Returns the ImageSet corresponding to a data source ID. More...
 
ImageSet Find (string strSource)
 Returns the ImageSet corresponding to a data source name. More...
 

Protected Member Functions

virtual void Dispose (bool bDisposing)
 Releases all resources used. More...
 

Properties

bool UseTrainingImagesForTesting [getset]
 Get/set whether or not to use the training images when testing. More...
 
DatasetDescriptor Descriptor [get]
 Returns the dataset descriptor of the dataset managesd by the DatasetEx object. More...
 
int DatasetID [getset]
 Returns the dataset ID of the dataset managesd by the DatasetEx object. More...
 
int OriginalDatasetID [get]
 Returns the original DatsetID if this is a cloned re-organized dataset, otherwise 0 is returned. More...
 
string DatasetName [get]
 Returns the dataset name of the dataset managesd by the DatasetEx object. More...
 

Events

EventHandler< CalculateImageMeanArgsOnCalculateImageMean
 The OnCalculateImageMean event is passed to each image set and fires each time the Image set need to calcualte its image mean. More...
 

Detailed Description

The DatasetEx class provides the in-memory dataset functionality that is used by the image database to manage data sets.
Both the Testing and Training ImageSet objects are managed by the DatasetEx, which in turn coordinates the loading and usage of each.

Definition at line 16 of file DatasetEx.cs.

Constructor & Destructor Documentation

◆ DatasetEx()

MyCaffe.db.image.DatasetEx.DatasetEx ( Guid  user,
DatasetFactory  factory,
CryptoRandom  random 
)

The DatasetEx constructor.

Parameters
userSpecifies the unique ID of the dataset user.
factorySpecifies the DatasetFactory used to manage the database datasets.
randomSpecifies the random number generator.

Definition at line 41 of file DatasetEx.cs.

Member Function Documentation

◆ AddUser()

int MyCaffe.db.image.DatasetEx.AddUser ( Guid  user)

Adds a user of the dataset.

Parameters
userSpecifies the unique ID of the dataset user.
Returns
The number of users is returned.

Definition at line 65 of file DatasetEx.cs.

◆ Clone()

DatasetEx MyCaffe.db.image.DatasetEx.Clone ( bool  bReOrganizeByTime = false)

Copy the DatasetEx and its contents.

Parameters
bReOrganizeByTimeOptionally, specifies to re-organize the training and testing sources so that they are both organized chronologically.
Returns
The new DatasetEx is returned.

Definition at line 135 of file DatasetEx.cs.

◆ Dispose() [1/2]

void MyCaffe.db.image.DatasetEx.Dispose ( )

Releases all resources used.

Definition at line 473 of file DatasetEx.cs.

◆ Dispose() [2/2]

virtual void MyCaffe.db.image.DatasetEx.Dispose ( bool  bDisposing)
protectedvirtual

Releases all resources used.

Parameters
bDisposingSet to true when called by Dispose().

Definition at line 447 of file DatasetEx.cs.

◆ Find() [1/2]

ImageSet MyCaffe.db.image.DatasetEx.Find ( int  nSourceID)

Returns the ImageSet corresponding to a data source ID.

Parameters
nSourceIDSpecifies the ID of the data source to use.
Returns
The ImageSet of images is returned.

Definition at line 483 of file DatasetEx.cs.

◆ Find() [2/2]

ImageSet MyCaffe.db.image.DatasetEx.Find ( string  strSource)

Returns the ImageSet corresponding to a data source name.

Parameters
strSourceSpecifies the name of the data source to use.
Returns
The ImageSet of images is returned.

Definition at line 506 of file DatasetEx.cs.

◆ GetPercentageLoaded()

double MyCaffe.db.image.DatasetEx.GetPercentageLoaded ( out double  dfTraining,
out double  dfTesting 
)

Returns the total percentage of images loaded for testing, training and combined.

Parameters
dfTrainingReturns the total percentage of training images loaded.
dfTestingReturns the total percentage of testing images loaded.
Returns
Returns the combined total percentage of images loaded for both testing and training.

Definition at line 427 of file DatasetEx.cs.

◆ Initialize()

bool MyCaffe.db.image.DatasetEx.Initialize ( DatasetDescriptor  ds,
WaitHandle[]  rgAbort,
int  nPadW = 0,
int  nPadH = 0,
Log  log = null,
DB_LOAD_METHOD  loadMethod = DB_LOAD_METHOD.LOAD_ALL,
int  nImageDbLoadLimit = 0,
bool  bSkipMeanCheck = false 
)

Initialize the DatasetEx by loading the training and testing data sources into memory.

Parameters
dsSpecifies the dataset to load.
rgAbortSpecifies a set of wait handles used to cancel the load.
nPadWOptionally, specifies a pad to apply to the width of each item (default = 0).
nPadHOptionally, specifies a pad to apply to the height of each item (default = 0).
logOptionally, specifies an external Log to output status (default = null).
loadMethodOptionally, specifies the load method to use (default = LOAD_ALL).
nImageDbLoadLimitOptionally, specifies the load limit (default = 0).
bSkipMeanCheckOptionally, specifies to skip the mean check (default = false).
Returns
Upon loading the dataset true is returned, otherwise on failure or abort false is returned.

Definition at line 94 of file DatasetEx.cs.

◆ QueryImageMean()

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

Query the image mean for a data source.

Parameters
nSrcIdSpecifies the ID of the data source to use.
Returns
The SimpleDatum containing the image mean is returned.

Definition at line 400 of file DatasetEx.cs.

◆ Relabel()

void MyCaffe.db.image.DatasetEx.Relabel ( LabelMappingCollection  col)

Relabels both the testing and training image sets using the label mapping collection.

Parameters
colSpecifies the label mapping collection.

Definition at line 196 of file DatasetEx.cs.

◆ ReloadLabelSets()

void MyCaffe.db.image.DatasetEx.ReloadLabelSets ( )

Reloads bot the training and testing label sets.

Definition at line 205 of file DatasetEx.cs.

◆ RemoveUser()

int MyCaffe.db.image.DatasetEx.RemoveUser ( Guid  user)

Remove a user of the dataset.

Parameters
userSpecifies the unique ID of the dataset user.
Returns
The number of users is returned.

Definition at line 76 of file DatasetEx.cs.

◆ Reset()

void MyCaffe.db.image.DatasetEx.Reset ( )

Reset the image indexes for both the training and testing image sets.

Definition at line 54 of file DatasetEx.cs.

◆ SaveImageMean()

bool MyCaffe.db.image.DatasetEx.SaveImageMean ( int  nSrcId,
SimpleDatum  sd,
bool  bUpdate 
)

Saves the image mean in a SimpleDatum to the database.

Parameters
nSrcIdSpecifies the ID of the data source to use.
sdSpecifies the image mean data.
bUpdateSpecifies whether or not to update the mean image.
Returns
If saved successfully, this method returns true, otherwise false is returned.

Definition at line 386 of file DatasetEx.cs.

◆ Unload()

void MyCaffe.db.image.DatasetEx.Unload ( )

Unload the images of the training and testing image sets.

Definition at line 412 of file DatasetEx.cs.

Property Documentation

◆ DatasetID

int MyCaffe.db.image.DatasetEx.DatasetID
getset

Returns the dataset ID of the dataset managesd by the DatasetEx object.

Definition at line 535 of file DatasetEx.cs.

◆ DatasetName

string MyCaffe.db.image.DatasetEx.DatasetName
get

Returns the dataset name of the dataset managesd by the DatasetEx object.

Definition at line 552 of file DatasetEx.cs.

◆ Descriptor

DatasetDescriptor MyCaffe.db.image.DatasetEx.Descriptor
get

Returns the dataset descriptor of the dataset managesd by the DatasetEx object.

Definition at line 527 of file DatasetEx.cs.

◆ OriginalDatasetID

int MyCaffe.db.image.DatasetEx.OriginalDatasetID
get

Returns the original DatsetID if this is a cloned re-organized dataset, otherwise 0 is returned.

Definition at line 544 of file DatasetEx.cs.

◆ UseTrainingImagesForTesting

bool MyCaffe.db.image.DatasetEx.UseTrainingImagesForTesting
getset

Get/set whether or not to use the training images when testing.

Definition at line 214 of file DatasetEx.cs.

Event Documentation

◆ OnCalculateImageMean

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

The OnCalculateImageMean event is passed to each image set and fires each time the Image set need to calcualte its image mean.

Definition at line 33 of file DatasetEx.cs.


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