2using System.Collections.Generic;
20 [TypeConverter(typeof(ExpandableObjectConverter))]
23 float m_fMinScale = 1.0f;
24 float m_fMaxScale = 1.0f;
25 float m_fMinAspectRatio = 1.0f;
26 float m_fMaxAspectRatio = 1.0f;
39 public void Save(BinaryWriter bw)
41 bw.Write(m_fMinScale);
42 bw.Write(m_fMaxScale);
43 bw.Write(m_fMinAspectRatio);
44 bw.Write(m_fMaxAspectRatio);
53 public object Load(BinaryReader br,
bool bNewInstance)
60 b.m_fMinScale = br.ReadSingle();
61 b.m_fMaxScale = br.ReadSingle();
62 b.m_fMinAspectRatio = br.ReadSingle();
63 b.m_fMaxAspectRatio = br.ReadSingle();
84 get {
return m_fMinScale; }
85 set { m_fMinScale = value; }
93 get {
return m_fMaxScale; }
94 set { m_fMaxScale = value; }
102 get {
return m_fMinAspectRatio; }
103 set { m_fMinAspectRatio = value; }
111 get {
return m_fMaxAspectRatio; }
112 set { m_fMaxAspectRatio = value; }
123 bs.m_fMinScale = m_fMinScale;
124 bs.m_fMaxScale = m_fMaxScale;
125 bs.m_fMinAspectRatio = m_fMinAspectRatio;
126 bs.m_fMaxAspectRatio = m_fMaxAspectRatio;
135 object ICloneable.
Clone()
147 if (bs.m_fMinScale != m_fMinScale)
149 if (bs.m_fMaxScale != m_fMaxScale)
152 if (bs.m_fMinAspectRatio != m_fMinAspectRatio)
154 if (bs.m_fMaxAspectRatio != m_fMaxAspectRatio)
187 rgChildren.
Add(
new RawProto(
"min_scale", m_fMinScale.ToString()));
188 rgChildren.
Add(
new RawProto(
"max_scale", m_fMaxScale.ToString()));
189 rgChildren.
Add(
new RawProto(
"min_aspect_ratio", m_fMinAspectRatio.ToString()));
190 rgChildren.
Add(
new RawProto(
"max_aspect_ratio", m_fMaxAspectRatio.ToString()));
192 return new RawProto(strName,
"", rgChildren);
205 if ((strVal = rp.
FindValue(
"min_scale")) !=
null)
207 if ((strVal = rp.
FindValue(
"max_scale")) !=
null)
210 if ((strVal = rp.
FindValue(
"min_aspect_ratio")) !=
null)
212 if ((strVal = rp.
FindValue(
"max_aspect_ratio")) !=
null)
226 strOut +=
"min_scale = " +
min_scale.ToString() + Environment.NewLine;
227 strOut +=
"max_scale = " +
max_scale.ToString() + Environment.NewLine;
228 strOut +=
"min_aspect_ratio = " +
min_aspect_ratio.ToString() + Environment.NewLine;
229 strOut +=
"max_aspect_ratio = " +
max_aspect_ratio.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 sample of a bbox in the normalized space [0,1] with provided constraints used in SSD.
override string ToString()
Return the string representation of the shape.
void Save(BinaryWriter bw)
Save the Sample to a binary writer.
bool Compare(Sampler bs)
Compares this Sample to another.
int CompareTo(object obj)
Compares this Sample to another.
Sampler Clone()
Creates a copy of the Sample.
static Sampler Load(BinaryReader br)
Load the Sample from a binary reader.
float max_scale
Get/set the maximum scale of the sampled bbox.
float max_aspect_ratio
Get/set the maximum aspect ratio of the sampled bbox.
float min_scale
Get/set the minimum scale of the sampled bbox.
override RawProto ToProto(string strName)
Converts the Sample to a RawProto.
object Load(BinaryReader br, bool bNewInstance)
Load the Sample from a binary reader.
float min_aspect_ratio
Get/set the minimum aspect ratio of the sampled bbox.
static Sampler FromProto(RawProto rp)
Parse a new Sample from a RawProto.
Sampler()
The Sample constructor.
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-...