2using System.Collections.Generic;
20 [TypeConverter(typeof(ExpandableObjectConverter))]
23 float? m_fMinJaccardOverlap =
null;
24 float? m_fMaxJaccardOverlap =
null;
25 float? m_fMinSampleCoverage =
null;
26 float? m_fMaxSampleCoverage =
null;
27 float? m_fMinObjectCoverage =
null;
28 float? m_fMaxObjectCoverage =
null;
37 private void save(BinaryWriter bw,
float? f)
44 private float? load(BinaryReader br)
47 return br.ReadSingle();
56 public void Save(BinaryWriter bw)
58 save(bw, m_fMinJaccardOverlap);
59 save(bw, m_fMaxJaccardOverlap);
60 save(bw, m_fMinSampleCoverage);
61 save(bw, m_fMaxSampleCoverage);
62 save(bw, m_fMinObjectCoverage);
63 save(bw, m_fMaxSampleCoverage);
72 public object Load(BinaryReader br,
bool bNewInstance)
79 b.m_fMinJaccardOverlap = load(br);
80 b.m_fMaxJaccardOverlap = load(br);
81 b.m_fMinSampleCoverage = load(br);
82 b.m_fMaxSampleCoverage = load(br);
83 b.m_fMinObjectCoverage = load(br);
84 b.m_fMaxObjectCoverage = load(br);
105 get {
return m_fMinJaccardOverlap; }
106 set { m_fMinJaccardOverlap = value; }
114 get {
return m_fMaxJaccardOverlap; }
115 set { m_fMaxJaccardOverlap = value; }
123 get {
return m_fMinSampleCoverage; }
124 set { m_fMinSampleCoverage = value; }
132 get {
return m_fMaxSampleCoverage; }
133 set { m_fMaxSampleCoverage = value; }
141 get {
return m_fMinObjectCoverage; }
142 set { m_fMinObjectCoverage = value; }
150 get {
return m_fMaxObjectCoverage; }
151 set { m_fMaxObjectCoverage = value; }
162 bs.m_fMinJaccardOverlap = m_fMinJaccardOverlap;
163 bs.m_fMaxJaccardOverlap = m_fMaxJaccardOverlap;
164 bs.m_fMinSampleCoverage = m_fMinSampleCoverage;
165 bs.m_fMaxSampleCoverage = m_fMaxSampleCoverage;
166 bs.m_fMinObjectCoverage = m_fMinObjectCoverage;
167 bs.m_fMaxObjectCoverage = m_fMaxObjectCoverage;
176 object ICloneable.
Clone()
188 if (bs.m_fMinJaccardOverlap != m_fMinJaccardOverlap)
190 if (bs.m_fMaxJaccardOverlap != m_fMaxJaccardOverlap)
193 if (bs.m_fMinSampleCoverage != m_fMinSampleCoverage)
195 if (bs.m_fMaxSampleCoverage != m_fMaxSampleCoverage)
198 if (bs.m_fMinObjectCoverage != m_fMinObjectCoverage)
200 if (bs.m_fMaxObjectCoverage != m_fMaxObjectCoverage)
233 if (m_fMinJaccardOverlap.HasValue)
234 rgChildren.
Add(
new RawProto(
"min_jaccard_overlap", m_fMinJaccardOverlap.Value.ToString()));
235 if (m_fMaxJaccardOverlap.HasValue)
236 rgChildren.
Add(
new RawProto(
"max_jaccard_overlap", m_fMaxJaccardOverlap.Value.ToString()));
238 if (m_fMinSampleCoverage.HasValue)
239 rgChildren.
Add(
new RawProto(
"min_sample_coverage", m_fMinSampleCoverage.Value.ToString()));
240 if (m_fMaxSampleCoverage.HasValue)
241 rgChildren.
Add(
new RawProto(
"max_sample_coverage", m_fMaxSampleCoverage.Value.ToString()));
243 if (m_fMinObjectCoverage.HasValue)
244 rgChildren.
Add(
new RawProto(
"min_object_coverage", m_fMinObjectCoverage.Value.ToString()));
245 if (m_fMaxObjectCoverage.HasValue)
246 rgChildren.
Add(
new RawProto(
"max_object_coverage", m_fMaxObjectCoverage.Value.ToString()));
248 return new RawProto(strName,
"", rgChildren);
261 if ((strVal = rp.
FindValue(
"min_jaccard_overlap")) !=
null)
263 if ((strVal = rp.
FindValue(
"max_jaccard_overlap")) !=
null)
266 if ((strVal = rp.
FindValue(
"min_sample_coverage")) !=
null)
268 if ((strVal = rp.
FindValue(
"max_sample_coverage")) !=
null)
271 if ((strVal = rp.
FindValue(
"min_object_coverage")) !=
null)
273 if ((strVal = rp.
FindValue(
"max_object_coverage")) !=
null)
288 strOut +=
"min_jaccard_overlap = " +
min_jaccard_overlap.Value.ToString() + Environment.NewLine;
290 strOut +=
"max_jaccard_overlap = " +
max_jaccard_overlap.Value.ToString() + Environment.NewLine;
293 strOut +=
"min_sample_coverage = " +
min_sample_coverage.Value.ToString() + Environment.NewLine;
295 strOut +=
"max_sample_coverage = " +
max_sample_coverage.Value.ToString() + Environment.NewLine;
298 strOut +=
"min_object_coverage = " +
min_object_coverage.Value.ToString() + Environment.NewLine;
300 strOut +=
"max_object_coverage = " +
max_object_coverage.Value.ToString() + Environment.NewLine;
The BaseParameter class is the base class for all other parameter classes.
static float ParseFloat(string strVal)
Parse float values using the US culture if the decimal separator = '.', then using the native culture...
The RawProtoCollection class is a list of RawProto objects.
void Add(RawProto p)
Adds a RawProto to the collection.
The RawProto class is used to parse and output Google prototxt file data.
string FindValue(string strName)
Searches for a falue of a node within this nodes children.
Specifies the constratins for selecting sampled bbox used in SSD.
static SamplerConstraint FromProto(RawProto rp)
Parse a new SampleConstraint from a RawProto.
float? max_object_coverage
Get/set the maximum Object coverage between sampled bbox and all boxes in AnnotationGroup.
float? min_object_coverage
Get/set the minimum Object coverage between sampled bbox and all boxes in AnnotationGroup.
SamplerConstraint()
The SampleConstraint constructor.
float? max_jaccard_overlap
Get/set the maximum Jaccard overlap between sampled bbox and all boxes in AnnotationGroup.
float? min_sample_coverage
Get/set the minimum Sample coverage between sampled bbox and all boxes in AnnotationGroup.
int CompareTo(object obj)
Compares this SampleConstraint to another.
float? max_sample_coverage
Get/set the maximum Sample coverage between sampled bbox and all boxes in AnnotationGroup.
override RawProto ToProto(string strName)
Converts the SampleConstraint to a RawProto.
void Save(BinaryWriter bw)
Save the SampleConstraint to a binary writer.
override string ToString()
Return the string representation of the shape.
static SamplerConstraint Load(BinaryReader br)
Load the SampleConstraint from a binary reader.
object Load(BinaryReader br, bool bNewInstance)
Load the SampleConstraint from a binary reader.
SamplerConstraint Clone()
Creates a copy of the SampleConstraint.
float? min_jaccard_overlap
Get/set the minimum Jaccard overlap between sampled bbox and all boxes in AnnotationGroup.
bool Compare(SamplerConstraint bs)
Compares this SampleConstraint to another.
The IBinaryPersist interface provides generic save and load functionality.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
The MyCaffe.common namespace contains common MyCaffe classes.
The MyCaffe.param.ssd namespace contains all SSD related parameter objects that correspond to the nat...
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...