MyCaffe
1.12.2.41
Deep learning software for Windows C# programmers.
|
The ImageSet class contains the list of image for a data source as well as a list of LabelSets that map into it. More...
Public Member Functions | |
ImageSet (DatasetFactory factory, SourceDescriptor src, DB_LOAD_METHOD loadMethod, int nLoadLimit, CryptoRandom random) | |
The ImageSet constructor. More... | |
void | Dispose () |
Releases the resouces used. More... | |
Dictionary< int, ulong > | GetQueryLabelCounts () |
Retrieves the label counts. More... | |
void | SetQueryLabelCount (int nLabel, int nBoost) |
Increase the query label count for a specific label. More... | |
string | GetQueryBoostHitPrecentsAsText () |
Get the queried boost hit percents as a string. More... | |
string | GetQueryLabelHitPrecentsAsText () |
Get the queried label hit percents as a string. More... | |
string | GetQueryLabelEpocsAsText () |
Get the queried label epoc per label as a text string. More... | |
List< LabelDescriptor > | GetLabels () |
Returns a list of label descriptors used by the image set. More... | |
string | GetLabelName (int nLabel) |
Returns the label name of a label. More... | |
void | Relabel (LabelMappingCollection col) |
Applies the label mapping to the image set. More... | |
ImageSet | Clone () |
Returns a copy of the ImageSet. More... | |
int | FindImageIndex (DateTime dt, string strDesc) |
Searches for an image index based on its time-stamp and description. More... | |
void | Reset () |
Resets the indexes and limited loaded images (if used). More... | |
bool | Add (int nIdx, SimpleDatum d) |
Adds a new image to the image set. More... | |
void | ReloadLabelSets () |
Reload the label sets. More... | |
void | CompleteLoad (int nLastImageIdx) |
Complete the image loading process. More... | |
int | GetCount (bool bSuperboostOnly, string strFilterVal=null, int? nBoostVal=null) |
Returns the number of images in the image set, optionally with super-boost only. More... | |
List< SimpleDatum > | GetImages (bool bSuperboostOnly, string strFilterVal=null, int? nBoostVal=null, int nStartIdx=0, int nQueryCount=int.MaxValue) |
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... | |
SimpleDatum | GetImage (int nIdx, DB_LABEL_SELECTION_METHOD labelSelectionMethod, DB_ITEM_SELECTION_METHOD imageSelectionMethod, Log log, bool bLoadDataCriteria=false, bool bLoadDebugData=false) |
Returns the image based on its label and image selection method. More... | |
SimpleDatum | GetImage (int nImageID) |
Returns the SimpleDatum of the image at a given ID. More... | |
LabelSet | GetLabelSet (int nLabel) |
Retuns the LabelSet corresponding to a label. More... | |
void | SetImageMean (SimpleDatum d) |
Set the image mean on for the ImageSet. More... | |
SimpleDatum | GetImageMean (Log log, WaitHandle[] rgAbort) |
Returns the image mean for the ImageSet. More... | |
void | UpdateLabelBoosts (int nProjectId) |
Update the label boosts for a project. More... | |
void | SetLabelMapping (LabelMapping map) |
Set the label mapping of the ImageSet. More... | |
void | UpdateLabelMapping (int nNewLabel, List< int > rgOriginalLabels) |
Update the label mapping on the ImageSet. More... | |
void | ResetLabels (int nProjectId) |
Resets the labels for a project. More... | |
void | DeleteLabelBoosts (int nProjectId) |
Deletes the label boosts for a project. More... | |
void | AddLabelBoost (int nProjectId, int nLabel, double dfBoost) |
Adds a label boost for a project. More... | |
string | GetLabelBoostsAsText (int nProjectId) |
Returns the label boosts as text. More... | |
Dictionary< int, int > | LoadLabelCounts () |
Returns the label counts as a dictionary of item pairs (int nLabel, int nCount). More... | |
void | UpdateLabelCounts (int nProjectId) |
Updates the label counts for a project. More... | |
string | GetLabelCountsAsText () |
Returns the label counts for the ImageList as text. More... | |
void | Unload () |
Unload all images in the image set. More... | |
int | GetLoadedCount () |
Returns the number of images loaded. More... | |
int | GetTotalCount () |
Returns the total number of images. More... | |
void | ResetAllBoosts () |
Resets all image boosts to the original boost loaded from the physical database. More... | |
List< SimpleDatum > | GetImages (DateTime dt, int nImageCount, string strFilterVal=null) |
Get a set of images, listed in chronological order starting at the next date greater than or equal to 'dt'. More... | |
bool | Sort (IMGDB_SORT method) |
Sort the internal images. More... | |
Protected Member Functions | |
ImageSet () | |
The Imageset constructor. More... | |
virtual void | Dispose (bool bDisposing) |
Releases the resouces used. More... | |
Properties | |
SourceDescriptor | Source [get] |
Returns the data source of the image set. More... | |
int | SourceID [get] |
Returns the data source ID of the image set. More... | |
string | SourceName [get] |
Returns the data source name of the image set. More... | |
bool | IsRealData [get] |
Returns whether or not the image set contains real or byte based data. More... | |
int | Count [get] |
Returns the number of images in the image set. More... | |
SimpleDatum[] | Images [get] |
Get the array of images. More... | |
Events | |
EventHandler< CalculateImageMeanArgs > | OnCalculateImageMean |
The OnCalculateImageMean event fires when the ImageSet needs to calculate the image mean for the image set. More... | |
The ImageSet class contains the list of image for a data source as well as a list of LabelSets that map into it.
Definition at line 16 of file Imageset.cs.
MyCaffe.db.image.ImageSet.ImageSet | ( | DatasetFactory | factory, |
SourceDescriptor | src, | ||
DB_LOAD_METHOD | loadMethod, | ||
int | nLoadLimit, | ||
CryptoRandom | random | ||
) |
The ImageSet constructor.
factory | Specifies the DatasetFactory. |
src | Specifies the data source. |
loadMethod | Specifies the method to use when loading the images. |
nLoadLimit | Specifies the image load limit. |
random | Specifies the random number generator. |
Definition at line 53 of file Imageset.cs.
|
protected |
The Imageset constructor.
Definition at line 80 of file Imageset.cs.
bool MyCaffe.db.image.ImageSet.Add | ( | int | nIdx, |
SimpleDatum | d | ||
) |
Adds a new image to the image set.
nIdx | Specifies the index on where to add the image. |
d | Specifies the image data. |
Definition at line 307 of file Imageset.cs.
void MyCaffe.db.image.ImageSet.AddLabelBoost | ( | int | nProjectId, |
int | nLabel, | ||
double | dfBoost | ||
) |
Adds a label boost for a project.
nProjectId | Specifies the ID of the project. |
nLabel | Specifies the label. |
dfBoost | Specifies the label boost. |
Definition at line 818 of file Imageset.cs.
ImageSet MyCaffe.db.image.ImageSet.Clone | ( | ) |
Returns a copy of the ImageSet.
Definition at line 220 of file Imageset.cs.
void MyCaffe.db.image.ImageSet.CompleteLoad | ( | int | nLastImageIdx | ) |
Complete the image loading process.
nLastImageIdx | Specifies the last image index loaded. |
Definition at line 377 of file Imageset.cs.
void MyCaffe.db.image.ImageSet.DeleteLabelBoosts | ( | int | nProjectId | ) |
Deletes the label boosts for a project.
nProjectId | Specifies the ID of the project. |
Definition at line 807 of file Imageset.cs.
void MyCaffe.db.image.ImageSet.Dispose | ( | ) |
Releases the resouces used.
Definition at line 102 of file Imageset.cs.
|
protectedvirtual |
Releases the resouces used.
bDisposing | Set to true when called by Dispose() |
Definition at line 89 of file Imageset.cs.
int MyCaffe.db.image.ImageSet.FindImageIndex | ( | DateTime | dt, |
string | strDesc | ||
) |
Searches for an image index based on its time-stamp and description.
dt | Specifies the time-stamp. |
strDesc | Specifies the description. |
Definition at line 263 of file Imageset.cs.
int MyCaffe.db.image.ImageSet.GetCount | ( | bool | bSuperboostOnly, |
string | strFilterVal = null , |
||
int? | nBoostVal = null |
||
) |
Returns the number of images in the image set, optionally with super-boost only.
bSuperboostOnly | Specifies whether or not to only count images with super-boost. |
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). |
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 479 of file Imageset.cs.
SimpleDatum MyCaffe.db.image.ImageSet.GetImage | ( | int | nIdx, |
DB_LABEL_SELECTION_METHOD | labelSelectionMethod, | ||
DB_ITEM_SELECTION_METHOD | imageSelectionMethod, | ||
Log | log, | ||
bool | bLoadDataCriteria = false , |
||
bool | bLoadDebugData = false |
||
) |
Returns the image based on its label and image selection method.
nIdx | Specifies the image index to use when loading sequentially. |
labelSelectionMethod | Specifies the label selection method. |
imageSelectionMethod | Specifies the image selection method. |
log | Specifies the Log for status output. |
bLoadDataCriteria | Specifies to load the data criteria data (default = false). |
bLoadDebugData | Specifies to load the debug data (default = false). |
Definition at line 535 of file Imageset.cs.
SimpleDatum MyCaffe.db.image.ImageSet.GetImage | ( | int | nImageID | ) |
Returns the SimpleDatum of the image at a given ID.
nImageID | Specifies the Raw Image ID to get. |
Definition at line 610 of file Imageset.cs.
SimpleDatum MyCaffe.db.image.ImageSet.GetImageMean | ( | Log | log, |
WaitHandle[] | rgAbort | ||
) |
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. |
Definition at line 714 of file Imageset.cs.
List< SimpleDatum > MyCaffe.db.image.ImageSet.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 516 of file Imageset.cs.
List< SimpleDatum > MyCaffe.db.image.ImageSet.GetImages | ( | bool | bSuperboostOnly, |
string | strFilterVal = null , |
||
int? | nBoostVal = null , |
||
int | nStartIdx = 0 , |
||
int | nQueryCount = int.MaxValue |
||
) |
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 | 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). |
nStartIdx | Optionally, specifies a starting index from which the query is to start within the set of images (default = 0). |
nQueryCount | Optionally, specifies a number of images to retrieve within the set (default = int.MaxValue). |
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 496 of file Imageset.cs.
List< SimpleDatum > MyCaffe.db.image.ImageSet.GetImages | ( | DateTime | dt, |
int | nImageCount, | ||
string | strFilterVal = null |
||
) |
Get a set of images, listed in chronological order starting at the next date greater than or equal to 'dt'.
dt | Specifies the start date of the images sought. |
nImageCount | Specifies the number of images to retrieve. |
strFilterVal | Optionally, specifies the filter value that the description must match (default = null, which ignores this parameter). |
IMPORTANT: You must call Sort(ByDesc|ByDate) before using this function to ensure all loaded images are ordered by their descriptions then by their time.
Definition at line 918 of file Imageset.cs.
string MyCaffe.db.image.ImageSet.GetLabelBoostsAsText | ( | int | nProjectId | ) |
Returns the label boosts as text.
nProjectId | Specifies the ID of the project. |
Definition at line 828 of file Imageset.cs.
string MyCaffe.db.image.ImageSet.GetLabelCountsAsText | ( | ) |
Returns the label counts for the ImageList as text.
Definition at line 855 of file Imageset.cs.
string MyCaffe.db.image.ImageSet.GetLabelName | ( | int | nLabel | ) |
Returns the label name of a label.
nLabel | Specifies the label. |
Definition at line 191 of file Imageset.cs.
List< LabelDescriptor > MyCaffe.db.image.ImageSet.GetLabels | ( | ) |
Returns a list of label descriptors used by the image set.
Definition at line 174 of file Imageset.cs.
LabelSet MyCaffe.db.image.ImageSet.GetLabelSet | ( | int | nLabel | ) |
Retuns the LabelSet corresponding to a label.
nLabel | Specifies the label. |
Definition at line 631 of file Imageset.cs.
int MyCaffe.db.image.ImageSet.GetLoadedCount | ( | ) |
string MyCaffe.db.image.ImageSet.GetQueryBoostHitPrecentsAsText | ( | ) |
Get the queried boost hit percents as a string.
Definition at line 137 of file Imageset.cs.
Dictionary< int, ulong > MyCaffe.db.image.ImageSet.GetQueryLabelCounts | ( | ) |
Retrieves the label counts.
Definition at line 111 of file Imageset.cs.
string MyCaffe.db.image.ImageSet.GetQueryLabelEpocsAsText | ( | ) |
Get the queried label epoc per label as a text string.
Definition at line 161 of file Imageset.cs.
string MyCaffe.db.image.ImageSet.GetQueryLabelHitPrecentsAsText | ( | ) |
Get the queried label hit percents as a string.
Definition at line 149 of file Imageset.cs.
int MyCaffe.db.image.ImageSet.GetTotalCount | ( | ) |
Dictionary< int, int > MyCaffe.db.image.ImageSet.LoadLabelCounts | ( | ) |
Returns the label counts as a dictionary of item pairs (int nLabel, int nCount).
Definition at line 837 of file Imageset.cs.
void MyCaffe.db.image.ImageSet.Relabel | ( | LabelMappingCollection | col | ) |
Applies the label mapping to the image set.
col |
Definition at line 206 of file Imageset.cs.
void MyCaffe.db.image.ImageSet.ReloadLabelSets | ( | ) |
Reload the label sets.
Definition at line 343 of file Imageset.cs.
void MyCaffe.db.image.ImageSet.Reset | ( | ) |
Resets the indexes and limited loaded images (if used).
Definition at line 294 of file Imageset.cs.
void MyCaffe.db.image.ImageSet.ResetAllBoosts | ( | ) |
Resets all image boosts to the original boost loaded from the physical database.
Definition at line 902 of file Imageset.cs.
void MyCaffe.db.image.ImageSet.ResetLabels | ( | int | nProjectId | ) |
Resets the labels for a project.
nProjectId | Specifies the ID of the project. |
Definition at line 798 of file Imageset.cs.
void MyCaffe.db.image.ImageSet.SetImageMean | ( | SimpleDatum | d | ) |
Set the image mean on for the ImageSet.
d | Specifies the image mean. |
Definition at line 703 of file Imageset.cs.
void MyCaffe.db.image.ImageSet.SetLabelMapping | ( | LabelMapping | map | ) |
Set the label mapping of the ImageSet.
map | Specifies the label map. |
Definition at line 779 of file Imageset.cs.
void MyCaffe.db.image.ImageSet.SetQueryLabelCount | ( | int | nLabel, |
int | nBoost | ||
) |
Increase the query label count for a specific label.
nLabel | Specifies the label who's query count is to be increased. |
nBoost | Specifies the boost of the image, or 0 if not boosted. |
Definition at line 124 of file Imageset.cs.
bool MyCaffe.db.image.ImageSet.Sort | ( | IMGDB_SORT | method | ) |
Sort the internal images.
method | Specifies the sorting method. |
NOTE: Sorting only applies to the images currently loaded.
Definition at line 932 of file Imageset.cs.
void MyCaffe.db.image.ImageSet.Unload | ( | ) |
Unload all images in the image set.
Definition at line 863 of file Imageset.cs.
void MyCaffe.db.image.ImageSet.UpdateLabelBoosts | ( | int | nProjectId | ) |
Update the label boosts for a project.
nProjectId | Specifies the ID of the project. |
Definition at line 754 of file Imageset.cs.
void MyCaffe.db.image.ImageSet.UpdateLabelCounts | ( | int | nProjectId | ) |
Updates the label counts for a project.
nProjectId | Specifies the ID of the project. |
Definition at line 846 of file Imageset.cs.
void MyCaffe.db.image.ImageSet.UpdateLabelMapping | ( | int | nNewLabel, |
List< int > | rgOriginalLabels | ||
) |
Update the label mapping on the ImageSet.
nNewLabel | Specifies the new label. |
rgOriginalLabels | Specifies the labels to be mapped to the new label. |
Definition at line 789 of file Imageset.cs.
|
get |
Returns the number of images in the image set.
Definition at line 425 of file Imageset.cs.
|
get |
Get the array of images.
Definition at line 433 of file Imageset.cs.
|
get |
Returns whether or not the image set contains real or byte based data.
Definition at line 417 of file Imageset.cs.
|
get |
Returns the data source of the image set.
Definition at line 393 of file Imageset.cs.
|
get |
Returns the data source ID of the image set.
Definition at line 401 of file Imageset.cs.
|
get |
Returns the data source name of the image set.
Definition at line 409 of file Imageset.cs.
EventHandler<CalculateImageMeanArgs> MyCaffe.db.image.ImageSet.OnCalculateImageMean |
The OnCalculateImageMean event fires when the ImageSet needs to calculate the image mean for the image set.
Definition at line 43 of file Imageset.cs.