MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
AnnotatedDataLayer.cs
1using System;
2using System.Collections.Generic;
3using System.Diagnostics;
4using System.Linq;
5using System.Text;
6using System.Threading.Tasks;
7using MyCaffe.basecode;
8using MyCaffe.common;
9using MyCaffe.data;
10using MyCaffe.db.image;
11using MyCaffe.param;
12using MyCaffe.param.ssd;
13
14namespace MyCaffe.layers.ssd
15{
26 {
30 protected DB<T> m_db;
35 UInt64 m_nOffset = 0;
43 List<BatchSampler> m_rgBatchSamplers = new List<BatchSampler>();
47 string m_strLabelMapFile;
51 protected Stopwatch m_swTimerBatch;
55 protected Stopwatch m_swTimerTransaction;
59 protected double m_dfReadTime;
63 protected double m_dfTransTime;
64 private T[] m_rgTopData = null;
65 private T[] m_rgTopLabel = null;
66 SsdSampler<T> m_sampler = null;
67 CryptoRandom m_random = null;
68 T m_tMinusOne;
69
79 : base(cuda, log, p, db, evtCancel)
80 {
81 if (db.GetVersion() != DB_VERSION.IMG_V1 && db.GetVersion() != DB_VERSION.IMG_V2)
82 m_log.FAIL("Currently, the AnnotatedDataLayer requires the MyCaffe Image Database!");
83
84 m_type = LayerParameter.LayerType.ANNOTATED_DATA;
85 m_random = new CryptoRandom(CryptoRandom.METHOD.DEFAULT, p.transform_param.random_seed.GetValueOrDefault(0));
86 m_tMinusOne = (T)Convert.ChangeType(-1, typeof(T));
87
88 if (db == null)
89 m_log.FAIL("Currently, the AnnotatedDataLayer requires the MyCaffe Image Database!");
90
91 Tuple<DB_LABEL_SELECTION_METHOD, DB_ITEM_SELECTION_METHOD> kvSel = db.GetSelectionMethod();
92 DB_ITEM_SELECTION_METHOD imgSel = kvSel.Item2;
93
95 {
97 imgSel |= DB_ITEM_SELECTION_METHOD.PAIR;
98 else
99 imgSel &= (~DB_ITEM_SELECTION_METHOD.PAIR);
100 }
101
103 {
105 imgSel |= DB_ITEM_SELECTION_METHOD.RANDOM;
106 else
107 imgSel &= (~DB_ITEM_SELECTION_METHOD.RANDOM);
108 }
109
110 if (!((IXImageDatabaseBase)db).GetLoadItemDataCriteria())
111 m_log.WriteError(new Exception("The 'Load Image Data Criteria' must be set to TRUE in order to load the Annotation data."));
112
113 db.SetSelectionMethod(null, imgSel);
114
115 m_db = new data.DB<T>((IXImageDatabaseBase)db);
116 m_db.Open(p.data_param.source);
117
119 {
120 m_swTimerBatch = new Stopwatch();
121 m_swTimerTransaction = new Stopwatch();
122 }
123
124 m_sampler = new SsdSampler<T>(cuda, log);
125 }
126
128 protected override void dispose()
129 {
130 base.dispose();
131
132 if (m_sampler != null)
133 {
134 m_sampler.Dispose();
135 m_sampler = null;
136 }
137 }
138
142 public override int ExactNumBottomBlobs
143 {
144 get { return 0; }
145 }
146
150 public override int MinTopBlobs
151 {
152 get { return 1; }
153 }
154
160 protected override void DataLayerSetUp(BlobCollection<T> colBottom, BlobCollection<T> colTop)
161 {
162 int nBatchSize = (int)m_param.data_param.batch_size;
163
164 m_cursor = m_db.NewCursor(m_transformer);
165
167 {
168 m_rgBatchSamplers.Add(sampler);
169 }
170
171 m_strLabelMapFile = m_param.annotated_data_param.label_map_file;
172
173 // Make sure dimension is consistent within batch.
175 {
177 m_log.CHECK_EQ(nBatchSize, 1, "The FIT_SMALL_SIZE resize mode only supports a batch size of 1.");
178 }
179
180 // Read a data point, and use it to initialize the top blob.
181 SimpleDatum anno_datum = m_cursor.GetValue(null, true);
182
183 // Use data_transformer to infer the expected blob shape from anno_datum.
184 List<int> rgTopShape = m_transformer.InferBlobShape(anno_datum);
185 // Reshape top[0] and prefetch_data according to the batch_size.
186 rgTopShape[0] = nBatchSize;
187 colTop[0].Reshape(rgTopShape);
188
189 for (int i = 0; i < m_rgPrefetch.Length; i++)
190 {
191 m_rgPrefetch[i].Data.Reshape(rgTopShape);
192 }
193
194 m_log.WriteLine("Output data size: " + colTop[0].ToSizeString());
195
196 // Label
197 if (m_bOutputLabels)
198 {
200 List<int> rgLabelShape = Utility.Create<int>(4, 1);
201
202 if (bHasAnnoType)
203 {
204 m_AnnoType = anno_datum.annotation_type;
205
206 // If anno_type is provided in AnnotatedDataParameter, replace the type stored
207 // in each individual AnnotatedDatum.
209 {
210 m_log.WriteLine("WARNING: Annotation type stored in AnnotatedDatum is shadowed.");
212 }
213
214 // Infer the label shape from anno_dataum.AnnotationGroup().
215 int nNumBboxes = 0;
216
217 // Since the number of bboxes can be different for each image,
218 // we store the bbox information in a specific format. In specific:
219 // All bboxes are stored in one spatial plane (num and channels are 1)
220 // and each row contains one and only one box in the following format:
221 // [item_id, group_label, instance_id, xmin, ymin, xmax, ymax, diff]
222 // Note: Refer to caffe.proto for details about group_label and
223 // instance_id.
225 {
226 if (anno_datum.annotation_group != null)
227 {
228 for (int g = 0; g < anno_datum.annotation_group.Count; g++)
229 {
230 nNumBboxes += anno_datum.annotation_group[g].annotations.Count;
231 }
232 }
233
234 rgLabelShape[0] = 1;
235 rgLabelShape[1] = 1;
236 // BasePrefetchingDataLayer.LayerSetup() requires to call
237 // cpu_data and gpu_data for consistent prefetch thread, thus
238 // we must make sure there is at least one bbox.
239 rgLabelShape[2] = Math.Max(nNumBboxes, 1);
240 rgLabelShape[3] = 8;
241 }
242 else
243 {
244 m_log.FAIL("Unknown annotation type.");
245 }
246 }
247 else
248 {
249 rgLabelShape[0] = nBatchSize;
250 }
251
252 colTop[1].Reshape(rgLabelShape);
253
254 for (int i = 0; i < m_rgPrefetch.Length; i++)
255 {
256 m_rgPrefetch[i].Label.Reshape(rgLabelShape);
257 }
258 }
259 }
260
265 protected void Next()
266 {
267 m_cursor.Next();
268
269 if (!m_cursor.IsValid)
270 {
271 m_log.WriteLine("Restarting data prefetching from start.");
272 m_cursor.SeekToFirst();
273 }
274
275 m_nOffset++;
276 }
277
282 protected bool Skip()
283 {
284 UInt64 nSize = (UInt64)m_param.solver_count;
285 UInt64 nRank = (UInt64)m_param.solver_rank;
286 // In test mode, only rank 0 runs, so avoid skipping.
287 bool bKeep = (m_nOffset % nSize) == nRank || m_param.phase == Phase.TEST;
288
289 return !bKeep;
290 }
291
296 protected override void load_batch(Batch<T> batch)
297 {
298 m_log.CHECK(batch.Data.count() > 0, "There is no space allocated for data!");
299
301 {
302 m_swTimerBatch.Restart();
303 m_dfReadTime = 0;
304 m_dfTransTime = 0;
305 }
306
307 if (m_bOutputLabels)
308 {
309 int nCount = batch.Label.count();
310 m_log.CHECK_GT(nCount, 0, "The label count cannot be zero!");
311
312 if (m_rgTopLabel == null || m_rgTopLabel.Length < nCount)
313 m_rgTopLabel = new T[nCount];
314 }
315
316 // Reshape according to the first anno_datum of each batch
317 // ont single input batches allows for inputs of varying dimension.
318 int nBatchSize = (int)m_param.data_param.batch_size;
319 SimpleDatum datum;
320 int nDim = 0;
321 int nNumBboxes = 0;
322 Dictionary<int, AnnotationGroupCollection> rgAllAnno = null;
323 List<int> rgTopShape = null;
324 bool bLabelDirty = false;
325
326 for (int i = 0; i < nBatchSize; i++)
327 {
329 m_swTimerTransaction.Restart();
330
331 while (Skip())
332 {
333 if (m_evtCancel.WaitOne(0))
334 return;
335 Next();
336 }
337
338 datum = m_cursor.GetValue(null, true);
339
341 {
342 m_dfReadTime += m_swTimerTransaction.Elapsed.TotalMilliseconds;
343 m_swTimerTransaction.Restart();
344 }
345
346 if (i == 0)
347 {
348 // Reshape according to the first datum of each batch
349 // on single input batches allows for inputs of varying dimension.
350 // Use data transformer to infer the expected blob shape for datum.
351 rgTopShape = m_transformer.InferBlobShape(datum);
352 rgTopShape[0] = nBatchSize;
353
354 batch.Data.Reshape(rgTopShape);
355
356 nDim = 1;
357 for (int k = 1; k < rgTopShape.Count; k++)
358 {
359 nDim *= rgTopShape[k];
360 }
361
362 int nTopLen = nDim * nBatchSize;
363 if (m_rgTopData == null || m_rgTopData.Length != nTopLen)
364 m_rgTopData = new T[nTopLen];
365 }
366
367 SimpleDatum distort_datum = null;
368 SimpleDatum expand_datum = null;
369
371 {
372 distort_datum = m_transformer.DistortImage(datum);
373
375 expand_datum = m_transformer.ExpandImage(distort_datum);
376 else
377 expand_datum = distort_datum;
378 }
380 {
381 expand_datum = m_transformer.ExpandImage(datum);
382 }
383 else
384 {
385 expand_datum = datum;
386 }
387
388 SimpleDatum sampled_datum = expand_datum;
389
390 // Generate sampled bboxes from expand_datum.
391 if (m_rgBatchSamplers.Count > 0)
392 {
393 List<NormalizedBBox> rgSampledBboxes = m_sampler.GenerateBatchSamples(expand_datum, m_rgBatchSamplers);
394
395 // Randomly pick a sampled bbox and crop the expand_datum.
396 if (rgSampledBboxes.Count > 0)
397 {
398 int nIdx = m_random.Next(rgSampledBboxes.Count);
399 sampled_datum = m_transformer.CropImage(expand_datum, rgSampledBboxes[nIdx]);
400 }
401 }
402
403 m_log.CHECK(sampled_datum != null, "The sampled datum cannot be null!");
404 List<int> rgShape = m_transformer.InferBlobShape(sampled_datum);
405
407 {
409 batch.Data.Reshape(rgShape);
410 }
411
412 // Apply data transformations (mirror, scale, crop...)
413 int nOffset = batch.Data.offset(i);
414 AnnotationGroupCollection rgTransformedAnnoVec;
415
416 if (m_bOutputLabels)
417 {
419 {
420 // Make sure all data have same annoation type.
422 sampled_datum.annotation_type = m_AnnoType;
423 else
424 m_log.CHECK_EQ((int)m_AnnoType, (int)sampled_datum.annotation_type, "The sampled datum has a different AnnoationType!");
425
426 // Transform datum and annotation_group at the same time.
427 bool bMirror;
428 T[] rgTrans = m_transformer.Transform(sampled_datum, out rgTransformedAnnoVec, out bMirror);
429 Array.Copy(rgTrans, 0, m_rgTopData, nDim * i, nDim);
430
431 // Count the number of bboxes.
433 {
434 for (int g = 0; g < rgTransformedAnnoVec.Count; g++)
435 {
436 nNumBboxes += rgTransformedAnnoVec[g].annotations.Count;
437 }
438 }
439 else
440 {
441 m_log.FAIL("Unknown annotation type.");
442 }
443
444 if (rgAllAnno == null)
445 rgAllAnno = new Dictionary<int, AnnotationGroupCollection>();
446
447 rgAllAnno.Add(i, rgTransformedAnnoVec);
448 }
449 else
450 {
451 T[] rgTrans = m_transformer.Transform(sampled_datum);
452 Array.Copy(rgTrans, 0, m_rgTopData, nDim * i, nDim);
453
454 // Otherwise, store the label from datum.
456 {
457 if (datum.DataCriteria == null || datum.DataCriteria.Length == 0)
458 m_log.FAIL("Could not find the multi-label data. The data source '" + m_param.data_param.source + "' does not appear to have any Image Criteria data.");
459
460 // Get the number of items and the item size from the end of the data.
461 int nLen = BitConverter.ToInt32(datum.DataCriteria, datum.DataCriteria.Length - (sizeof(int) * 4));
462 int nItemSize = BitConverter.ToInt32(datum.DataCriteria, datum.DataCriteria.Length - (sizeof(int) * 3));
463 int nDstIdx = i * nLen;
464
465 m_log.CHECK_EQ(nItemSize, 1, "Currently only byte sized labels are supported in multi-label scenarios.");
466 Array.Copy(datum.DataCriteria, 0, m_rgTopLabel, nDstIdx, nLen);
467 }
468 else
469 {
470 m_rgTopLabel[i] = (T)Convert.ChangeType(datum.Label, typeof(T));
471 }
472
473 bLabelDirty = true;
474 }
475 }
476
478 m_dfTransTime += m_swTimerTransaction.Elapsed.TotalMilliseconds;
479
480 Next();
481
482 if (m_evtCancel.WaitOne(0))
483 return;
484 }
485
486 batch.Data.SetCPUData(m_rgTopData);
487
488 if (m_bOutputLabels && bLabelDirty)
489 batch.Label.SetCPUData(m_rgTopLabel);
490
491 // Store 'rich' annotation if needed.
493 {
494 List<int> rgLabelShape = Utility.Create<int>(4, 1);
495
497 {
498 rgLabelShape[0] = 1;
499 rgLabelShape[1] = 1;
500 rgLabelShape[3] = 8;
501
502 if (nNumBboxes == 0)
503 {
504 // Store all -1 in the label.
505 rgLabelShape[2] = 1;
506 batch.Label.Reshape(rgLabelShape);
507
508 for (int i = 0; i < m_rgTopLabel.Length; i++)
509 {
510 m_rgTopLabel[i] = m_tMinusOne;
511 }
512
513 batch.Label.SetCPUData(m_rgTopLabel);
514 }
515 else
516 {
517 // Reshape the label and store the annotation.
518 rgLabelShape[2] = nNumBboxes;
519 batch.Label.Reshape(rgLabelShape);
520 int nCount = batch.Label.count();
521 m_log.CHECK_GT(nCount, 0, "The label count cannot be zero!");
522 float[] rgTopLabel1 = new float[nCount];
523
524 int nIdx = 0;
525 for (int i = 0; i < nBatchSize; i++)
526 {
527 AnnotationGroupCollection rgAnnoGroups = rgAllAnno[i];
528
529 for (int g = 0; g < rgAnnoGroups.Count; g++)
530 {
531 AnnotationGroup anno_group = rgAnnoGroups[g];
532
533 for (int a = 0; a < anno_group.annotations.Count; a++)
534 {
535 Annotation anno = anno_group.annotations[a];
536 NormalizedBBox bbox = anno.bbox;
537
538 rgTopLabel1[nIdx] = i;
539 nIdx++;
540 rgTopLabel1[nIdx] = anno_group.group_label;
541 nIdx++;
542 rgTopLabel1[nIdx] = anno.instance_id;
543 nIdx++;
544 rgTopLabel1[nIdx] = bbox.xmin;
545 nIdx++;
546 rgTopLabel1[nIdx] = bbox.ymin;
547 nIdx++;
548 rgTopLabel1[nIdx] = bbox.xmax;
549 nIdx++;
550 rgTopLabel1[nIdx] = bbox.ymax;
551 nIdx++;
552 rgTopLabel1[nIdx] = (bbox.difficult) ? 1 : 0;
553 nIdx++;
554 }
555 }
556 }
557
558 batch.Label.SetCPUData(convert(rgTopLabel1));
559 }
560 }
561 else
562 {
563 m_log.FAIL("Unknown annotation type.");
564 }
565 }
566
568 {
569 m_swTimerBatch.Stop();
571 m_log.WriteLine("Prefetch batch: " + m_swTimerBatch.ElapsedMilliseconds.ToString() + " ms.", true);
572 m_log.WriteLine(" Read time: " + m_dfReadTime.ToString() + " ms.", true);
573 m_log.WriteLine("Transform time: " + m_dfTransTime.ToString() + " ms.", true);
574 }
575 }
576 }
577}
Defines a collection of AnnotationGroups.
Definition: Annotation.cs:256
int Count
Specifies the number of items in the collection.
Definition: Annotation.cs:350
The AnnoationGroup class manages a group of annotations.
Definition: Annotation.cs:124
int group_label
Get/set the group label.
Definition: Annotation.cs:211
List< Annotation > annotations
Get/set the group annoations.
Definition: Annotation.cs:202
The Annotation class is used by annotations attached to SimpleDatum's and used in SSD.
Definition: Annotation.cs:22
int instance_id
Get/set the instance ID.
Definition: Annotation.cs:55
NormalizedBBox bbox
Get/set the bounding box.
Definition: Annotation.cs:64
The CancelEvent provides an extension to the manual cancel event that allows for overriding the manua...
Definition: CancelEvent.cs:17
bool WaitOne(int nMs=int.MaxValue)
Waits for the signal state to occur.
Definition: CancelEvent.cs:290
The CryptoRandom is a random number generator that can use either the standard .Net Random objec or t...
Definition: CryptoRandom.cs:14
METHOD
Defines the random number generation method to use.
Definition: CryptoRandom.cs:25
int Next(int nMinVal, int nMaxVal, bool bMaxInclusive=true)
Returns a random int within the range
The Log class provides general output in text form.
Definition: Log.cs:13
void CHECK(bool b, string str)
Test a flag for true.
Definition: Log.cs:227
void WriteLine(string str, bool bOverrideEnabled=false, bool bHeader=false, bool bError=false, bool bDisable=false)
Write a line of output.
Definition: Log.cs:80
void FAIL(string str)
Causes a failure which throws an exception with the desciptive text.
Definition: Log.cs:394
void CHECK_EQ(double df1, double df2, string str)
Test whether one number is equal to another.
Definition: Log.cs:239
void WriteError(Exception e)
Write an error as output.
Definition: Log.cs:130
void CHECK_GT(double df1, double df2, string str)
Test whether one number is greater than another.
Definition: Log.cs:299
The NormalizedBBox manages a bounding box used in SSD.
float ymax
Get/set the y maximum.
float xmax
Get/set the x maximum.
float xmin
Get/set the x minimum.
bool difficult
Get/set the difficulty.
float ymin
Get/set the y minimum.
The SimpleDatum class holds a data input within host memory.
Definition: SimpleDatum.cs:161
ANNOTATION_TYPE
Specifies the annotation type when using annotations.
Definition: SimpleDatum.cs:204
AnnotationGroupCollection annotation_group
When using annoations, each annotation group contains an annotation for a particular class used with ...
ANNOTATION_TYPE annotation_type
When using annotations, the annotation type specifies the type of annotation. Currently,...
The Utility class provides general utility funtions.
Definition: Utility.cs:35
static List< int > Create(int nCount, int nStart, int nInc)
Create a new List and fill it with values starting with start and incrementing by inc.
Definition: Utility.cs:721
The BlobCollection contains a list of Blobs.
The CudaDnn object is the main interface to the Low-Level Cuda C++ DLL.
Definition: CudaDnn.cs:969
The SsdSampler is used by the SSD algorithm to sample BBoxes.
Definition: SsdSampler.cs:21
void Dispose()
Free all resources used.
Definition: SsdSampler.cs:42
List< NormalizedBBox > GenerateBatchSamples(SimpleDatum anno_datum, List< BatchSampler > rgBatchSamplers)
Generate samples from the annotated Datum using the list of BatchSamplers.
Definition: SsdSampler.cs:236
The Cursor is used to traverse through a given data source within the database.
Definition: DB.cs:63
A generic database class used to connect to the underlying database and create a Cursor that traverse...
Definition: DB.cs:15
bool m_bOutputLabels
Specifies whether or not the Layer should output labels.
DataTransformer< T > m_transformer
Specifies the DataTransformer used to transform each data item as it loaded.
The BasePrefetchingDataLayer is the base class for data Layers that pre-fetch data before feeding the...
CancelEvent m_evtCancel
Specifies the cancellation event for the internal thread.
Batch< T >[] m_rgPrefetch
Specifies the pre-fetch cache.
The Batch contains both the data and label Blobs of the batch.
Blob< T > Label
Returns the label Blob of the batch.
Blob< T > Data
Returns the data Blob of the batch.
Log m_log
Specifies the Log for output.
Definition: Layer.cs:43
LayerParameter m_param
Specifies the LayerParameter describing the Layer.
Definition: Layer.cs:47
void convert(BlobCollection< T > col)
Convert a collection of blobs from / to half size.
Definition: Layer.cs:535
LayerParameter.LayerType m_type
Specifies the Layer type.
Definition: Layer.cs:35
The AnnotatedDataLayer provides annotated data to the Net by assigning top Blobs directly....
SimpleDatum.ANNOTATION_TYPE m_AnnoType
Specifies the annotation type used if any.
void Next()
Retrieves the next item from the database and rolls the cursor over once the end of the dataset is re...
override void load_batch(Batch< T > batch)
Load a batch of data in the background (this is run on an internal thread within the BasePrefetchingD...
double m_dfTransTime
Specifies the transaction time.
override int MinTopBlobs
Specifies the minimum number of required top (output) Blobs: data
Cursor< T > m_cursor
Specifies the database used to traverse through the database.
override void DataLayerSetUp(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Setup the DataLayer by starting up the pre-fetching.
Stopwatch m_swTimerTransaction
Specfies a second timer used to calculate the transaction time.
AnnotatedDataLayer(CudaDnn< T > cuda, Log log, LayerParameter p, IXDatabaseBase db, CancelEvent evtCancel)
The AnnotatedDataLayer constructor.
Stopwatch m_swTimerBatch
Specifies a first timer used to calcualte the batch time.
override void dispose()
Releases all GPU and host resources used by the Layer.
override int ExactNumBottomBlobs
No bottom blobs are used by this layer.
bool Skip()
Skip to the next value - used when training in a multi-GPU scenario.
DB< T > m_db
Specifies the database.
double m_dfReadTime
Specifies the read time.
Specifies the parameter for the data layer.
virtual uint batch_size
Specifies the batch size.
LABEL_TYPE label_type
(optional, default = SINGLE) Specifies the label type: SINGLE - the default which uses the 'Label' fi...
bool display_timing
(optional, default = false) Specifies whether or not to display the timing of each image read.
bool? enable_random_selection
(optional, default = null) Specifies whether or not to randomly query images from the data source....
bool? enable_pair_selection
(optional, default = null) Specifies whether or not to select images in a pair sequence....
string source
When used with the DATA parameter, specifies the data 'source' within the database....
LABEL_TYPE
Defines the label type.
Specifies the base parameter for all layers.
int solver_count
Returns the number of Solvers participating in a multi-GPU session for which the Solver using this La...
AnnotatedDataParameter annotated_data_param
Returns the parameter set when initialized with LayerType.ANNOTATED_DATA
int solver_rank
Returns the SolverRank of the Solver using this LayerParameter (if any).
TransformationParameter transform_param
Returns the parameter set when initialized with LayerType.TRANSFORM
DataParameter data_param
Returns the parameter set when initialized with LayerType.DATA
Phase phase
Specifies the Phase for which this LayerParameter is run.
LayerType
Specifies the layer type.
bool Active
When active, the parameter is used, otherwise it is ignored.
int? random_seed
Only used during testing.
DistortionParameter distortion_param
Optionally, specifies the distortion policy, otherwise this is null.
ExpansionParameter expansion_param
Optionally, specifies the expansion policy, otherwise this is null.
ResizeParameter resize_param
Optionally, specifies the resize policy, otherwise this is null.
SimpleDatum.ANNOTATION_TYPE anno_type
Get/set the annotation type.
List< BatchSampler > batch_sampler
Get/set the batch sampler.
string label_map_file
Get/set the label map file.
Specifies a sample of batch of bboxes with provided constraints in SSD.
Definition: BatchSampler.cs:22
Specifies the parameters for the ResizeParameter for use with SSD.
ResizeMode
Defines the resizing mode.
ResizeMode resize_mode
Get/set the resizing mode.
The IXDatabaseBase interface defines the general interface to the in-memory database.
Definition: Interfaces.cs:444
Tuple< DB_LABEL_SELECTION_METHOD, DB_ITEM_SELECTION_METHOD > GetSelectionMethod()
Returns the label and image selection method used.
void SetSelectionMethod(DB_LABEL_SELECTION_METHOD? lbl, DB_ITEM_SELECTION_METHOD? img)
Sets the label and image selection methods.
DB_VERSION GetVersion()
Returns the version of the MyCaffe Image Database being used.
The IXImageDatabaseBase interface defines the general interface to the in-memory image database.
Definition: Interfaces.cs:878
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
Phase
Defines the Phase under which to run a Net.
Definition: Interfaces.cs:61
DB_VERSION
Defines the image database version to use.
Definition: Interfaces.cs:397
The MyCaffe.common namespace contains common MyCaffe classes.
Definition: BatchInput.cs:8
The MyCaffe.data namespace contains dataset creators used to create common testing datasets such as M...
Definition: BinaryFile.cs:16
The MyCaffe.db.image namespace contains all image database related classes.
Definition: Database.cs:18
The MyCaffe.layers.ssd namespace contains all Single-Shot MultiBox (SSD) related layers.
Definition: LayerFactory.cs:19
The MyCaffe.param.ssd namespace contains all SSD related parameter objects that correspond to the nat...
The MyCaffe.param namespace contains parameters used to create models.
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...
Definition: Annotation.cs:12