Removed convenience initializer from refactored MPPVisionTaskRunner
This commit is contained in:
parent
d2a86341bd
commit
22dc08be0e
|
@ -59,10 +59,17 @@ static NSString *const kTaskPrefix = @"com.mediapipe.tasks.vision";
|
||||||
|
|
||||||
@implementation MPPVisionTaskRunner
|
@implementation MPPVisionTaskRunner
|
||||||
|
|
||||||
- (nullable instancetype)initWithCalculatorGraphConfig:(CalculatorGraphConfig)graphConfig
|
- (nullable instancetype)initWithTaskInfo:(MPPTaskInfo *)taskInfo
|
||||||
runningMode:(MPPRunningMode)runningMode
|
runningMode:(MPPRunningMode)runningMode
|
||||||
|
roiAllowed:(BOOL)roiAllowed
|
||||||
packetsCallback:(PacketsCallback)packetsCallback
|
packetsCallback:(PacketsCallback)packetsCallback
|
||||||
|
imageInputStreamName:(NSString *)imageInputStreamName
|
||||||
|
normRectInputStreamName:(NSString *)normRectInputStreamName
|
||||||
error:(NSError **)error {
|
error:(NSError **)error {
|
||||||
|
_roiAllowed = roiAllowed;
|
||||||
|
_imageInStreamName = imageInputStreamName.cppString;
|
||||||
|
_normRectInStreamName = normRectInputStreamName.cppString;
|
||||||
|
|
||||||
switch (runningMode) {
|
switch (runningMode) {
|
||||||
case MPPRunningModeImage:
|
case MPPRunningModeImage:
|
||||||
case MPPRunningModeVideo: {
|
case MPPRunningModeVideo: {
|
||||||
|
@ -97,28 +104,12 @@ static NSString *const kTaskPrefix = @"com.mediapipe.tasks.vision";
|
||||||
}
|
}
|
||||||
|
|
||||||
_runningMode = runningMode;
|
_runningMode = runningMode;
|
||||||
self = [super initWithCalculatorGraphConfig:graphConfig
|
self = [super initWithCalculatorGraphConfig: [taskInfo generateGraphConfig]
|
||||||
packetsCallback:packetsCallback
|
packetsCallback:packetsCallback
|
||||||
error:error];
|
error:error];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (nullable instancetype)initWithTaskInfo:(MPPTaskInfo *)taskInfo
|
|
||||||
runningMode:(MPPRunningMode)runningMode
|
|
||||||
roiAllowed:(BOOL)roiAllowed
|
|
||||||
packetsCallback:(PacketsCallback)packetsCallback
|
|
||||||
imageInputStreamName:(NSString *)imageInputStreamName
|
|
||||||
normRectInputStreamName:(NSString *)normRectInputStreamName
|
|
||||||
error:(NSError **)error {
|
|
||||||
_roiAllowed = roiAllowed;
|
|
||||||
_imageInStreamName = imageInputStreamName.cppString;
|
|
||||||
_normRectInStreamName = normRectInputStreamName.cppString;
|
|
||||||
|
|
||||||
return [self initWithCalculatorGraphConfig:[taskInfo generateGraphConfig]
|
|
||||||
packetsCallback:packetsCallback
|
|
||||||
error:error];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (std::optional<NormalizedRect>)normalizedRectWithRegionOfInterest:(CGRect)roi
|
- (std::optional<NormalizedRect>)normalizedRectWithRegionOfInterest:(CGRect)roi
|
||||||
imageSize:(CGSize)imageSize
|
imageSize:(CGSize)imageSize
|
||||||
imageOrientation:
|
imageOrientation:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user