MyCaffe
1.12.2.41
Deep learning software for Windows C# programmers.
|
The MasterList is responsible for loading and managing access to the master list of images for a data source. More...
Public Member Functions | |
MasterList (CryptoRandom random, Log log, SourceDescriptor src, DatasetFactory factory, List< WaitHandle > rgAbort, int nMaxLoadCount=0) | |
The constructor. More... | |
void | Dispose () |
Release all resources used. More... | |
void | Verify (MasterIndexes idx) |
Verify the loaded images against the master indexes. More... | |
bool | Load (bool bSilent=false) |
Start loading the dataset. More... | |
void | Unload (bool bReLoad) |
Unload the data source images. More... | |
bool | StartRefresh (double dfReplacementPct=0.25) |
Start the refresh thread which will run if the number of images stored in memory is less than the total number of images in the data source, otherwise this function returns false. More... | |
bool | WaitForRefreshToComplete (List< WaitHandle > rgAbort, int nWait) |
Wait for the refres to complete. More... | |
void | StopRefresh () |
Stop the refresh thread if running. More... | |
void | SetImageMean (SimpleDatum d, bool bSave=false) |
Set the image mean. More... | |
int | GetTotalCount () |
Return the total number of images whether loaded or not, in the data source. More... | |
int | GetLoadedCount () |
Return the currently loaded images in the data source. More... | |
SimpleDatum | GetImageMean (Log log, WaitHandle[] rgAbort, bool bQueryOnly) |
Returns the image mean for the ImageSet. More... | |
List< DbItem > | ReloadIndexing () |
Reload the image indexing. More... | |
List< DbItem > | ResetLabels () |
Reset the labels of all images to the original labels. More... | |
List< DbItem > | Relabel (LabelMappingCollection col) |
Relabel the images based on the LabelMappingCollection. More... | |
List< DbItem > | ResetAllBoosts () |
Reset all image boosts. More... | |
int | FindImageIndex (List< DbItem > rgItems, string strDesc) |
Find the image index based by searching the rgItems for an image that contains the description specified. More... | |
SimpleDatum | FindImage (int nImageId) |
Find an image based on its image ID (e.g. the image ID in the database). More... | |
SimpleDatum | GetImage (int nIdx, bool bLoadDataCriteria, bool bLoadDebugData, DB_LOAD_METHOD loadMethod) |
Get the image with a specific image index. More... | |
int | GetCount (QueryState state, string strFilterVal=null, int? nBoostVal=null, bool bBoostValIsExact=false) |
Returns the number of images in the image set, optionally with super-boosted values only. More... | |
List< SimpleDatum > | GetImages (QueryState state, 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< SimpleDatum > | GetImages (QueryState state, 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< SimpleDatum > | GetImages (bool bSuperboostOnly, string strFilterVal, int? nBoostVal, int[] rgIdx) |
Returns the array of images in the image set, possibly filtered with the filtering parameters. More... | |
bool | WaitForLoadingToComplete (List< WaitHandle > rgAbort, int nWait=int.MaxValue) |
Wait for the image loading to complete - this is used when performing LOAD_ALL. More... | |
Properties | |
bool | IsLoadLimitEnabled [get] |
Returns true when the database is loaded with LoadLimit > 0, false otherwise. More... | |
bool? | IsFull [get] |
Returns true when the master list is fully loaded, false otherwise. More... | |
bool | IsRefreshDone [get] |
Returns true after the refresh completes. More... | |
bool | IsRefreshRunning [get] |
Returns true if the refresh is running, false otherwise. More... | |
Events | |
EventHandler< CalculateImageMeanArgs > | OnCalculateImageMean |
The OnCalculateImageMean event fires when the ImageSet needs to calculate the image mean for the image set. More... | |
The MasterList is responsible for loading and managing access to the master list of images for a data source.
Definition at line 16 of file MasterList.cs.
MyCaffe.db.image.MasterList.MasterList | ( | CryptoRandom | random, |
Log | log, | ||
SourceDescriptor | src, | ||
DatasetFactory | factory, | ||
List< WaitHandle > | rgAbort, | ||
int | nMaxLoadCount = 0 |
||
) |
The constructor.
random | Specifies the CryptoRandom to use for random selection. |
log | Specifies the output log. |
src | Specifies the data source that holds the data on the database. |
factory | Specifies the data factory used to access the database data. |
rgAbort | Specifies the cancel handles. |
nMaxLoadCount | Optionally, specifies to automaticall start the image refresh which only applies when the number of images loaded into memory is less than the actual number of images (default = false). |
Definition at line 55 of file MasterList.cs.
void MyCaffe.db.image.MasterList.Dispose | ( | ) |
Release all resources used.
Definition at line 82 of file MasterList.cs.
SimpleDatum MyCaffe.db.image.MasterList.FindImage | ( | int | nImageId | ) |
Find an image based on its image ID (e.g. the image ID in the database).
nImageId | Specifies the image ID in the database. |
Definition at line 469 of file MasterList.cs.
int MyCaffe.db.image.MasterList.FindImageIndex | ( | List< DbItem > | rgItems, |
string | strDesc | ||
) |
Find the image index based by searching the rgItems for an image that contains the description specified.
rgItems | Specifies the image items to use to search. |
strDesc | Specifies the image description to look for. |
Definition at line 441 of file MasterList.cs.
int MyCaffe.db.image.MasterList.GetCount | ( | QueryState | state, |
string | strFilterVal = null , |
||
int? | nBoostVal = null , |
||
bool | bBoostValIsExact = false |
||
) |
Returns the number of images in the image set, optionally with super-boosted values only.
state | Specifies the query state to use. |
strFilterVal | Optionally, specifies the filter value that the description must match (default = null, which ignores this parameter). |
nBoostVal | Optionally, specifies the boost value that the boost must match (default = null, which ignores this parameter). |
bBoostValIsExact | Optionally, specifies whether or the boost value (if specified) is to be used literally (exact = true), or as a minimum boost value. |
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 573 of file MasterList.cs.
SimpleDatum MyCaffe.db.image.MasterList.GetImage | ( | int | nIdx, |
bool | bLoadDataCriteria, | ||
bool | bLoadDebugData, | ||
DB_LOAD_METHOD | loadMethod | ||
) |
Get the image with a specific image index.
nIdx | Specifies the image index. |
bLoadDataCriteria | Specifies whether or not to load the data criteria along with the image. |
bLoadDebugData | Specifies whether or not to load the debug data with the image. |
loadMethod | Specifies the image loading method used. |
Definition at line 524 of file MasterList.cs.
SimpleDatum MyCaffe.db.image.MasterList.GetImageMean | ( | Log | log, |
WaitHandle[] | rgAbort, | ||
bool | bQueryOnly | ||
) |
Returns the image mean for the ImageSet.
log | Specifies the Log used to output status. |
rgAbort | Specifies a set of wait handles for aborting the operation. |
bQueryOnly | Specifies whether or not to only query for the mean and not calculate if missing. |
Definition at line 324 of file MasterList.cs.
List< SimpleDatum > MyCaffe.db.image.MasterList.GetImages | ( | bool | bSuperboostOnly, |
string | strFilterVal, | ||
int? | nBoostVal, | ||
int[] | rgIdx | ||
) |
Returns the array of images in the image set, possibly filtered with the filtering parameters.
bSuperboostOnly | Specifies whether or not to return images with super-boost. |
strFilterVal | specifies the filter value that the description must match (default = null, which ignores this parameter). |
nBoostVal | specifies the boost value that the boost must match (default = null, which ignores this parameter). |
rgIdx | Specifies a set of indexes to search for where the images returned must have an index greater than or equal to the individual index. |
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 653 of file MasterList.cs.
List< SimpleDatum > MyCaffe.db.image.MasterList.GetImages | ( | QueryState | state, |
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.
state | Specifies the query state to use. |
dtStart | Specifies a starting time from which the query is to start within the set of images. |
nQueryCount | Optionally, specifies a number of images to retrieve within the set (default = int.MaxValue). |
strFilterVal | Optionally, specifies the filter value that the description must match (default = null, which ignores this parameter). |
nBoostVal | Optionally, specifies the boost value that the boost must match (default = null, which ignores this parameter). |
bBoostValIsExact | Optionally, specifies whether or the boost value (if specified) is to be used literally (exact = true), or as a minimum boost value. |
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 633 of file MasterList.cs.
List< SimpleDatum > MyCaffe.db.image.MasterList.GetImages | ( | QueryState | state, |
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.
state | Specifies the query state to use. |
nStartIdx | Specifies a starting index from which the query is to start within the set of images. |
nQueryCount | Optionally, specifies a number of images to retrieve within the set (default = int.MaxValue). |
strFilterVal | Optionally, specifies the filter value that the description must match (default = null, which ignores this parameter). |
nBoostVal | Optionally, specifies the boost value that the boost must match (default = null, which ignores this parameter). |
bBoostValIsExact | Optionally, specifies whether or the boost value (if specified) is to be used literally (exact = true), or as a minimum boost value. |
bAttemptDirectLoad | Optionaly, specifies to directly load all images not already loaded. |
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 592 of file MasterList.cs.
int MyCaffe.db.image.MasterList.GetLoadedCount | ( | ) |
Return the currently loaded images in the data source.
Definition at line 312 of file MasterList.cs.
int MyCaffe.db.image.MasterList.GetTotalCount | ( | ) |
Return the total number of images whether loaded or not, in the data source.
Definition at line 300 of file MasterList.cs.
bool MyCaffe.db.image.MasterList.Load | ( | bool | bSilent = false | ) |
Start loading the dataset.
bSilent | Specifies whether or not to output the loading status. |
Definition at line 145 of file MasterList.cs.
List< DbItem > MyCaffe.db.image.MasterList.Relabel | ( | LabelMappingCollection | col | ) |
Relabel the images based on the LabelMappingCollection.
col | Specifies the label mapping collection. |
Definition at line 403 of file MasterList.cs.
List< DbItem > MyCaffe.db.image.MasterList.ReloadIndexing | ( | ) |
Reload the image indexing.
Definition at line 375 of file MasterList.cs.
List< DbItem > MyCaffe.db.image.MasterList.ResetAllBoosts | ( | ) |
Reset all image boosts.
Definition at line 421 of file MasterList.cs.
List< DbItem > MyCaffe.db.image.MasterList.ResetLabels | ( | ) |
Reset the labels of all images to the original labels.
Definition at line 384 of file MasterList.cs.
void MyCaffe.db.image.MasterList.SetImageMean | ( | SimpleDatum | d, |
bool | bSave = false |
||
) |
Set the image mean.
d | Specifies the image mean. |
bSave | Optionally, specifies whether or not to save the image mean in the database (default = false). |
Definition at line 288 of file MasterList.cs.
bool MyCaffe.db.image.MasterList.StartRefresh | ( | double | dfReplacementPct = 0.25 | ) |
Start the refresh thread which will run if the number of images stored in memory is less than the total number of images in the data source, otherwise this function returns false.
dfReplacementPct | Optionally, specifies the replacement percentage (default = 0.25 or 25%). |
Definition at line 199 of file MasterList.cs.
void MyCaffe.db.image.MasterList.StopRefresh | ( | ) |
Stop the refresh thread if running.
Definition at line 274 of file MasterList.cs.
void MyCaffe.db.image.MasterList.Unload | ( | bool | bReLoad | ) |
Unload the data source images.
bReLoad | Re-load the data source images right after the unload completes. |
Definition at line 168 of file MasterList.cs.
void MyCaffe.db.image.MasterList.Verify | ( | MasterIndexes | idx | ) |
Verify the loaded images against the master indexes.
idx | Specifies the master indexes. |
Definition at line 97 of file MasterList.cs.
bool MyCaffe.db.image.MasterList.WaitForLoadingToComplete | ( | List< WaitHandle > | rgAbort, |
int | nWait = int.MaxValue |
||
) |
Wait for the image loading to complete - this is used when performing LOAD_ALL.
rgAbort | Specifies one or more cancellation handles. |
nWait | Optionally, specifies an amount to wait (default = int.MaxValue). |
Definition at line 671 of file MasterList.cs.
bool MyCaffe.db.image.MasterList.WaitForRefreshToComplete | ( | List< WaitHandle > | rgAbort, |
int | nWait | ||
) |
Wait for the refres to complete.
rgAbort | Specifies one or more cancellation handles. |
nWait | Specifies an amount of time to wait in milliseconds. |
Definition at line 230 of file MasterList.cs.
|
get |
Returns true when the master list is fully loaded, false otherwise.
Definition at line 132 of file MasterList.cs.
|
get |
Returns true when the database is loaded with LoadLimit > 0, false otherwise.
Definition at line 118 of file MasterList.cs.
|
get |
Returns true after the refresh completes.
Definition at line 249 of file MasterList.cs.
|
get |
Returns true if the refresh is running, false otherwise.
Definition at line 263 of file MasterList.cs.
EventHandler<CalculateImageMeanArgs> MyCaffe.db.image.MasterList.OnCalculateImageMean |
The OnCalculateImageMean event fires when the ImageSet needs to calculate the image mean for the image set.
Definition at line 44 of file MasterList.cs.