MyCaffe
1.12.2.41
Deep learning software for Windows C# programmers.
|
The MyCaffeImageDatabase provides an enhanced in-memory image database used for quick image retrieval. More...
Public Member Functions | |
MyCaffeImageDatabase (Log log=null, string strId="default", int nSeed=0) | |
The MyCaffeImageDatabase constructor. More... | |
MyCaffeImageDatabase (IContainer container) | |
The MyCaffeImageDatabase constructor. More... | |
DB_VERSION | GetVersion () |
Returns the version of the MyCaffe Image Database being used. More... | |
void | SetConnection (ConnectInfo ci) |
Set the database connection to use. More... | |
Tuple< DB_LABEL_SELECTION_METHOD, DB_ITEM_SELECTION_METHOD > | GetSelectionMethod () |
Returns the label and image selection method used. More... | |
void | SetSelectionMethod (DB_LABEL_SELECTION_METHOD? lbl, DB_ITEM_SELECTION_METHOD? img) |
Sets the label and image selection methods. More... | |
bool | GetLoadItemDataCriteria () |
Returns whether or not the image data criteria is loaded with each image. More... | |
bool | GetLoadItemDebugData () |
Returns whether or not the image debug data is loaded with each image. More... | |
void | Enable (bool bEnable) |
Sets whether or not the image database is enabled. More... | |
bool | InitializeWithDsName1 (SettingsCaffe s, string strDs, string strEvtCancel=null, PropertySet prop=null) |
Initializes the image database. More... | |
bool | InitializeWithDs1 (SettingsCaffe s, DatasetDescriptor ds, string strEvtCancel=null, PropertySet prop=null) |
Initializes the image database. More... | |
bool | InitializeWithDsId1 (SettingsCaffe s, int nDataSetID, string strEvtCancel=null, int nPadW=0, int nPadH=0, PropertySet prop=null) |
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 | LoadNextSet (string strEvtCancel) |
When using a Load Limit that is greater than 0, this function loads the next set of images. More... | |
void | UpdateLabelBoosts (int nProjectID, int nSrcID) |
Updates the label boosts for the images based on the label boosts set for the given project. More... | |
int | ImageCount (int nSrcId) |
Returns the number of images in a given data source. More... | |
int | GetItemCount (int nSrcId, string strFilterVal=null, int? nBoostVal=null, bool bBoostValIsExact=false) |
Returns the number of images in a given data source. More... | |
List< SimpleDatum > | GetItemsFromIndex (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< SimpleDatum > | GetItemsFromTime (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< SimpleDatum > | GetItems (int nSrcId, int[] rgIdx, 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... | |
bool | Sort (int nSrcId, IMGDB_SORT method) |
Sort the internal images. More... | |
int | CreateDatasetOranizedByTime (int nDsId) |
Create a dynamic dataset organized by time from a pre-existing dataset. More... | |
bool | DeleteCreatedDataset (int nDsId) |
Delete a dataset created with CreateDatasetOrganizedByTime. More... | |
void | DeleteAllCreatedDatasets () |
Delete all datasets created with CreateDatasetOrganizedByTime More... | |
SimpleDatum | QueryItem (int nSrcId, int nIdx, DB_LABEL_SELECTION_METHOD? labelSelectionOverride=null, DB_ITEM_SELECTION_METHOD? imageSelectionOverride=null, int? nLabel=null, bool bLoadDataCriteria=false, bool bLoadDebugData=false) |
Query an image in a given data source. More... | |
void | ResetQuery (int nDsID) |
Reset the query for the given data set ID. More... | |
SimpleDatum | GetItem (int nImageID, params int[] rgSrcId) |
Returns the image with a given Raw Image ID. More... | |
void | ResetAllBoosts (int nSrcId) |
Reset all in-memory image boosts. More... | |
List< LabelDescriptor > | GetLabels (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... | |
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... | |
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... | |
int | FindItemIndex (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 | GetItemMean (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 | QueryItemMeanFromDataset (int nDatasetId) |
Returns the image mean for the Training data source of a given data set. More... | |
SimpleDatum | QueryItemMeanFromDb (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 | QueryItemMean (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... | |
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 | DeleteLabelBoosts (int nProjectId, int nSrcId) |
Delete all label boosts for a given data source associated with a given project. More... | |
void | AddLabelBoost (int nProjectID, int nSrcId, int nLabel, double dfBoost) |
Add a label boost for a data source associated with a given project. More... | |
string | GetLabelBoostsAsTextFromProject (int nProjectId, int nSrcId) |
Returns the label boosts as a text string for all boosted labels within a data source associated with a given project. 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... | |
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... | |
string | GetBoostQueryHitPercentsAsTextFromSourceName (string strSource) |
Returns the percentage of boosted images queried as text. More... | |
bool | LoadDatasetByName1 (string strDs, string strEvtCancel=null) |
Load another 'secondary' dataset. More... | |
bool | LoadDatasetByID1 (int nDsId, string strEvtCancel=null) |
Load another 'secondary' dataset. More... | |
bool | ReloadDataset (int nDsId) |
Reload a data set. More... | |
bool | ReloadImageSet (int nSrcID) |
Reloads the images of a data source. 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... | |
Static Public Member Functions | |
static Tuple< DB_LABEL_SELECTION_METHOD, DB_ITEM_SELECTION_METHOD > | GetSelectionMethod (SettingsCaffe s) |
Returns the label/image selection methods based on the SettingsCaffe settings. More... | |
static Tuple< DB_LABEL_SELECTION_METHOD, DB_ITEM_SELECTION_METHOD > | GetSelectionMethod (ProjectEx p) |
Returns the label/image selection methods based on the ProjectEx settings. More... | |
static void | CreateDatabase (string strName, string strPath) |
Create the database used by the MyCaffeImageDatabase. 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< CalculateImageMeanArgs > | OnCalculateImageMean |
The OnCalculateImageMean event fires each time the MyCaffeImageDatabase wants to access the image mean for a data set. More... | |
The MyCaffeImageDatabase provides an enhanced in-memory image database used for quick image retrieval.
The MyCaffeImageDatbase 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 26 of file MyCaffeImageDatabase.cs.
MyCaffe.db.image.MyCaffeImageDatabase.MyCaffeImageDatabase | ( | Log | log = null , |
string | strId = "default" , |
||
int | nSeed = 0 |
||
) |
The MyCaffeImageDatabase constructor.
log | The Log for output. |
strId | Specifies an identifier for this in memory database instance (default = "default"). |
nSeed | Optionally, specifies a seed for the random number generator (default = null). |
Definition at line 63 of file MyCaffeImageDatabase.cs.
MyCaffe.db.image.MyCaffeImageDatabase.MyCaffeImageDatabase | ( | IContainer | container | ) |
The MyCaffeImageDatabase constructor.
container | Specifies a container. |
Definition at line 79 of file MyCaffeImageDatabase.cs.
void MyCaffe.db.image.MyCaffeImageDatabase.AddLabelBoost | ( | int | nProjectID, |
int | nSrcId, | ||
int | nLabel, | ||
double | dfBoost | ||
) |
Add a label boost for a data source associated with a given project.
nProjectID | Specifies the project ID. |
nSrcId | Specifies the ID of the data source. |
nLabel | Specifies the label. |
dfBoost | Specifies the new boost for the label. |
Definition at line 1189 of file MyCaffeImageDatabase.cs.
void MyCaffe.db.image.MyCaffeImageDatabase.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.
nDsId | Optionally, specifies the dataset previously loaded. |
bForce | Optionally, force the cleanup even if other users are using the database. |
Definition at line 480 of file MyCaffeImageDatabase.cs.
|
static |
Create the database used by the MyCaffeImageDatabase.
strName | Specifies the name of the database (recommended value = "DNN"). |
strPath | Specifies the file path where the database is to be created. |
Definition at line 1502 of file MyCaffeImageDatabase.cs.
int MyCaffe.db.image.MyCaffeImageDatabase.CreateDatasetOranizedByTime | ( | int | nDsId | ) |
Create a dynamic dataset organized by time from a pre-existing dataset.
nDsId | Specifies the database ID of the dataset to copy. |
Definition at line 697 of file MyCaffeImageDatabase.cs.
void MyCaffe.db.image.MyCaffeImageDatabase.DeleteAllCreatedDatasets | ( | ) |
Delete all datasets created with CreateDatasetOrganizedByTime
Definition at line 740 of file MyCaffeImageDatabase.cs.
bool MyCaffe.db.image.MyCaffeImageDatabase.DeleteCreatedDataset | ( | int | nDsId | ) |
Delete a dataset created with CreateDatasetOrganizedByTime.
nDsId | Specifies the dataset ID of the created dataset. |
Definition at line 725 of file MyCaffeImageDatabase.cs.
void MyCaffe.db.image.MyCaffeImageDatabase.DeleteLabelBoosts | ( | int | nProjectId, |
int | nSrcId | ||
) |
Delete all label boosts for a given data source associated with a given project.
nProjectId | Specifies the project ID. |
nSrcId | Specifies the ID of the data source. |
Definition at line 1177 of file MyCaffeImageDatabase.cs.
|
protected |
Clean up any resources being used.
disposing | true if managed resources should be disposed; otherwise, false. |
Definition at line 14 of file MyCaffeImageDatabase.Designer.cs.
bool MyCaffe.db.image.MyCaffeImageDatabase.DoesImageMeanExists | ( | int | nSrcId | ) |
Returns whether or not the image mean exists in the disk-based database for a given data source.
nSrcId | Specifies the ID of the data source. |
Definition at line 1121 of file MyCaffeImageDatabase.cs.
void MyCaffe.db.image.MyCaffeImageDatabase.Enable | ( | bool | bEnable | ) |
Sets whether or not the image database is enabled.
bEnable |
Definition at line 304 of file MyCaffeImageDatabase.cs.
int MyCaffe.db.image.MyCaffeImageDatabase.FindItemIndex | ( | 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.
nSrcId | Specifies the data source ID of the data source to be searched. |
dt | Specifies the time-stamp to search for. |
strDescription | Specifies the description to search for. |
Definition at line 1009 of file MyCaffeImageDatabase.cs.
string MyCaffe.db.image.MyCaffeImageDatabase.GetBoostQueryHitPercentsAsTextFromSourceName | ( | string | strSource | ) |
Returns the percentage of boosted images queried as text.
strSource | Specifies the source to query. |
Definition at line 1270 of file MyCaffeImageDatabase.cs.
DatasetDescriptor MyCaffe.db.image.MyCaffeImageDatabase.GetDatasetById | ( | int | nDsId | ) |
Returns the DatasetDescriptor for a given data set ID.
nDsId | Specifies the data set ID. |
Definition at line 897 of file MyCaffeImageDatabase.cs.
DatasetDescriptor MyCaffe.db.image.MyCaffeImageDatabase.GetDatasetByName | ( | string | strDs | ) |
Returns the DatasetDescriptor for a given data set name.
strDs | Specifies the data set name. |
Definition at line 908 of file MyCaffeImageDatabase.cs.
int MyCaffe.db.image.MyCaffeImageDatabase.GetDatasetID | ( | string | strDs | ) |
Returns a data set ID given its name.
strDs | Specifies the data set name. |
Definition at line 919 of file MyCaffeImageDatabase.cs.
double MyCaffe.db.image.MyCaffeImageDatabase.GetDatasetLoadedPercentById | ( | int | nDatasetID, |
out double | dfTraining, | ||
out double | dfTesting | ||
) |
Returns the percentage that a dataset is loaded into memory.
nDatasetID | Specifies the ID of the dataset. |
dfTraining | Specifies the percent of training images that are loaded. |
dfTesting | Specifies the percent of testing images that are loaded. |
Definition at line 1480 of file MyCaffeImageDatabase.cs.
double MyCaffe.db.image.MyCaffeImageDatabase.GetDatasetLoadedPercentByName | ( | string | strDataset, |
out double | dfTraining, | ||
out double | dfTesting | ||
) |
Returns the percentage that a dataset is loaded into memory.
strDataset | Specifies the name of the dataset. |
dfTraining | Specifies the percent of training images that are loaded. |
dfTesting | Specifies the percent of testing images that are loaded. |
Definition at line 1456 of file MyCaffeImageDatabase.cs.
string MyCaffe.db.image.MyCaffeImageDatabase.GetDatasetName | ( | int | nDsId | ) |
Returns a data set name given its ID.
nDsId | Specifies the data set ID. |
Definition at line 933 of file MyCaffeImageDatabase.cs.
SimpleDatum MyCaffe.db.image.MyCaffeImageDatabase.GetItem | ( | int | nImageID, |
params int[] | rgSrcId | ||
) |
Returns the image with a given Raw Image ID.
nImageID | Specifies the Raw Image ID. |
rgSrcId | Specifies a set of source ID's to query from. |
Definition at line 835 of file MyCaffeImageDatabase.cs.
int MyCaffe.db.image.MyCaffeImageDatabase.GetItemCount | ( | int | nSrcId, |
string | strFilterVal = null , |
||
int? | nBoostVal = null , |
||
bool | bBoostValIsExact = false |
||
) |
Returns the number of images in a given data source.
nSrcId | Specifies the data source ID. |
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 (Not used for version 1). |
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 600 of file MyCaffeImageDatabase.cs.
SimpleDatum MyCaffe.db.image.MyCaffeImageDatabase.GetItemMean | ( | int | nSrcId | ) |
Returns the image mean for a data source.
nSrcId | Specifies the ID of the data source. |
Definition at line 1019 of file MyCaffeImageDatabase.cs.
List< SimpleDatum > MyCaffe.db.image.MyCaffeImageDatabase.GetItems | ( | int | nSrcId, |
int[] | rgIdx, | ||
string | strFilterVal = null , |
||
int? | nBoostVal = null , |
||
bool | bBoostValIsExact = false |
||
) |
Returns the array of images in the image set, possibly filtered with the filtering parameters.
nSrcId | Specifies the data source ID. |
rgIdx | Specifies an array of indexes to query. |
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 - not used in Version 1. |
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 667 of file MyCaffeImageDatabase.cs.
List< SimpleDatum > MyCaffe.db.image.MyCaffeImageDatabase.GetItemsFromIndex | ( | 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.
nSrcId | Specifies the data source ID. |
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 | Not used in version 1, all boost values are treated as inexact (bBoostValIsExact = false). |
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', and positive values are used to test for boost values that are greater than or equal to the 'nBoostValue'.
Definition at line 623 of file MyCaffeImageDatabase.cs.
List< SimpleDatum > MyCaffe.db.image.MyCaffeImageDatabase.GetItemsFromTime | ( | 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.
nSrcId | Specifies the data source ID. |
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 | Not used in version 1. |
bBoostValIsExact | Not used in version 1. |
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 647 of file MyCaffeImageDatabase.cs.
string MyCaffe.db.image.MyCaffeImageDatabase.GetLabelBoostsAsTextFromProject | ( | int | nProjectId, |
int | nSrcId | ||
) |
Returns the label boosts as a text string for all boosted labels within a data source associated with a given project.
nProjectId | Specifies the project ID. |
nSrcId | Specifies the ID of the data source. |
Definition at line 1200 of file MyCaffeImageDatabase.cs.
string MyCaffe.db.image.MyCaffeImageDatabase.GetLabelCountsAsTextFromSourceId | ( | int | nSrcId | ) |
Returns a string with all label counts for a data source.
nSrcId | Specifies the ID of the data source. |
Definition at line 1230 of file MyCaffeImageDatabase.cs.
string MyCaffe.db.image.MyCaffeImageDatabase.GetLabelCountsAsTextFromSourceName | ( | string | strSource | ) |
Returns a string with all label counts for a data source.
strSource | Specifies the name of the data source. |
Definition at line 1240 of file MyCaffeImageDatabase.cs.
string MyCaffe.db.image.MyCaffeImageDatabase.GetLabelName | ( | int | nSrcId, |
int | nLabel | ||
) |
Returns the text name of a given label within a data source.
nSrcId | Specifies the data source ID. |
nLabel | Specifies the label. |
Definition at line 887 of file MyCaffeImageDatabase.cs.
string MyCaffe.db.image.MyCaffeImageDatabase.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).
strSource | Specifies the data source who's query epochs are to be retrieved. |
Definition at line 1260 of file MyCaffeImageDatabase.cs.
string MyCaffe.db.image.MyCaffeImageDatabase.GetLabelQueryHitPercentsAsTextFromSourceName | ( | string | strSource | ) |
Returns a string with the query hit percent for each label (e.g. the percentage that each label has been queried).
strSource | Specifies the data source who's hit percentages are to be retrieved. |
Definition at line 1250 of file MyCaffeImageDatabase.cs.
List< LabelDescriptor > MyCaffe.db.image.MyCaffeImageDatabase.GetLabels | ( | int | nSrcId | ) |
Returns a list of LabelDescriptors associated with the labels within a data source.
nSrcId | Specifies the data source ID. |
Definition at line 876 of file MyCaffeImageDatabase.cs.
bool MyCaffe.db.image.MyCaffeImageDatabase.GetLoadItemDataCriteria | ( | ) |
Returns whether or not the image data criteria is loaded with each image.
Definition at line 242 of file MyCaffeImageDatabase.cs.
bool MyCaffe.db.image.MyCaffeImageDatabase.GetLoadItemDebugData | ( | ) |
Returns whether or not the image debug data is loaded with each image.
Definition at line 250 of file MyCaffeImageDatabase.cs.
Tuple< DB_LABEL_SELECTION_METHOD, DB_ITEM_SELECTION_METHOD > MyCaffe.db.image.MyCaffeImageDatabase.GetSelectionMethod | ( | ) |
Returns the label and image selection method used.
Definition at line 220 of file MyCaffeImageDatabase.cs.
|
static |
Returns the label/image selection methods based on the ProjectEx settings.
p | Specifies the project. |
Definition at line 192 of file MyCaffeImageDatabase.cs.
|
static |
Returns the label/image selection methods based on the SettingsCaffe settings.
s | Specifies the caffe settings. |
Definition at line 160 of file MyCaffeImageDatabase.cs.
SourceDescriptor MyCaffe.db.image.MyCaffeImageDatabase.GetSourceById | ( | int | nSrcId | ) |
Returns the SourceDescriptor for a given data source ID.
nSrcId | Specifies the data source ID. |
Definition at line 947 of file MyCaffeImageDatabase.cs.
SourceDescriptor MyCaffe.db.image.MyCaffeImageDatabase.GetSourceByName | ( | string | strSrc | ) |
Returns the SourceDescriptor for a given data source name.
strSrc | Specifies the data source name. |
Definition at line 961 of file MyCaffeImageDatabase.cs.
int MyCaffe.db.image.MyCaffeImageDatabase.GetSourceID | ( | string | strSrc | ) |
Returns a data source ID given its name.
strSrc | Specifies the data source name. |
Definition at line 975 of file MyCaffeImageDatabase.cs.
string MyCaffe.db.image.MyCaffeImageDatabase.GetSourceName | ( | int | nSrcId | ) |
Returns a data source name given its ID.
nSrcId | Specifies the data source ID. |
Definition at line 989 of file MyCaffeImageDatabase.cs.
DB_VERSION MyCaffe.db.image.MyCaffeImageDatabase.GetVersion | ( | ) |
Returns the version of the MyCaffe Image Database being used.
Definition at line 91 of file MyCaffeImageDatabase.cs.
int MyCaffe.db.image.MyCaffeImageDatabase.ImageCount | ( | int | nSrcId | ) |
Returns the number of images in a given data source.
nSrcId | Specifies the data source ID. |
Definition at line 580 of file MyCaffeImageDatabase.cs.
bool MyCaffe.db.image.MyCaffeImageDatabase.InitializeWithDs1 | ( | SettingsCaffe | s, |
DatasetDescriptor | ds, | ||
string | strEvtCancel = null , |
||
PropertySet | prop = null |
||
) |
Initializes the image database.
s | Specifies the caffe settings. |
ds | Specifies the data set to load. |
strEvtCancel | Optionally, specifies the name of the CancelEvent used to cancel load operations (default = null). |
prop | Optionally, specifies the properties for the initialization (default = null). |
Definition at line 338 of file MyCaffeImageDatabase.cs.
bool MyCaffe.db.image.MyCaffeImageDatabase.InitializeWithDsId1 | ( | SettingsCaffe | s, |
int | nDataSetID, | ||
string | strEvtCancel = null , |
||
int | nPadW = 0 , |
||
int | nPadH = 0 , |
||
PropertySet | prop = null |
||
) |
Initializes the image database.
s | Specifies the caffe settings. |
nDataSetID | Specifies the database ID of the data set to load. |
strEvtCancel | Optionally, specifies the name of the CancelEvent used to cancel load operations (default = null). |
nPadW | Optionally, specifies the padding to add to each image width (default = 0). |
nPadH | Optionally, specifies the padding to add to each image height (default = 0). |
prop | Optionally, specifies the properties for the initialization (default = null). |
Definition at line 364 of file MyCaffeImageDatabase.cs.
bool MyCaffe.db.image.MyCaffeImageDatabase.InitializeWithDsName1 | ( | SettingsCaffe | s, |
string | strDs, | ||
string | strEvtCancel = null , |
||
PropertySet | prop = null |
||
) |
Initializes the image database.
s | Specifies the caffe settings. |
strDs | Specifies the data set to load. |
strEvtCancel | Optionally, specifies the name of the CancelEvent used to cancel load operations (default = null). |
prop | Optionally, specifies the properties for the initialization (default = null). |
Definition at line 325 of file MyCaffeImageDatabase.cs.
bool MyCaffe.db.image.MyCaffeImageDatabase.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.
nDsId | Specifies the ID of the data set. |
strEvtCancel | Specifies the name of the CancelEvent used to cancel load operations. |
Definition at line 1302 of file MyCaffeImageDatabase.cs.
bool MyCaffe.db.image.MyCaffeImageDatabase.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.
strDs | Specifies the name of the data set. |
strEvtCancel | Specifies the name of the CancelEvent used to cancel load operations. |
Definition at line 1285 of file MyCaffeImageDatabase.cs.
Dictionary< int, int > MyCaffe.db.image.MyCaffeImageDatabase.LoadLabelCounts | ( | int | nSrcId | ) |
Returns a label lookup of counts for a given data source.
nSrcId | Specifies the ID of the data source. |
Definition at line 1220 of file MyCaffeImageDatabase.cs.
bool MyCaffe.db.image.MyCaffeImageDatabase.LoadNextSet | ( | string | strEvtCancel | ) |
When using a Load Limit that is greater than 0, this function loads the next set of images.
strEvtCancel | Specifies the name of the Cancel Event to abort loading the images. |
Definition at line 521 of file MyCaffeImageDatabase.cs.
SimpleDatum MyCaffe.db.image.MyCaffeImageDatabase.QueryItem | ( | int | nSrcId, |
int | nIdx, | ||
DB_LABEL_SELECTION_METHOD? | labelSelectionOverride = null , |
||
DB_ITEM_SELECTION_METHOD? | imageSelectionOverride = null , |
||
int? | nLabel = null , |
||
bool | bLoadDataCriteria = false , |
||
bool | bLoadDebugData = false |
||
) |
Query an image in a given data source.
nSrcId | Specifies the databse ID of the data source. |
nIdx | Specifies the image index to query. Note, the index is only used in non-random image queries. |
labelSelectionOverride | Optionally, specifies the label selection method override. The default = null, which directs the method to use the label selection method specified during Initialization. |
imageSelectionOverride | Optionally, specifies the image selection method override. The default = null, which directs the method to use the image selection method specified during Initialization. |
nLabel | Optionally, specifies a label set to use for the image selection. When specified only images of this label are returned using the image selection method. |
bLoadDataCriteria | Specifies to load the data criteria data (default = false). |
bLoadDebugData | Specifies to load the debug data (default = false). |
Definition at line 756 of file MyCaffeImageDatabase.cs.
SimpleDatum MyCaffe.db.image.MyCaffeImageDatabase.QueryItemMean | ( | 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.
nSrcId | Specifies the ID of the data source. |
Definition at line 1108 of file MyCaffeImageDatabase.cs.
SimpleDatum MyCaffe.db.image.MyCaffeImageDatabase.QueryItemMeanFromDataset | ( | int | nDatasetId | ) |
Returns the image mean for the Training data source of a given data set.
nDatasetId | Specifies the data set to use. |
Definition at line 1060 of file MyCaffeImageDatabase.cs.
SimpleDatum MyCaffe.db.image.MyCaffeImageDatabase.QueryItemMeanFromDb | ( | 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.
nSrcId | Specifies the ID of the data source. |
Definition at line 1078 of file MyCaffeImageDatabase.cs.
bool MyCaffe.db.image.MyCaffeImageDatabase.ReloadDataset | ( | int | nDsId | ) |
Reload a data set.
nDsId | Specifies the ID of the data set. |
Definition at line 1352 of file MyCaffeImageDatabase.cs.
bool MyCaffe.db.image.MyCaffeImageDatabase.ReloadImageSet | ( | int | nSrcID | ) |
Reloads the images of a data source.
nSrcID | Specifies the ID of the data source. |
Definition at line 1369 of file MyCaffeImageDatabase.cs.
void MyCaffe.db.image.MyCaffeImageDatabase.ResetAllBoosts | ( | int | nSrcId | ) |
Reset all in-memory image boosts.
This does not impact the boost setting within the physical database.
nSrcId | Specifies the source ID of the data set to reset. |
Definition at line 861 of file MyCaffeImageDatabase.cs.
void MyCaffe.db.image.MyCaffeImageDatabase.ResetLabels | ( | int | nProjectId, |
int | nSrcId | ||
) |
Resets all labels within a data source, used by a project, to their original labels.
nProjectId | Specifies the ID of the project. |
nSrcId | Specifies the ID of the data source. |
Definition at line 1167 of file MyCaffeImageDatabase.cs.
void MyCaffe.db.image.MyCaffeImageDatabase.ResetQuery | ( | int | nDsID | ) |
Reset the query for the given data set ID.
nDsID | Specifies the data set ID whos query indexes are to be reset. |
Definition at line 818 of file MyCaffeImageDatabase.cs.
void MyCaffe.db.image.MyCaffeImageDatabase.SaveImageMean | ( | int | nSrcId, |
SimpleDatum | d, | ||
bool | bUpdate | ||
) |
Saves the image mean to a data source on the database on disk.
nSrcId | Specifies the ID of the data source. |
d | Specifies a SimpleDatum containing the image mean. |
bUpdate | Specifies whether or not to update the mean image. |
Definition at line 1097 of file MyCaffeImageDatabase.cs.
void MyCaffe.db.image.MyCaffeImageDatabase.SetConnection | ( | ConnectInfo | ci | ) |
Set the database connection to use.
ci | Specifies the dataase connection information to use. |
Definition at line 150 of file MyCaffeImageDatabase.cs.
void MyCaffe.db.image.MyCaffeImageDatabase.SetImageMean | ( | int | nSrcId, |
SimpleDatum | d | ||
) |
Sets the image mean for a data source.
nSrcId | Specifies the ID of the data source. |
d | Specifies a SimpleDatum containing the image mean. |
Definition at line 1045 of file MyCaffeImageDatabase.cs.
void MyCaffe.db.image.MyCaffeImageDatabase.SetLabelMapping | ( | int | nSrcId, |
LabelMapping | map | ||
) |
Sets the label mapping to the database for a given data source.
nSrcId | Specifies the ID of the data source. |
map | Specifies the label mapping to set. |
Definition at line 1146 of file MyCaffeImageDatabase.cs.
void MyCaffe.db.image.MyCaffeImageDatabase.SetSelectionMethod | ( | DB_LABEL_SELECTION_METHOD? | lbl, |
DB_ITEM_SELECTION_METHOD? | img | ||
) |
Sets the label and image selection methods.
lbl | Specifies the label selection method or null to ignore. |
img | Specifies the image selection method or null to ignore. |
Definition at line 230 of file MyCaffeImageDatabase.cs.
bool MyCaffe.db.image.MyCaffeImageDatabase.Sort | ( | int | nSrcId, |
IMGDB_SORT | method | ||
) |
Sort the internal images.
nSrcId | Specifies the database ID of the data source. |
method | Specifies the sorting method. |
Definition at line 682 of file MyCaffeImageDatabase.cs.
bool MyCaffe.db.image.MyCaffeImageDatabase.UnloadDatasetById | ( | int | nDataSetID | ) |
The UnloadDataset method removes the dataset specified from memory.
nDataSetID | Specifies the dataset ID to remove. |
Specifiying a dataset ID of -1 directs the UnloadDatasetById to unload ALL datasets loaded.
Definition at line 1417 of file MyCaffeImageDatabase.cs.
bool MyCaffe.db.image.MyCaffeImageDatabase.UnloadDatasetByName | ( | string | strDataset | ) |
The UnloadDataset method removes the dataset specified from memory.
strDataset | Specifies the dataset to remove. |
Definition at line 1386 of file MyCaffeImageDatabase.cs.
void MyCaffe.db.image.MyCaffeImageDatabase.UpdateLabelBoosts | ( | int | nProjectID, |
int | nSrcID | ||
) |
Updates the label boosts for the images based on the label boosts set for the given project.
nProjectID | Specifies the project ID in the database. |
nSrcID | Specifies the data source ID. |
Definition at line 570 of file MyCaffeImageDatabase.cs.
void MyCaffe.db.image.MyCaffeImageDatabase.UpdateLabelCounts | ( | int | nProjectID, |
int | nSrcId | ||
) |
Updates the number of images of each label within a data source.
nProjectID | Specifies a project ID. |
nSrcId | Specifies the ID of the data source. |
Definition at line 1210 of file MyCaffeImageDatabase.cs.
void MyCaffe.db.image.MyCaffeImageDatabase.UpdateLabelMapping | ( | int | nSrcId, |
int | nNewLabel, | ||
List< int > | rgOriginalLabels | ||
) |
Updates the label mapping in the database for a given data source.
nSrcId | Specifies the ID of the data source. |
nNewLabel | Specifies a new label. |
rgOriginalLabels | Specifies the original lables that are mapped to the new label. |
Definition at line 1157 of file MyCaffeImageDatabase.cs.
|
get |
Returns whether or not the image database is enabled.
Definition at line 295 of file MyCaffeImageDatabase.cs.
|
get |
Returns whether or not the image database is initialized.
Definition at line 312 of file MyCaffeImageDatabase.cs.
|
getset |
Get/set the output log.
Definition at line 140 of file MyCaffeImageDatabase.cs.
|
get |
Returns whether or not to select ONLY from boosted images.
Definition at line 276 of file MyCaffeImageDatabase.cs.
|
getset |
Get/set the super-boost probability which increases/decreases the probability of selecting a boosted image (default = 0).
Definition at line 267 of file MyCaffeImageDatabase.cs.
|
getset |
Get/set whether or not to use training images for the test set (default = false).
Definition at line 258 of file MyCaffeImageDatabase.cs.
EventHandler<CalculateImageMeanArgs> MyCaffe.db.image.MyCaffeImageDatabase.OnCalculateImageMean |
The OnCalculateImageMean event fires each time the MyCaffeImageDatabase wants to access the image mean for a data set.
Definition at line 55 of file MyCaffeImageDatabase.cs.