MyCaffe
1.12.2.41
Deep learning software for Windows C# programmers.
|
[V2 Image Database] The DatasetEx2 class provides the in-memory dataset functionality that is used by the image database to manage data sets.
Both the Testing and Training ImageSet2 objects are managed by the DatasetEx2, which in turn coordinates the loading and usage of each.
More...
Public Member Functions | |
DatasetEx2 (Guid user, DatasetFactory factory, CryptoRandom random) | |
The DatasetEx constructor. More... | |
int | AddUser (Guid user) |
Adds a user of the dataset. More... | |
int | RemoveUser (Guid user) |
Remove a user of the dataset. More... | |
long | Initialize (DatasetDescriptor ds, WaitHandle[] rgAbort, int nPadW=0, int nPadH=0, Log log=null, DB_LOAD_METHOD loadMethod=DB_LOAD_METHOD.LOAD_ALL, bool bSkipMeanCheck=false, int nImageDbLoadLimit=0, int nImageDbAutoRefreshScheduledUpdateInMs=0, double dfImageDbAutoRefreshScheduledReplacementPct=0, bool bVerify=false) |
Initialize the DatasetEx by loading the training and testing data sources into memory. More... | |
bool | WaitForLoadingToComplete (bool bTraining, bool bTesting, int nWait=int.MaxValue) |
Wait for either the training, testing or both data sources to complete loading. More... | |
bool | WaitForRefreshToComplete (bool bTraining, bool bTesting, int nWait=int.MaxValue) |
Wait for either the training, testing or both data sources to complete refreshing. More... | |
bool | IsRefreshRunning (bool bTraining, bool bTesting) |
Returns whether or not the refresh is running on the training and/or testing data source. More... | |
void | StartRefresh (bool bTraining=true, bool bTesting=true, double dfReplacementPct=0.25) |
Start an image refresh on the training and/or testing data sources. More... | |
void | StopRefresh (bool bTraining=true, bool bTesting=true) |
Stop any refresh operation currently running. More... | |
bool | StartAutomaticRefreshSchedule (bool bTraining, bool bTesting, int nPeriodInMs, double dfReplacementPct) |
Start the automatic refresh schedule on the training and/or testing data sources. More... | |
bool | StopAutomaticRefreshSchedule (bool bTraining, bool bTesting) |
Stop the automatic refresh schedule on the training and/or testing data sources. More... | |
bool | GetAutomaticRefreshSchedule (out int nPeriodInMs, out double dfReplacementPct, out int nTrainingRefreshCount, out int nTestingRefreshCount) |
Get the automatic refresh schedule status and its period and replacement percentage. More... | |
void | Dispose () |
Releases all resources used. More... | |
long | CreateQueryState (bool bUseUniqueLabelIndexes=true, bool bUseUniqueImageIndexes=true, IMGDB_SORT sort=IMGDB_SORT.NONE) |
Create a new QueryState on the dataset. More... | |
bool | SetDefaultQueryState (long lQueryState) |
Set the default query state to a new query state. More... | |
bool | FreeQueryState (long lHandle) |
Free an existing query state. More... | |
QueryState | FindQueryState (long lQueryState, ImageSet2.TYPE type) |
Returns the query state for a given query state handle and type. More... | |
void | ReloadIndexing () |
Reload the indexing for both the training and testing data sources. More... | |
void | Relabel (LabelMappingCollection col) |
Relabels both the testing and training image sets using the label mapping collection. More... | |
void | ResetLabels () |
Resets the labels to their original labels. More... | |
void | ResetAllBoosts () |
Reset all boosts for both the testing and training image 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 (bool bReload) |
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... | |
ImageSet2 | Find (int nSourceID) |
Returns the ImageSet corresponding to a data source ID. More... | |
ImageSet2 | 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 | |
long | DefaultQueryState [get] |
Returns the default query state created when first initializing the dataset. More... | |
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< CalculateImageMeanArgs > | OnCalculateImageMean |
The OnCalculateImageMean event is passed to each image set and fires each time the Image set need to calcualte its image mean. More... | |
[V2 Image Database] The DatasetEx2 class provides the in-memory dataset functionality that is used by the image database to manage data sets.
Both the Testing and Training ImageSet2 objects are managed by the DatasetEx2, which in turn coordinates the loading and usage of each.
Definition at line 17 of file DatasetEx2.cs.
MyCaffe.db.image.DatasetEx2.DatasetEx2 | ( | Guid | user, |
DatasetFactory | factory, | ||
CryptoRandom | random | ||
) |
The DatasetEx constructor.
user | Specifies the unique ID of the dataset user. |
factory | Specifies the DatasetFactory used to manage the database datasets. |
random | Specifies the random number generator. |
Definition at line 54 of file DatasetEx2.cs.
int MyCaffe.db.image.DatasetEx2.AddUser | ( | Guid | user | ) |
Adds a user of the dataset.
user | Specifies the unique ID of the dataset user. |
Definition at line 70 of file DatasetEx2.cs.
long MyCaffe.db.image.DatasetEx2.CreateQueryState | ( | bool | bUseUniqueLabelIndexes = true , |
bool | bUseUniqueImageIndexes = true , |
||
IMGDB_SORT | sort = IMGDB_SORT.NONE |
||
) |
Create a new QueryState on the dataset.
bUseUniqueLabelIndexes | Optionally, specifies to use unique label indexes which is slightly slower, but ensures each label is hit per epoch (default = true). |
bUseUniqueImageIndexes | Optionally, specifies to use unique image indexes which is slightly slower, but ensures each image is hit per epoch (default = true). |
sort | Optionally, specifies an ordering for the query state (default = NONE). |
Definition at line 481 of file DatasetEx2.cs.
void MyCaffe.db.image.DatasetEx2.Dispose | ( | ) |
Releases all resources used.
Definition at line 469 of file DatasetEx2.cs.
|
protectedvirtual |
Releases all resources used.
bDisposing | Set to true when called by Dispose(). |
Definition at line 441 of file DatasetEx2.cs.
ImageSet2 MyCaffe.db.image.DatasetEx2.Find | ( | int | nSourceID | ) |
Returns the ImageSet corresponding to a data source ID.
nSourceID | Specifies the ID of the data source to use. |
Definition at line 657 of file DatasetEx2.cs.
ImageSet2 MyCaffe.db.image.DatasetEx2.Find | ( | string | strSource | ) |
Returns the ImageSet corresponding to a data source name.
strSource | Specifies the name of the data source to use. |
Definition at line 680 of file DatasetEx2.cs.
QueryState MyCaffe.db.image.DatasetEx2.FindQueryState | ( | long | lQueryState, |
ImageSet2.TYPE | type | ||
) |
Returns the query state for a given query state handle and type.
lQueryState | Specifies the handle to the query state. |
type | Specifies the query state type to retrieve. |
Definition at line 519 of file DatasetEx2.cs.
bool MyCaffe.db.image.DatasetEx2.FreeQueryState | ( | long | lHandle | ) |
Free an existing query state.
lHandle | Specifies the handle to the query state to be freed. |
Definition at line 504 of file DatasetEx2.cs.
bool MyCaffe.db.image.DatasetEx2.GetAutomaticRefreshSchedule | ( | out int | nPeriodInMs, |
out double | dfReplacementPct, | ||
out int | nTrainingRefreshCount, | ||
out int | nTestingRefreshCount | ||
) |
Get the automatic refresh schedule status and its period and replacement percentage.
nPeriodInMs | Specifies the period in milliseconds over which the auto refresh cycle is to run. |
dfReplacementPct | Specifies the percentage of replacement to use on each cycle. |
nTrainingRefreshCount | Returns the training refrsh count. |
nTestingRefreshCount | Returns the testing refresh count. |
Definition at line 335 of file DatasetEx2.cs.
double MyCaffe.db.image.DatasetEx2.GetPercentageLoaded | ( | out double | dfTraining, |
out double | dfTesting | ||
) |
Returns the total percentage of images loaded for testing, training and combined.
dfTraining | Returns the total percentage of training images loaded. |
dfTesting | Returns the total percentage of testing images loaded. |
Definition at line 636 of file DatasetEx2.cs.
long MyCaffe.db.image.DatasetEx2.Initialize | ( | DatasetDescriptor | ds, |
WaitHandle[] | rgAbort, | ||
int | nPadW = 0 , |
||
int | nPadH = 0 , |
||
Log | log = null , |
||
DB_LOAD_METHOD | loadMethod = DB_LOAD_METHOD.LOAD_ALL , |
||
bool | bSkipMeanCheck = false , |
||
int | nImageDbLoadLimit = 0 , |
||
int | nImageDbAutoRefreshScheduledUpdateInMs = 0 , |
||
double | dfImageDbAutoRefreshScheduledReplacementPct = 0 , |
||
bool | bVerify = false |
||
) |
Initialize the DatasetEx by loading the training and testing data sources into memory.
ds | Specifies the dataset to load. |
rgAbort | Specifies a set of wait handles used to cancel the load. |
nPadW | Optionally, specifies a pad to apply to the width of each item (default = 0). |
nPadH | Optionally, specifies a pad to apply to the height of each item (default = 0). |
log | Optionally, specifies an external Log to output status (default = null). |
loadMethod | Optionally, specifies the load method to use (default = LOAD_ALL). |
bSkipMeanCheck | Optionally, specifies to skip the mean check (default = false). |
nImageDbLoadLimit | Optionally, specifies the load limit (default = 0). |
nImageDbAutoRefreshScheduledUpdateInMs | Optionally, specifies the scheduled refresh update period in ms (default = 0). |
dfImageDbAutoRefreshScheduledReplacementPct | Optionally, specifies the scheduled refresh replacement percent (default = 0). |
bVerify | Optionally, verify the dataset indexes (only applies when using LOAD_ALL loading method (default = false). |
Definition at line 102 of file DatasetEx2.cs.
bool MyCaffe.db.image.DatasetEx2.IsRefreshRunning | ( | bool | bTraining, |
bool | bTesting | ||
) |
Returns whether or not the refresh is running on the training and/or testing data source.
bTraining | Specifies to check the training data source. |
bTesting | Specifies to check the testing data source. |
Definition at line 214 of file DatasetEx2.cs.
SimpleDatum MyCaffe.db.image.DatasetEx2.QueryImageMean | ( | int | nSrcId | ) |
Query the image mean for a data source.
nSrcId | Specifies the ID of the data source to use. |
Definition at line 609 of file DatasetEx2.cs.
void MyCaffe.db.image.DatasetEx2.Relabel | ( | LabelMappingCollection | col | ) |
Relabels both the testing and training image sets using the label mapping collection.
col | Specifies the label mapping collection. |
Definition at line 546 of file DatasetEx2.cs.
void MyCaffe.db.image.DatasetEx2.ReloadIndexing | ( | ) |
Reload the indexing for both the training and testing data sources.
Definition at line 533 of file DatasetEx2.cs.
int MyCaffe.db.image.DatasetEx2.RemoveUser | ( | Guid | user | ) |
Remove a user of the dataset.
user | Specifies the unique ID of the dataset user. |
Definition at line 81 of file DatasetEx2.cs.
void MyCaffe.db.image.DatasetEx2.ResetAllBoosts | ( | ) |
Reset all boosts for both the testing and training image sets.
Definition at line 570 of file DatasetEx2.cs.
void MyCaffe.db.image.DatasetEx2.ResetLabels | ( | ) |
Resets the labels to their original labels.
Definition at line 558 of file DatasetEx2.cs.
bool MyCaffe.db.image.DatasetEx2.SaveImageMean | ( | int | nSrcId, |
SimpleDatum | sd, | ||
bool | bUpdate | ||
) |
Saves the image mean in a SimpleDatum to the database.
nSrcId | Specifies the ID of the data source to use. |
sd | Specifies the image mean data. |
bUpdate | Specifies whether or not to update the mean image. |
Definition at line 595 of file DatasetEx2.cs.
bool MyCaffe.db.image.DatasetEx2.SetDefaultQueryState | ( | long | lQueryState | ) |
Set the default query state to a new query state.
lQueryState | Specifies the query state to set. |
Definition at line 493 of file DatasetEx2.cs.
bool MyCaffe.db.image.DatasetEx2.StartAutomaticRefreshSchedule | ( | bool | bTraining, |
bool | bTesting, | ||
int | nPeriodInMs, | ||
double | dfReplacementPct | ||
) |
Start the automatic refresh schedule on the training and/or testing data sources.
bTraining | Optionally, specifies to stop refreshing the training data source (default = true). |
bTesting | Optionally, specifies to stop refreshing the testing data source (default = true). |
nPeriodInMs | Specifies the period in milliseconds over which the auto refresh cycle is to run. |
dfReplacementPct | Specifies the percentage of replacement to use on each cycle. |
Definition at line 273 of file DatasetEx2.cs.
void MyCaffe.db.image.DatasetEx2.StartRefresh | ( | bool | bTraining = true , |
bool | bTesting = true , |
||
double | dfReplacementPct = 0.25 |
||
) |
Start an image refresh on the training and/or testing data sources.
Note this method is only valid when initializing with LoadLimit > 0.
bTraining | Optionally, specifies to refresh the training data source (default = true). |
bTesting | Optionally, specifies to refresh the testing data source (default = true). |
dfReplacementPct | Optionally, specifies the percentage of the loaded image set to refresh (default = 0.25 for 25%) |
Definition at line 242 of file DatasetEx2.cs.
bool MyCaffe.db.image.DatasetEx2.StopAutomaticRefreshSchedule | ( | bool | bTraining, |
bool | bTesting | ||
) |
Stop the automatic refresh schedule on the training and/or testing data sources.
bTraining | Optionally, specifies to stop refreshing the training data source (default = true). |
bTesting | Optionally, specifies to stop refreshing the testing data source (default = true). |
Definition at line 311 of file DatasetEx2.cs.
void MyCaffe.db.image.DatasetEx2.StopRefresh | ( | bool | bTraining = true , |
bool | bTesting = true |
||
) |
Stop any refresh operation currently running.
bTraining | Optionally, specifies to stop refreshing the training data source (default = true). |
bTesting | Optionally, specifies to stop refreshing the testing data source (default = true). |
Definition at line 256 of file DatasetEx2.cs.
void MyCaffe.db.image.DatasetEx2.Unload | ( | bool | bReload | ) |
Unload the images of the training and testing image sets.
Definition at line 621 of file DatasetEx2.cs.
bool MyCaffe.db.image.DatasetEx2.WaitForLoadingToComplete | ( | bool | bTraining, |
bool | bTesting, | ||
int | nWait = int.MaxValue |
||
) |
Wait for either the training, testing or both data sources to complete loading.
bTraining | Specifies to wait for the training data source. |
bTesting | Specifies to wait for the testing data source. |
nWait |
Definition at line 167 of file DatasetEx2.cs.
bool MyCaffe.db.image.DatasetEx2.WaitForRefreshToComplete | ( | bool | bTraining, |
bool | bTesting, | ||
int | nWait = int.MaxValue |
||
) |
Wait for either the training, testing or both data sources to complete refreshing.
bTraining | Specifies to wait for the training data source. |
bTesting | Specifies to wait for the testing data source. |
nWait |
Definition at line 191 of file DatasetEx2.cs.
|
getset |
Returns the dataset ID of the dataset managesd by the DatasetEx object.
Definition at line 709 of file DatasetEx2.cs.
|
get |
Returns the dataset name of the dataset managesd by the DatasetEx object.
Definition at line 726 of file DatasetEx2.cs.
|
get |
Returns the default query state created when first initializing the dataset.
Definition at line 432 of file DatasetEx2.cs.
|
get |
Returns the dataset descriptor of the dataset managesd by the DatasetEx object.
Definition at line 701 of file DatasetEx2.cs.
|
get |
Returns the original DatsetID if this is a cloned re-organized dataset, otherwise 0 is returned.
Definition at line 718 of file DatasetEx2.cs.
|
getset |
Get/set whether or not to use the training images when testing.
Definition at line 582 of file DatasetEx2.cs.
EventHandler<CalculateImageMeanArgs> MyCaffe.db.image.DatasetEx2.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 46 of file DatasetEx2.cs.