Clearing proto before assigining new values in MPPClassifierOptions Helpers

This commit is contained in:
Prianka Liz Kariat 2022-12-22 12:10:23 +05:30
parent e559613b9d
commit e47256ae55

View File

@ -22,6 +22,8 @@ using ClassifierOptionsProto = ::mediapipe::tasks::components::processors::proto
@implementation MPPClassifierOptions (Helpers) @implementation MPPClassifierOptions (Helpers)
- (void)copyToProto:(ClassifierOptionsProto *)classifierOptionsProto { - (void)copyToProto:(ClassifierOptionsProto *)classifierOptionsProto {
classifierOptionsProto->Clear();
if (self.displayNamesLocale) { if (self.displayNamesLocale) {
classifierOptionsProto->set_display_names_locale(self.displayNamesLocale.cppString); classifierOptionsProto->set_display_names_locale(self.displayNamesLocale.cppString);
} }