MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
Interfaces.cs
2using System;
3using System.Collections.Generic;
4using System.Linq;
5using System.Runtime.Serialization;
6using System.ServiceModel;
7using System.Text;
8
9namespace MyCaffe.basecode
10{
14 public enum SPECIAL_TOKENS
15 {
19 PAD = 0,
23 BOS = 1,
27 EOS = 2
28 }
29
34 {
38 NONE,
42 CUSTOM,
54 DUAL
55 }
56
60 public enum Phase
61 {
65 NONE = 0,
69 TRAIN = 1,
73 TEST = 2,
77 RUN = 3,
81 ALL = 5
82 }
83
87 public enum Stage
88 {
92 NONE = 0,
96 RNN = 1,
100 RL = 2,
104 ALL = 3,
108 CUSTOM = 4
109 }
110
111
115 public enum GYM_TYPE
116 {
120 NONE,
124 DYNAMIC,
128 DATA
129 }
130
134 public enum DATA_TYPE
135 {
139 DEFAULT,
143 VALUES,
147 BLOB
148 }
149
153 public enum DB_LOAD_METHOD
154 {
162 LOAD_ALL,
175 }
176
181 {
185 DISABLED = -1,
198 }
199
204 {
208 LAST_STATE = 0,
225 }
226
233 public enum ApVersion
234 {
247 }
248
252 public interface ITestKnownFailures
253 {
257 List<Tuple<string, string, string>> KnownFailures { get; }
264 int GetPriority(string strClass, string strMethod);
265 }
266
267
268 //-------------------------------------------------------------------------------------------------
269 // IXImageDatabase Interfaces
270 //-------------------------------------------------------------------------------------------------
271
275 [Serializable]
276 [DataContract]
278 {
282 [EnumMember]
283 NONE = 0x0000,
287 [EnumMember]
288 RANDOM = 0x0001,
293 [EnumMember]
294 PAIR = 0x0002,
298 [EnumMember]
299 RANDOM_AND_PAIR = 0x0003,
303 [EnumMember]
304 BOOST = 0x0004,
308 [EnumMember]
309 RANDOM_AND_BOOST = 0x0005,
313 [EnumMember]
318 [EnumMember]
319 FIXEDINDEX = 0x0008,
323 [EnumMember]
324 CLEARFIXEDINDEX = 0x0010
325 }
326
330 [Serializable]
331 [DataContract]
333 {
337 [EnumMember]
338 NONE = 0x0000,
342 [EnumMember]
343 RANDOM = 0x0001,
347 [EnumMember]
348 BOOST = 0x0002
349 }
350
355 [Serializable]
356 [DataContract]
357 public enum IMGDB_SORT
358 {
362 [EnumMember]
363 NONE = 0x0000,
367 [EnumMember]
368 BYDESC = 0x0001,
372 [EnumMember]
373 BYTIME = 0x0002,
377 [EnumMember]
378 BYID = 0x0004,
382 [EnumMember]
383 BYID_DESC = 0x0008,
387 [EnumMember]
388 BYIDX = 0x0010
389 }
390
394 [Serializable]
395 [DataContract]
396 public enum DB_VERSION
397 {
401 [EnumMember]
402 NONE,
406 [EnumMember]
407 IMG_V1,
411 [EnumMember]
412 IMG_V2,
416 [EnumMember]
417 TEMPORAL,
421 [EnumMember]
423 }
424
425#pragma warning disable 1591
426
427 [ServiceContract]
428 public interface IXDatabaseEvent
429 {
430 [OperationContract(IsOneWay = false)]
431 void OnResult(string strMsg, double dfProgress);
432
433 [OperationContract(IsOneWay = false)]
434 void OnError(DatabaseErrorData err);
435 }
436
437#pragma warning restore 1591
438
442 [ServiceContract(CallbackContract = typeof(IXDatabaseEvent), SessionMode = SessionMode.Required)]
443 public interface IXDatabaseBase
444 {
445 #region Initialization and Cleanup
446
451 [OperationContract(IsOneWay = false)]
453
462 [OperationContract(IsOneWay = false)]
463 bool InitializeWithDsName1(SettingsCaffe s, string strDs, string strEvtCancel = null, PropertySet prop = null);
464
473 [OperationContract(IsOneWay = false)]
474 bool InitializeWithDs1(SettingsCaffe s, DatasetDescriptor ds, string strEvtCancel = null, PropertySet prop = null);
475
486 [OperationContract(IsOneWay = false)]
487 bool InitializeWithDsId1(SettingsCaffe s, int nDataSetID, string strEvtCancel = null, int nPadW = 0, int nPadH = 0, PropertySet prop = null);
488
499 [OperationContract(IsOneWay = false)]
500 bool LoadDatasetByID1(int nDsId, string strEvtCancel = null);
501
512 [OperationContract(IsOneWay = false)]
513 bool LoadDatasetByName1(string strDs, string strEvtCancel = null);
514
520 [OperationContract(IsOneWay = false)]
521 void CleanUp(int nDsId = 0, bool bForce = false);
522
523 #endregion // Initialization and Cleanup
524
525 #region Properties
530 [OperationContract(IsOneWay = false)]
532
536 [OperationContract(IsOneWay = false)]
538
542 [OperationContract(IsOneWay = false)]
544
552 [OperationContract(IsOneWay = false)]
553 double GetDatasetLoadedPercentByName(string strDataset, out double dfTraining, out double dfTesting);
554
562 [OperationContract(IsOneWay = false)]
563 double GetDatasetLoadedPercentById(int nDatasetID, out double dfTraining, out double dfTesting);
564
575 [OperationContract(IsOneWay = false)]
576 int GetItemCount(int nSrcId, string strFilterVal = null, int? nBoostVal = null, bool bBoostValIsExact = false);
577
582 [OperationContract(IsOneWay = false)]
583 Tuple<DB_LABEL_SELECTION_METHOD, DB_ITEM_SELECTION_METHOD> GetSelectionMethod();
584
590 [OperationContract(IsOneWay = false)]
592 #endregion
593
594 #region Sources
600 [OperationContract(IsOneWay = false)]
602
608 [OperationContract(IsOneWay = false)]
610
616 [OperationContract(IsOneWay = false)]
617 string GetSourceName(int nSrcId);
618
624 [OperationContract(IsOneWay = false)]
625 int GetSourceID(string strSrc);
626 #endregion
627
628 #region Datasets
634 [OperationContract(IsOneWay = false)]
636
642 [OperationContract(IsOneWay = false)]
644
650 [OperationContract(IsOneWay = false)]
651 string GetDatasetName(int nDsId);
652
658 [OperationContract(IsOneWay = false)]
659 int GetDatasetID(string strDs);
660
666 [OperationContract(IsOneWay = false)]
667 bool ReloadDataset(int nDsId);
668
674 [OperationContract(IsOneWay = false)]
675 bool UnloadDatasetByName(string strDataset);
676
683 [OperationContract(IsOneWay = false)]
684 bool UnloadDatasetById(int nDatasetID);
685 #endregion
686
687 #region Image Acquisition
688
700 [OperationContract(IsOneWay = false)]
701 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);
702
716 [OperationContract(IsOneWay = false)]
717 List<SimpleDatum> GetItemsFromIndex(int nSrcId, int nStartIdx, int nQueryCount = int.MaxValue, string strFilterVal = null, int? nBoostVal = null, bool bBoostValIsExact = false, bool bAttemptDirectLoad = false);
718
731 [OperationContract(IsOneWay = false)]
732 List<SimpleDatum> GetItemsFromTime(int nSrcId, DateTime dtStart, int nQueryCount = int.MaxValue, string strFilterVal = null, int? nBoostVal = null, bool bBoostValIsExact = false);
733
745 [OperationContract(IsOneWay = false)]
746 List<SimpleDatum> GetItems(int nSrcId, int[] rgIdx, string strFilterVal = null, int? nBoostVal = null, bool bBoostValIsExact = false);
747
755 [OperationContract(IsOneWay = false)]
756 SimpleDatum GetItem(int nItemID, params int[] rgSrcId);
757
769 [OperationContract(IsOneWay = false)]
770 int FindItemIndex(int nSrcId, DateTime dt, string strDescription);
771
772 #endregion
773
774 #region Item Mean
775
782 [OperationContract(IsOneWay = false)]
783 [FaultContract(typeof(DatabaseErrorData))]
785
796 [OperationContract(IsOneWay = false)]
797 [FaultContract(typeof(DatabaseErrorData))]
799
806 [OperationContract(IsOneWay = false)]
807 [FaultContract(typeof(DatabaseErrorData))]
809
816 [OperationContract(IsOneWay = false)]
818
819 #endregion // Image Mean
820 }
821
825 [ServiceContract(CallbackContract = typeof(IXDatabaseEvent), SessionMode = SessionMode.Required)]
827 {
833 [OperationContract(IsOneWay = false)]
835
844 [OperationContract(IsOneWay = false)]
845 int GetTotalSize(int nDsId, Phase phase, int nHistoricalSteps, int nFutureSteps);
846
860 [OperationContract(IsOneWay = false)]
861 SimpleTemporalDatumCollection QueryTemporalItem(int nQueryIdx, int nSrcId, ref int? nItemIdx, ref int? nValueIdx, DB_LABEL_SELECTION_METHOD? itemSelectionOverride = null, DB_ITEM_SELECTION_METHOD? valueSelectionOverride = null, bool bEnableDebug = false, string strDebugPath = null);
862
869 [OperationContract(IsOneWay = false)]
870 void Reset();
871 }
872
876 [ServiceContract(CallbackContract = typeof(IXDatabaseEvent), SessionMode = SessionMode.Required)]
878 {
879 #region Properties
880
886 [OperationContract(IsOneWay = false)]
888
894 [OperationContract(IsOneWay = false)]
896
902 [OperationContract(IsOneWay = false)]
904
905 #endregion // Properties
906
907 #region Datasets
908
914 [OperationContract(IsOneWay = false)]
915 bool ReloadImageSet(int nSrcId);
916
917 #endregion // Datasets
918
919 #region Labels
920
926 [OperationContract(IsOneWay = false)]
927 List<LabelDescriptor> GetLabels(int nSrcId);
928
935 [OperationContract(IsOneWay = false)]
936 string GetLabelName(int nSrcId, int nLabel);
937
943 [OperationContract(IsOneWay = false)]
944 void SetLabelMapping(int nSrcId, LabelMapping map);
945
952 [OperationContract(IsOneWay = false)]
953 void UpdateLabelMapping(int nSrcId, int nNewLabel, List<int> rgOriginalLabels);
954
960 [OperationContract(IsOneWay = false)]
961 void ResetLabels(int nProjectId, int nSrcId);
962
968 [OperationContract(IsOneWay = false)]
969 void UpdateLabelCounts(int nProjectId, int nSrcId);
970
976 [OperationContract(IsOneWay = false)]
977 [FaultContract(typeof(DatabaseErrorData))]
978 Dictionary<int, int> LoadLabelCounts(int nSrcId);
979
985 [OperationContract(IsOneWay = false)]
987
993 [OperationContract(IsOneWay = false)]
994 string GetLabelCountsAsTextFromSourceName(string strSource);
995
996 #endregion // Labels
997 }
998
1002 [ServiceContract(CallbackContract = typeof(IXDatabaseEvent), SessionMode = SessionMode.Required)]
1004 {
1010 [OperationContract(IsOneWay = false)]
1011 void UpdateLabelBoosts(int nProjectId, int nSrcId);
1012
1017 [OperationContract(IsOneWay = false)]
1018 void ResetQuery(int nDsID);
1019
1026 [OperationContract(IsOneWay = false)]
1027 bool Sort(int nSrcId, IMGDB_SORT method);
1028
1034 [OperationContract(IsOneWay = false)]
1036
1042 [OperationContract(IsOneWay = false)]
1043 bool DeleteCreatedDataset(int nDsId);
1044
1048 [OperationContract(IsOneWay = false)]
1050
1056 [OperationContract(IsOneWay = false)]
1057 void DeleteLabelBoosts(int nProjectId, int nSrcId);
1058
1066 [OperationContract(IsOneWay = false)]
1067 void AddLabelBoost(int nProjectId, int nSrcId, int nLabel, double dfBoost);
1068
1075 [OperationContract(IsOneWay = false)]
1076 string GetLabelBoostsAsTextFromProject(int nProjectId, int nSrcId);
1077
1083 [OperationContract(IsOneWay = false)]
1084 bool LoadNextSet(string strEvtCancel);
1085 }
1086
1090 [ServiceContract(CallbackContract = typeof(IXDatabaseEvent), SessionMode = SessionMode.Required)]
1092 {
1093 #region Initialization and Cleanup
1094
1102 [OperationContract(IsOneWay = false)]
1103 long InitializeWithDsName(SettingsCaffe s, string strDs, string strEvtCancel = null);
1104
1112 [OperationContract(IsOneWay = false)]
1113 long InitializeWithDs(SettingsCaffe s, DatasetDescriptor ds, string strEvtCancel = null);
1114
1124 [OperationContract(IsOneWay = false)]
1125 long InitializeWithDsId(SettingsCaffe s, int nDataSetID, string strEvtCancel = null, int nPadW = 0, int nPadH = 0);
1126
1137 [OperationContract(IsOneWay = false)]
1138 long LoadDatasetByID(int nDsId, string strEvtCancel = null);
1139
1150 [OperationContract(IsOneWay = false)]
1151 long LoadDatasetByName(string strDs, string strEvtCancel = null);
1152
1158 [OperationContract(IsOneWay = false)]
1159 bool ReloadIndexing(int nDsId);
1160
1166 [OperationContract(IsOneWay = false)]
1167 bool ReloadIndexing(string strDs);
1168
1177 bool WaitForDatasetToLoad(int nDsId, bool bTraining, bool bTesting, int nWait = int.MaxValue);
1178
1187 bool WaitForDatasetToLoad(string strDs, bool bTraining, bool bTesting, int nWait = int.MaxValue);
1188
1189 #endregion // Initialization and Cleanup
1190
1191 #region Query States
1192
1201 [OperationContract(IsOneWay = false)]
1202 long CreateQueryState(int nDsId, bool bUseUniqueLabelIndexes = true, bool bUseUniqueImageIndexes = true, IMGDB_SORT sort = IMGDB_SORT.NONE);
1203
1212 [OperationContract(IsOneWay = false)]
1213 long CreateQueryState(string strDs, bool bUseUniqueLabelIndexes = true, bool bUseUniqueImageIndexes = true, IMGDB_SORT sort = IMGDB_SORT.NONE);
1214
1221 [OperationContract(IsOneWay = false)]
1222 bool SetDefaultQueryState(int nDsId, long lQueryState);
1223
1230 [OperationContract(IsOneWay = false)]
1231 bool SetDefaultQueryState(string strDs, long lQueryState);
1232
1239 [OperationContract(IsOneWay = false)]
1240 bool FreeQueryState(int nDsId, long lHandle);
1241
1248 [OperationContract(IsOneWay = false)]
1249 bool FreeQueryState(string strDs, long lHandle);
1250
1257 [OperationContract(IsOneWay = false)]
1258 string GetLabelQueryHitPercentsAsTextFromSourceName(long lQueryState, string strSource);
1259
1266 [OperationContract(IsOneWay = false)]
1267 string GetLabelQueryEpocsAsTextFromSourceName(long lQueryState, string strSource);
1268
1275 [OperationContract(IsOneWay = false)]
1276 string GetBoostQueryHitPercentsAsTextFromSourceName(long lQueryState, string strSource);
1277
1278 #endregion // Query States
1279
1280 #region Properties
1281
1293 [OperationContract(IsOneWay = false)]
1294 int GetImageCount(long lQueryState, int nSrcId, string strFilterVal = null, int? nBoostVal = null, bool bBoostValIsExact = false);
1295
1296 #endregion // Properties
1297
1298 #region Image Acquisition
1299
1314 [OperationContract(IsOneWay = false)]
1315 List<SimpleDatum> GetImagesFromIndex(long lQueryState, int nSrcId, int nStartIdx, int nQueryCount = int.MaxValue, string strFilterVal = null, int? nBoostVal = null, bool bBoostValIsExact = false, bool bAttemptDirectLoad = false);
1316
1330 [OperationContract(IsOneWay = false)]
1331 List<SimpleDatum> GetImagesFromTime(long lQueryState, int nSrcId, DateTime dtStart, int nQueryCount = int.MaxValue, string strFilterVal = null, int? nBoostVal = null, bool bBoostValIsExact = false);
1332
1345 [OperationContract(IsOneWay = false)]
1346 SimpleDatum QueryImage(long lQueryState, 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);
1347
1348 #endregion // Image Acquisition
1349
1350 #region Boosts
1351
1359 [OperationContract(IsOneWay = false)]
1360 void ResetAllBoosts(int nSrcId);
1361
1362 #endregion // Boosts
1363
1364 #region Load Limit Refresh
1365
1374 bool WaitForDatasetToRefresh(int nDsId, bool bTraining, bool bTesting, int nWait = int.MaxValue);
1375
1384 bool WaitForDatasetToRefresh(string strDs, bool bTraining, bool bTesting, int nWait = int.MaxValue);
1385
1393 bool IsRefreshRunning(int nDsId, bool bTraining, bool bTesting);
1394
1402 bool IsRefreshRunning(string strDs, bool bTraining, bool bTesting);
1403
1415 bool StartRefresh(string strDs, bool bTraining, bool bTesting, double dfReplacementPct);
1416
1427 bool StopRefresh(string strDs, bool bTraining, bool bTesting);
1428
1440 bool StartRefresh(int nDsID, bool bTraining, bool bTesting, double dfReplacementPct);
1441
1452 bool StopRefresh(int nDsID, bool bTraining, bool bTesting);
1453
1463 bool StartAutomaticRefreshSchedule(string strDs, bool bTraining, bool bTesting, int nPeriodInMs, double dfReplacementPct);
1464
1472 bool StopAutomaticRefreshSchedule(string strDs, bool bTraining, bool bTesting);
1473
1483 bool GetScheduledAutoRefreshInformation(string strDs, out int nPeriodInMs, out double dfReplacementPct, out int nTrainingRefreshCount, out int nTestingRefreshCount);
1484
1494 bool StartAutomaticRefreshSchedule(int nDsID, bool bTraining, bool bTesting, int nPeriodInMs, double dfReplacementPct);
1495
1503 bool StopAutomaticRefreshSchedule(int nDsID, bool bTraining, bool bTesting);
1504
1514 bool GetScheduledAutoRefreshInformation(int nDsID, out int nPeriodInMs, out double dfReplacementPct, out int nTrainingRefreshCount, out int nTestingRefreshCount);
1515
1516 #endregion
1517
1518 #region Results
1519
1527 List<SimpleResult> GetAllResults(string strSource, bool bRequireExtraData, int nMax = -1);
1528
1529 #endregion
1530 }
1531
1532#pragma warning disable 1591
1533
1534 [DataContract]
1535 public class DatabaseErrorData
1536 {
1537 [DataMember]
1538 public bool Result { get; set; }
1539 [DataMember]
1540 public string ErrorMessage { get; set; }
1541 [DataMember]
1542 public string ErrorDetails { get; set; }
1543 }
1544
1545#pragma warning restore 1591
1546}
The ConnectInfo class specifies the server, database and username/password used to connect to a datab...
Definition: ConnectInfo.cs:14
The LabelMapping class represents a single label mapping.
Specifies a key-value pair of properties.
Definition: PropertySet.cs:16
The Result class contains a single result.
Definition: Result.cs:14
The SettingsCaffe defines the settings used by the MyCaffe CaffeControl.
The SimpleDatum class holds a data input within host memory.
Definition: SimpleDatum.cs:161
The SimpleTemporalDatumCollection manages a collection of SimpleTemporalDatum objects.
Definition: SimpleDatum.cs:91
The DatasetDescriptor class describes a dataset which contains both a training data source and testin...
The SourceDescriptor class contains all information describing a data source.
Defines the ITest interface used by the Test module to return its known failures.
Definition: Interfaces.cs:253
List< Tuple< string, string, string > > KnownFailures
Get the known failures of the test module.
Definition: Interfaces.cs:257
int GetPriority(string strClass, string strMethod)
Get the priority of a class::method pair.
The IXDatabaseBase interface defines the general interface to the in-memory database.
Definition: Interfaces.cs:444
bool InitializeWithDs1(SettingsCaffe s, DatasetDescriptor ds, string strEvtCancel=null, PropertySet prop=null)
Initializes the image database.
SimpleDatum QueryItemMeanFromDb(int nSrcId)
Queries the item (e.g., image or temporal item) mean for a data source from the database on disk.
bool UnloadDatasetByName(string strDataset)
The UnloadDataset function unloads a given dataset from memory.
SimpleDatum GetItem(int nItemID, params int[] rgSrcId)
Get the item (e.g., image or temporal item) with a given Raw Item ID.
void SetConnection(ConnectInfo ci)
Set the database connection to use.
SimpleDatum GetItemMean(int nSrcId)
Returns the item (e.g., image or temporal item) mean for a data source.
bool GetLoadItemDebugData()
Returns whether or not the item debug data is loaded with each item.
int GetSourceID(string strSrc)
Returns a data source ID given its name.
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.
bool LoadDatasetByName1(string strDs, string strEvtCancel=null)
Load another, 'secondary' dataset.
double GetDatasetLoadedPercentById(int nDatasetID, out double dfTraining, out double dfTesting)
Returns the percentage that a dataset is loaded into memory.
Tuple< DB_LABEL_SELECTION_METHOD, DB_ITEM_SELECTION_METHOD > GetSelectionMethod()
Returns the label and image selection method used.
bool InitializeWithDsName1(SettingsCaffe s, string strDs, string strEvtCancel=null, PropertySet prop=null)
Initializes the image database.
SimpleDatum QueryItemMean(int nSrcId)
Queries the item (e.g., image or temporal item) mean for a data source from the database on disk.
string GetSourceName(int nSrcId)
Returns a data source name given its ID.
double GetDatasetLoadedPercentByName(string strDataset, out double dfTraining, out double dfTesting)
Returns the percentage that a dataset is loaded into memory.
void SetSelectionMethod(DB_LABEL_SELECTION_METHOD? lbl, DB_ITEM_SELECTION_METHOD? img)
Sets the label and image selection methods.
void CleanUp(int nDsId=0, bool bForce=false)
Releases the image database, and if this is the last instance using the in-memory database,...
SimpleDatum QueryItemMeanFromDataset(int nDatasetId)
Returns the item (e.g., image or temporal item) mean for the Training data source of a given data set...
int GetDatasetID(string strDs)
Returns a data set ID given its name.
SourceDescriptor GetSourceByName(string strSrc)
Returns the SourceDescriptor for a given data source name.
DatasetDescriptor GetDatasetById(int nDsId)
Returns the DatasetDescriptor for a given data set ID.
int FindItemIndex(int nSrcId, DateTime dt, string strDescription)
Searches for the item (e.g., image or temporal item) index of an image within a data source matching ...
SourceDescriptor GetSourceById(int nSrcId)
Returns the SourceDescriptor for a given data source ID.
string GetDatasetName(int nDsId)
Returns a data set name given its ID.
DB_VERSION GetVersion()
Returns the version of the MyCaffe Image Database being used.
DatasetDescriptor GetDatasetByName(string strDs)
Returns the DatasetDescriptor for a given data set name.
List< SimpleDatum > GetItems(int nSrcId, int[] rgIdx, string strFilterVal=null, int? nBoostVal=null, bool bBoostValIsExact=false)
Returns the array of items (e.g., images or temporal items) in the item set, possibly filtered with t...
bool InitializeWithDsId1(SettingsCaffe s, int nDataSetID, string strEvtCancel=null, int nPadW=0, int nPadH=0, PropertySet prop=null)
Initializes the image database.
bool UnloadDatasetById(int nDatasetID)
The UnloadDataset function unloads a given dataset from memory.
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 items (e.g., images or temporal items) in the item set, possibly filtered with t...
int GetItemCount(int nSrcId, string strFilterVal=null, int? nBoostVal=null, bool bBoostValIsExact=false)
Returns the number of items (e.g., images, or temporal items) in a given data source.
bool GetLoadItemDataCriteria()
Returns whether or not the item data criteria is loaded with each item.
bool ReloadDataset(int nDsId)
Reload a data set.
bool LoadDatasetByID1(int nDsId, string strEvtCancel=null)
Load another, 'secondary' dataset.
List< SimpleDatum > GetItemsFromTime(int nSrcId, DateTime dtStart, int nQueryCount=int.MaxValue, string strFilterVal=null, int? nBoostVal=null, bool bBoostValIsExact=false)
Returns the array of items (e.g., images or temporal items) in the item set, possibly filtered with t...
The IXImageDatabase interface defines the eneral interface to the in-memory image database.
Definition: Interfaces.cs:1004
void DeleteAllCreatedDatasets()
Delete all datasets created with CreateDatasetOrganizedByTime.
string GetLabelBoostsAsTextFromProject(int nProjectId, int nSrcId)
Returns the label boosts as a text string for all boosted labels within a data source associated with...
int CreateDatasetOranizedByTime(int nDsId)
Create a dynamic dataset organized by time from a pre-existing dataset.
bool LoadNextSet(string strEvtCancel)
When using a Load Limit that is greater than 0, this function loads the next set of images.
bool DeleteCreatedDataset(int nDsId)
Delete a dataset created with CreateDatasetOrganizedByTime.
void AddLabelBoost(int nProjectId, int nSrcId, int nLabel, double dfBoost)
Add a label boost for a data source associated with a given project.
bool Sort(int nSrcId, IMGDB_SORT method)
Sort the internal images.
void DeleteLabelBoosts(int nProjectId, int nSrcId)
Delete all label boosts for a given data source associated with a given project.
void UpdateLabelBoosts(int nProjectId, int nSrcId)
Updates the label boosts for the images based on the label boosts set for the given project.
void ResetQuery(int nDsID)
Reset the query for the given data set ID.
The IXImageDatabase2 interface defines the general interface to the in-memory image database (v2).
Definition: Interfaces.cs:1092
bool ReloadIndexing(string strDs)
Reload the indexing for a data set.
string GetLabelQueryEpocsAsTextFromSourceName(long lQueryState, string strSource)
Returns a string with the query epoch counts for each label (e.g. the number of times all images with...
List< SimpleResult > GetAllResults(string strSource, bool bRequireExtraData, int nMax=-1)
Query all results for a given data source.
bool GetScheduledAutoRefreshInformation(string strDs, out int nPeriodInMs, out double dfReplacementPct, out int nTrainingRefreshCount, out int nTestingRefreshCount)
Returns whether or not a scheduled refresh is running and if so at what period and replacement percen...
long CreateQueryState(int nDsId, bool bUseUniqueLabelIndexes=true, bool bUseUniqueImageIndexes=true, IMGDB_SORT sort=IMGDB_SORT.NONE)
Create a new query state, optionally with a certain ordering.
bool StartRefresh(string strDs, bool bTraining, bool bTesting, double dfReplacementPct)
Start a refresh on the dataset by replacing a specified percentage of the images with images from the...
long CreateQueryState(string strDs, bool bUseUniqueLabelIndexes=true, bool bUseUniqueImageIndexes=true, IMGDB_SORT sort=IMGDB_SORT.NONE)
Create a new query state, optionally with a certain ordering.
bool StopRefresh(int nDsID, bool bTraining, bool bTesting)
Stop a refresh operation running on the dataset.
bool FreeQueryState(string strDs, long lHandle)
Frees a query state from a given dataset.
bool StopAutomaticRefreshSchedule(string strDs, bool bTraining, bool bTesting)
Stop the automatic refresh schedule running on a dataset.
SimpleDatum QueryImage(long lQueryState, 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.
long InitializeWithDsId(SettingsCaffe s, int nDataSetID, string strEvtCancel=null, int nPadW=0, int nPadH=0)
Initializes the image database.
string GetBoostQueryHitPercentsAsTextFromSourceName(long lQueryState, string strSource)
Returns a string with the query hit percent for each boost (e.g. the percentage that each boost value...
bool ReloadIndexing(int nDsId)
Reload the indexing for a data set.
bool WaitForDatasetToRefresh(string strDs, bool bTraining, bool bTesting, int nWait=int.MaxValue)
Wait for the dataset refreshing to complete.
bool GetScheduledAutoRefreshInformation(int nDsID, out int nPeriodInMs, out double dfReplacementPct, out int nTrainingRefreshCount, out int nTestingRefreshCount)
Returns whether or not a scheduled refresh is running and if so at what period and replacement percen...
long LoadDatasetByName(string strDs, string strEvtCancel=null)
Load another, 'secondary' dataset.
bool StartAutomaticRefreshSchedule(string strDs, bool bTraining, bool bTesting, int nPeriodInMs, double dfReplacementPct)
Start the automatic refresh cycle to occur on specified period increments.
bool StopAutomaticRefreshSchedule(int nDsID, bool bTraining, bool bTesting)
Stop the automatic refresh schedule running on a dataset.
bool SetDefaultQueryState(string strDs, long lQueryState)
Set the default query state to the query state specified for the dataset specified.
int GetImageCount(long lQueryState, int nSrcId, string strFilterVal=null, int? nBoostVal=null, bool bBoostValIsExact=false)
Returns the number of images in a given data source.
bool FreeQueryState(int nDsId, long lHandle)
Frees a query state from a given dataset.
void ResetAllBoosts(int nSrcId)
Reset all in-memory image boosts.
long InitializeWithDs(SettingsCaffe s, DatasetDescriptor ds, string strEvtCancel=null)
Initializes the image database.
bool WaitForDatasetToLoad(string strDs, bool bTraining, bool bTesting, int nWait=int.MaxValue)
Wait for the dataset loading to complete.
bool WaitForDatasetToLoad(int nDsId, bool bTraining, bool bTesting, int nWait=int.MaxValue)
Wait for the dataset loading to complete.
bool StopRefresh(string strDs, bool bTraining, bool bTesting)
Stop a refresh operation running on the dataset.
bool IsRefreshRunning(int nDsId, bool bTraining, bool bTesting)
Returns true if the refresh operation running.
bool StartRefresh(int nDsID, bool bTraining, bool bTesting, double dfReplacementPct)
Start a refresh on the dataset by replacing a specified percentage of the images with images from the...
List< SimpleDatum > GetImagesFromIndex(long lQueryState, 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.
bool WaitForDatasetToRefresh(int nDsId, bool bTraining, bool bTesting, int nWait=int.MaxValue)
Wait for the dataset refreshing to complete.
bool IsRefreshRunning(string strDs, bool bTraining, bool bTesting)
Returns true if the refresh operation running.
long LoadDatasetByID(int nDsId, string strEvtCancel=null)
Load another, 'secondary' dataset.
string GetLabelQueryHitPercentsAsTextFromSourceName(long lQueryState, string strSource)
Returns a string with the query hit percent for each label (e.g. the percentage that each label has b...
long InitializeWithDsName(SettingsCaffe s, string strDs, string strEvtCancel=null)
Initializes the image database.
bool SetDefaultQueryState(int nDsId, long lQueryState)
Set the default query state to the query state specified for the dataset specified.
List< SimpleDatum > GetImagesFromTime(long lQueryState, 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.
bool StartAutomaticRefreshSchedule(int nDsID, bool bTraining, bool bTesting, int nPeriodInMs, double dfReplacementPct)
Start the automatic refresh cycle to occur on specified period increments.
The IXImageDatabaseBase interface defines the general interface to the in-memory image database.
Definition: Interfaces.cs:878
List< LabelDescriptor > GetLabels(int nSrcId)
Returns a list of LabelDescriptors associated with the labels within a data source.
void SetLabelMapping(int nSrcId, LabelMapping map)
Sets the label mapping to the database for a given data source.
string GetLabelCountsAsTextFromSourceId(int nSrcId)
Returns a string with all label counts for a data source.
string GetLabelQueryHitPercentsAsTextFromSourceName(string strSource)
Returns a string with the query hit percent for each label (e.g. the percentage that each label has b...
Dictionary< int, int > LoadLabelCounts(int nSrcId)
Returns a label lookup of counts for a given data source.
void UpdateLabelMapping(int nSrcId, int nNewLabel, List< int > rgOriginalLabels)
Updates the label mapping in the database for a given data source.
string GetLabelQueryEpocsAsTextFromSourceName(string strSource)
Returns a string with the query epoch counts for each label (e.g. the number of times all images with...
bool ReloadImageSet(int nSrcId)
Reloads the images of a data source.
string GetLabelCountsAsTextFromSourceName(string strSource)
Returns a string with all label counts for a data source.
string GetBoostQueryHitPercentsAsTextFromSourceName(string strSource)
Returns a string with the query hit percent for each boost (e.g. the percentage that each boost value...
void ResetLabels(int nProjectId, int nSrcId)
Resets all labels within a data source, used by a project, to their original labels.
void UpdateLabelCounts(int nProjectId, int nSrcId)
Updates the number of images of each label within a data source.
string GetLabelName(int nSrcId, int nLabel)
Returns the text name of a given label within a data source.
Teh IXTemporalDatabaseBase interface defines the general interface to the in-memory temporal database...
Definition: Interfaces.cs:827
void SetInitializationProperties(PropertySet prop)
The SetInitializationProperties method is used to set the initialization properties of the database.
int GetTotalSize(int nDsId, Phase phase, int nHistoricalSteps, int nFutureSteps)
Returns the total number of blocks in the database where one block is a set of (historical and future...
SimpleTemporalDatumCollection QueryTemporalItem(int nQueryIdx, int nSrcId, ref int? nItemIdx, ref int? nValueIdx, DB_LABEL_SELECTION_METHOD? itemSelectionOverride=null, DB_ITEM_SELECTION_METHOD? valueSelectionOverride=null, bool bEnableDebug=false, string strDebugPath=null)
Returns a block of static, observed and known data from the database where one block is a set of (his...
void Reset()
Reset the database indexes.
The descriptors namespace contains all descriptor used to describe various items stored within the da...
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
Definition: Annotation.cs:12
DB_ITEM_SELECTION_METHOD
Defines the item (e.g., image or temporal item) selection method.
Definition: Interfaces.cs:278
@ RANDOM
Randomly select the images, ignore the input index.
@ RANDOM_AND_PAIR
Combines RANDOM + PAIR for marshalling.
@ FIXEDINDEX
Specifically select based on the input index.
@ PAIR
Pair select the images where the first query returns a randomly selected image, and the next query re...
@ RANDOM_AND_PAIR_AND_BOOST
Combines RANDOM + PAIR + BOOST for marshalling.
@ BOOST
Randomly select, but given higher priority to boosted images using the super-boost setting.
@ CLEARFIXEDINDEX
Clear the fixed index.
@ RANDOM_AND_BOOST
Combines RANDOM + BOOST for marshalling.
DB_LOAD_METHOD
Defines how to laod the items into the in-memory database.
Definition: Interfaces.cs:154
@ LOAD_ON_DEMAND_BACKGROUND
Load the image as they are queried AND start the background loading at the same time.
@ LOAD_ON_DEMAND
Load the items as they are queried - this option cahces items into memory as needed,...
@ LOAD_EXTERNAL
Load the items from an external source such as a Windows Service - this option provides the best bala...
@ LOAD_ON_DEMAND_NOCACHE
Load the items on demand, but do not cache the items - this option loads items from disk as needed an...
@ LOAD_ALL
Load all of the items into memory - this option provides the highest training speeds,...
Phase
Defines the Phase under which to run a Net.
Definition: Interfaces.cs:61
@ TEST
Run a testing phase.
@ ALL
Applies to all phases.
@ RUN
Run on an image given to the Net.
@ TRAIN
Run a training phase.
DB_VERSION
Defines the image database version to use.
Definition: Interfaces.cs:397
@ TEMPORAL
Specifies to use the tempoal database.
@ IMG_V2
Specifies to use the new image database v2.
@ IMG_V1
Specifies to use the original image database.
SPECIAL_TOKENS
Specifies the special tokens.
Definition: Interfaces.cs:15
@ PAD
The PAD token is used to pad the input to the same length.
@ EOS
The EOS token indicates the end of sequence.
@ BOS
The BOS token indicates the begin of sequence. /summary>
SNAPSHOT_LOAD_METHOD
Defines the snapshot load method.
Definition: Interfaces.cs:204
@ STATE_BEST_ACCURACY
Load the state with the best accuracy (which may not be the last).
@ LAST_STATE
Load the last solver state snapshotted.
@ STATE_BEST_ERROR
Load the state with the best error (which may not be the last).
@ WEIGHTS_BEST_ERROR
Load the weights with the best error (which may not be the last).
@ WEIGHTS_BEST_ACCURACY
Load the weights with the best accuracy (which may not be the last).
IMGDB_SORT
Defines the sorting method.
Definition: Interfaces.cs:358
@ BYIDX
Sort by image Index.
@ BYDESC
Sort by description first.
@ BYID
Sort by image ID.
@ BYID_DESC
Sort by image ID in decending order.
DB_LABEL_SELECTION_METHOD
Defines the label selection method.
Definition: Interfaces.cs:333
GYM_TYPE
Defines the gym type (if any).
Definition: Interfaces.cs:116
@ DYNAMIC
Specifies a dynamic gym type that dynamically produces its data.
@ DATA
Specifies a data gym that collects data from a data source, such as a database.
SNAPSHOT_WEIGHT_UPDATE_METHOD
Defines the snapshot weight update method.
Definition: Interfaces.cs:181
@ FAVOR_ACCURACY
Update the snapshot weights when the accuracy increases.
@ FAVOR_ERROR
Update the snapshot weights when the error decreases.
@ FAVOR_BOTH
Update the snapshot weights when the accuracy increases or the error decreases.
TRAINING_CATEGORY
Defines the category of training.
Definition: Interfaces.cs:34
@ CUSTOM
Defines a purely custom training method.
@ RECURRENT
Defines the recurrent training method.
@ REINFORCEMENT
Defines the reinforcement training method such as PG.
@ NONE
No training category specified.
@ DUAL
Defines the reinforcement training method such as PG that also uses a recurrent model such as LSTM.
ApVersion
Defines the different way of computing average precision.
Definition: Interfaces.cs:234
@ ELEVENPOINT
Specifies the 11-point interpolated average precision, used in VOC2007.
@ MAXINTEGRAL
Specifies the maximally interpolated AP, used in VOC2012/ILSVRC.
@ INTEGRAL
Specifies the natural integral of the precision-recall curve.
DATA_TYPE
Defines the gym data type.
Definition: Interfaces.cs:135
@ BLOB
Specifies to use a SimpleDatum blob of data of the gym (if supported).
@ DEFAULT
Specifies to use the default data type of the gym used.
@ VALUES
Specifies to use the raw state values of the gym (if supported).
Stage
Specifies the stage underwhich to run a custom trainer.
Definition: Interfaces.cs:88
@ RNN
Run the trainer in RNN mode.
@ RL
Run the trainer in RL mode.
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...
Definition: Annotation.cs:12