Renamed label to category in classifier options

This commit is contained in:
Prianka Liz Kariat 2022-12-22 01:19:01 +05:30
parent e1dfcf03cf
commit c185dc9ad7
3 changed files with 6 additions and 6 deletions

View File

@ -36,10 +36,10 @@ NS_SWIFT_NAME(ClassifierOptions)
@property(nonatomic) float scoreThreshold;
/** If set, all classes not in this list will be filtered out from the results. */
@property(nonatomic, copy) NSArray<NSString *> *labelAllowList;
@property(nonatomic, copy) NSArray<NSString *> *categoryAllowList;
/** If set, all classes in this list will be filtered out from the results. */
@property(nonatomic, copy) NSArray<NSString *> *labelDenyList;
@property(nonatomic, copy) NSArray<NSString *> *categoryDenyList;
@end

View File

@ -30,8 +30,8 @@
classifierOptions.scoreThreshold = self.scoreThreshold;
classifierOptions.maxResults = self.maxResults;
classifierOptions.labelDenyList = self.labelDenyList;
classifierOptions.labelAllowList = self.labelAllowList;
classifierOptions.categoryDenyList = self.categoryDenyList;
classifierOptions.categoryAllowList = self.categoryAllowList;
classifierOptions.displayNamesLocale = self.displayNamesLocale;
return classifierOptions;

View File

@ -30,11 +30,11 @@ using ClassifierOptionsProto = ::mediapipe::tasks::components::processors::proto
classifierOptionsProto->set_score_threshold(self.scoreThreshold);
for (NSString *category in self.labelAllowList) {
for (NSString *category in self.categoryAllowList) {
classifierOptionsProto->add_category_allowlist(category.cppString);
}
for (NSString *category in self.labelDenyList) {
for (NSString *category in self.categoryDenyList) {
classifierOptionsProto->add_category_denylist(category.cppString);
}
}