Renamed label to category in classifier options
This commit is contained in:
parent
e1dfcf03cf
commit
c185dc9ad7
|
@ -36,10 +36,10 @@ NS_SWIFT_NAME(ClassifierOptions)
|
||||||
@property(nonatomic) float scoreThreshold;
|
@property(nonatomic) float scoreThreshold;
|
||||||
|
|
||||||
/** If set, all classes not in this list will be filtered out from the results. */
|
/** 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. */
|
/** 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
|
@end
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,8 @@
|
||||||
|
|
||||||
classifierOptions.scoreThreshold = self.scoreThreshold;
|
classifierOptions.scoreThreshold = self.scoreThreshold;
|
||||||
classifierOptions.maxResults = self.maxResults;
|
classifierOptions.maxResults = self.maxResults;
|
||||||
classifierOptions.labelDenyList = self.labelDenyList;
|
classifierOptions.categoryDenyList = self.categoryDenyList;
|
||||||
classifierOptions.labelAllowList = self.labelAllowList;
|
classifierOptions.categoryAllowList = self.categoryAllowList;
|
||||||
classifierOptions.displayNamesLocale = self.displayNamesLocale;
|
classifierOptions.displayNamesLocale = self.displayNamesLocale;
|
||||||
|
|
||||||
return classifierOptions;
|
return classifierOptions;
|
||||||
|
|
|
@ -30,11 +30,11 @@ using ClassifierOptionsProto = ::mediapipe::tasks::components::processors::proto
|
||||||
|
|
||||||
classifierOptionsProto->set_score_threshold(self.scoreThreshold);
|
classifierOptionsProto->set_score_threshold(self.scoreThreshold);
|
||||||
|
|
||||||
for (NSString *category in self.labelAllowList) {
|
for (NSString *category in self.categoryAllowList) {
|
||||||
classifierOptionsProto->add_category_allowlist(category.cppString);
|
classifierOptionsProto->add_category_allowlist(category.cppString);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (NSString *category in self.labelDenyList) {
|
for (NSString *category in self.categoryDenyList) {
|
||||||
classifierOptionsProto->add_category_denylist(category.cppString);
|
classifierOptionsProto->add_category_denylist(category.cppString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user