| 23 | }; |
| 24 | |
| 25 | static inline MobileNetWidthType EnumMobileNetWidthTypeByString(const std::string& key) { |
| 26 | auto mobileNetWidthTypeMap = std::map<std::string, MobileNetWidthType>({ |
| 27 | {"1.0", MobileNet_100}, |
| 28 | {"0.75", MobileNet_075}, |
| 29 | {"0.5", MobileNet_050}, |
| 30 | {"0.25", MobileNet_025}}); |
| 31 | auto mobileNetWidthTypeIter = mobileNetWidthTypeMap.find(key); |
| 32 | if (mobileNetWidthTypeIter == mobileNetWidthTypeMap.end()) { |
| 33 | return (MobileNetWidthType)(-1); |
| 34 | } |
| 35 | return mobileNetWidthTypeIter->second; |
| 36 | } |
| 37 | |
| 38 | static inline MobileNetResolutionType EnumMobileNetResolutionTypeByString(const std::string& key) { |
| 39 | auto mobileNetResolutionTypeMap = std::map<std::string, MobileNetResolutionType>({ |