Added a test for getting labels from iOS image segmenter
This commit is contained in:
parent
dd823d16f8
commit
fce7b19ad7
|
@ -507,6 +507,22 @@ double softIOU(const float *mask1, const float *mask2, size_t size) {
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark GetLabelsTest
|
||||||
|
|
||||||
|
- (void)testGetLabelsSucceeds {
|
||||||
|
MPPImageSegmenterOptions *options =
|
||||||
|
[self imageSegmenterOptionsWithModelFileInfo:kImageSegmenterModelFileInfo];
|
||||||
|
|
||||||
|
MPPImageSegmenter *imageSegmenter = [self createImageSegmenterWithOptionsSucceeds:options];
|
||||||
|
|
||||||
|
NSArray *expectedLabels = @[@"background", @"aeroplane", @"bicycle",
|
||||||
|
@"bird", @"boat", @"bottle", @"bus", @"car",@"cat",
|
||||||
|
@"chair", @"cow", @"dining table", @"dog", @"horse", @"motorbike",
|
||||||
|
@"person", @"potted plant", @"sheep", @"sofa", @"train", @"tv"];
|
||||||
|
|
||||||
|
XCTAssertEqualObjects(imageSegmenter.labels, expectedLabels);
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Image Segmenter Initializers
|
#pragma mark - Image Segmenter Initializers
|
||||||
|
|
||||||
- (MPPImageSegmenterOptions *)imageSegmenterOptionsWithModelFileInfo:(MPPFileInfo *)fileInfo {
|
- (MPPImageSegmenterOptions *)imageSegmenterOptionsWithModelFileInfo:(MPPFileInfo *)fileInfo {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user