MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
LabelBBox.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6
7namespace MyCaffe.basecode
8{
16 public class LabelBBox
17 {
18 DictionaryMap<List<NormalizedBBox>> m_rgItems = new DictionaryMap<List<NormalizedBBox>>(null);
19
23 public LabelBBox()
24 {
25 }
26
31 public List<KeyValuePair<int, List<NormalizedBBox>>> ToList()
32 {
33 return m_rgItems.Map.ToList();
34 }
35
41 public void Add(int nLabel, NormalizedBBox bbox)
42 {
43 if (m_rgItems[nLabel] == null)
44 m_rgItems[nLabel] = new List<NormalizedBBox>();
45
46 m_rgItems[nLabel].Add(bbox);
47 }
48
52 public int Count
53 {
54 get { return m_rgItems.Count; }
55 }
56
62 public bool Contains(int nLabel)
63 {
64 return m_rgItems.Map.ContainsKey(nLabel);
65 }
66
72 public List<NormalizedBBox> this[int nLabel]
73 {
74 get
75 {
76 if (m_rgItems[nLabel] == null)
77 m_rgItems[nLabel] = new List<NormalizedBBox>();
78
79 return m_rgItems[nLabel];
80 }
81 set
82 {
83 m_rgItems[nLabel] = value;
84 }
85 }
86
90 public void Clear()
91 {
92 m_rgItems.Clear();
93 }
94 }
95}
The LabelBBox manages a bounding box used in SSD.
Definition: LabelBBox.cs:17
LabelBBox()
The constructor.
Definition: LabelBBox.cs:23
void Add(int nLabel, NormalizedBBox bbox)
Add a new bbox to the label.
Definition: LabelBBox.cs:41
List< KeyValuePair< int, List< NormalizedBBox > > > ToList()
Returns the internal dictionary of items as a list.
Definition: LabelBBox.cs:31
void Clear()
Remove all items from the group.
Definition: LabelBBox.cs:90
bool Contains(int nLabel)
Returns whether or not the label is contained in the label bounding boxe set.
Definition: LabelBBox.cs:62
int Count
Returns the number of items.
Definition: LabelBBox.cs:53
The NormalizedBBox manages a bounding box used in SSD.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
Definition: Annotation.cs:12