MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / UpgradeV0Net

Function UpgradeV0Net

rtpose_wrapper/src/caffe/util/upgrade_proto.cpp:104–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104bool UpgradeV0Net(const NetParameter& v0_net_param_padding_layers,
105 NetParameter* net_param) {
106 // First upgrade padding layers to padded conv layers.
107 NetParameter v0_net_param;
108 UpgradeV0PaddingLayers(v0_net_param_padding_layers, &v0_net_param);
109 // Now upgrade layer parameters.
110 bool is_fully_compatible = true;
111 net_param->Clear();
112 if (v0_net_param.has_name()) {
113 net_param->set_name(v0_net_param.name());
114 }
115 for (int i = 0; i < v0_net_param.layers_size(); ++i) {
116 is_fully_compatible &= UpgradeV0LayerParameter(v0_net_param.layers(i),
117 net_param->add_layers());
118 }
119 for (int i = 0; i < v0_net_param.input_size(); ++i) {
120 net_param->add_input(v0_net_param.input(i));
121 }
122 for (int i = 0; i < v0_net_param.input_dim_size(); ++i) {
123 net_param->add_input_dim(v0_net_param.input_dim(i));
124 }
125 if (v0_net_param.has_force_backward()) {
126 net_param->set_force_backward(v0_net_param.force_backward());
127 }
128 return is_fully_compatible;
129}
130
131void UpgradeV0PaddingLayers(const NetParameter& param,
132 NetParameter* param_upgraded_pad) {

Callers 2

RunV0UpgradeTestMethod · 0.85
UpgradeNetAsNeededFunction · 0.85

Calls 3

UpgradeV0PaddingLayersFunction · 0.85
UpgradeV0LayerParameterFunction · 0.85
ClearMethod · 0.45

Tested by 1

RunV0UpgradeTestMethod · 0.68