Skip to content

Commit 7f6a172

Browse files
YUNQIUGUOrachguo
andauthored
Update SuperRes ios app to released version ort-ext pods and some other minor refinements (microsoft#208)
* update pod version to release version * refine the app * readme fix * update screenshot * fix * omit version using latest * update comments --------- Co-authored-by: rachguo <[email protected]>
1 parent 7b97272 commit 7f6a172

File tree

10 files changed

+16
-14
lines changed

10 files changed

+16
-14
lines changed

mobile/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ The [Xamarin.Forms](https://dotnet.microsoft.com/apps/xamarin/xamarin-forms) exa
5959
The example application accomplishes the task of recovering a high resolution (HR) image from its low resolution counterpart with Ort-Extensions support for pre/post processing. Currently supports on platform Android and iOS.
6060

6161
- [Android Super Resolution](examples/super_resolution/android)
62-
- [iOS Super Resolution](examples/speech_recognition/ios)
62+
- [iOS Super Resolution](examples/super_resolution/ios)

mobile/examples/super_resolution/ios/ORTSuperResolution/ORTSuperResolution.xcodeproj/project.pbxproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
510A53D6296DE390000DB268 /* pt_super_resolution_with_pre_post_processing_opset16.onnx in Resources */ = {isa = PBXBuildFile; fileRef = 510A53D5296DE390000DB268 /* pt_super_resolution_with_pre_post_processing_opset16.onnx */; };
1110
510A53E8296FE46F000DB268 /* cat_224x224.png in Resources */ = {isa = PBXBuildFile; fileRef = 510A53E7296FE46F000DB268 /* cat_224x224.png */; };
1211
5130D9BC2968B93A009B4B88 /* ORTSuperResolutionApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5130D9BB2968B93A009B4B88 /* ORTSuperResolutionApp.swift */; };
1312
5130D9BE2968B93A009B4B88 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5130D9BD2968B93A009B4B88 /* ContentView.swift */; };
1413
5130D9C02968B93C009B4B88 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5130D9BF2968B93C009B4B88 /* Assets.xcassets */; };
1514
5130D9C32968B93C009B4B88 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5130D9C22968B93C009B4B88 /* Preview Assets.xcassets */; };
15+
5197BEA129A0492D004B83DE /* pytorch_superresolution_with_pre_post_processing_opset18.onnx in Resources */ = {isa = PBXBuildFile; fileRef = 5197BEA029A0492D004B83DE /* pytorch_superresolution_with_pre_post_processing_opset18.onnx */; };
16+
5197BEA229A0492D004B83DE /* pytorch_superresolution_with_pre_post_processing_opset18.onnx in Resources */ = {isa = PBXBuildFile; fileRef = 5197BEA029A0492D004B83DE /* pytorch_superresolution_with_pre_post_processing_opset18.onnx */; };
1617
51AB38AF2981FA5E004E33B0 /* ORTSuperResolutionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51AB38AE2981FA5E004E33B0 /* ORTSuperResolutionTests.swift */; };
1718
51D5968B2968DE9900F1CD43 /* ORTSuperResolutionPerformer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51D5968A2968DE9900F1CD43 /* ORTSuperResolutionPerformer.mm */; };
1819
/* End PBXBuildFile section */
@@ -28,13 +29,13 @@
2829
/* End PBXContainerItemProxy section */
2930

3031
/* Begin PBXFileReference section */
31-
510A53D5296DE390000DB268 /* pt_super_resolution_with_pre_post_processing_opset16.onnx */ = {isa = PBXFileReference; lastKnownFileType = file; path = pt_super_resolution_with_pre_post_processing_opset16.onnx; sourceTree = "<group>"; };
3232
510A53E7296FE46F000DB268 /* cat_224x224.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cat_224x224.png; sourceTree = "<group>"; };
3333
5130D9B82968B93A009B4B88 /* ORTSuperResolution.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ORTSuperResolution.app; sourceTree = BUILT_PRODUCTS_DIR; };
3434
5130D9BB2968B93A009B4B88 /* ORTSuperResolutionApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ORTSuperResolutionApp.swift; sourceTree = "<group>"; };
3535
5130D9BD2968B93A009B4B88 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
3636
5130D9BF2968B93C009B4B88 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
3737
5130D9C22968B93C009B4B88 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
38+
5197BEA029A0492D004B83DE /* pytorch_superresolution_with_pre_post_processing_opset18.onnx */ = {isa = PBXFileReference; lastKnownFileType = file; path = pytorch_superresolution_with_pre_post_processing_opset18.onnx; sourceTree = "<group>"; };
3839
51AB38AC2981FA5E004E33B0 /* ORTSuperResolutionTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ORTSuperResolutionTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3940
51AB38AE2981FA5E004E33B0 /* ORTSuperResolutionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ORTSuperResolutionTests.swift; sourceTree = "<group>"; };
4041
51D596892968DE9900F1CD43 /* ORTSuperResolutionPerformer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORTSuperResolutionPerformer.h; sourceTree = "<group>"; };
@@ -82,8 +83,8 @@
8283
5130D9BA2968B93A009B4B88 /* ORTSuperResolution */ = {
8384
isa = PBXGroup;
8485
children = (
85-
510A53D5296DE390000DB268 /* pt_super_resolution_with_pre_post_processing_opset16.onnx */,
8686
510A53E7296FE46F000DB268 /* cat_224x224.png */,
87+
5197BEA029A0492D004B83DE /* pytorch_superresolution_with_pre_post_processing_opset18.onnx */,
8788
51D5968A2968DE9900F1CD43 /* ORTSuperResolutionPerformer.mm */,
8889
51D596892968DE9900F1CD43 /* ORTSuperResolutionPerformer.h */,
8990
5130D9BB2968B93A009B4B88 /* ORTSuperResolutionApp.swift */,
@@ -200,17 +201,18 @@
200201
isa = PBXResourcesBuildPhase;
201202
buildActionMask = 2147483647;
202203
files = (
203-
510A53D6296DE390000DB268 /* pt_super_resolution_with_pre_post_processing_opset16.onnx in Resources */,
204204
5130D9C32968B93C009B4B88 /* Preview Assets.xcassets in Resources */,
205205
5130D9C02968B93C009B4B88 /* Assets.xcassets in Resources */,
206206
510A53E8296FE46F000DB268 /* cat_224x224.png in Resources */,
207+
5197BEA129A0492D004B83DE /* pytorch_superresolution_with_pre_post_processing_opset18.onnx in Resources */,
207208
);
208209
runOnlyForDeploymentPostprocessing = 0;
209210
};
210211
51AB38AA2981FA5E004E33B0 /* Resources */ = {
211212
isa = PBXResourcesBuildPhase;
212213
buildActionMask = 2147483647;
213214
files = (
215+
5197BEA229A0492D004B83DE /* pytorch_superresolution_with_pre_post_processing_opset18.onnx in Resources */,
214216
);
215217
runOnlyForDeploymentPostprocessing = 0;
216218
};

mobile/examples/super_resolution/ios/ORTSuperResolution/ORTSuperResolution/ContentView.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,21 @@ struct ContentView: View {
2626
.border(Color.purple, width: 4)
2727
.background(Color.purple)
2828

29-
Text("Input low resolution image: ").frame(width: 350, height: 40, alignment:.leading)
29+
Text("Low resolution image: ").frame(width: 350, height: 40, alignment:.leading)
3030

31-
Image("cat_224x224").frame(width: 250, height: 250)
31+
Image("cat_224x224").resizable().aspectRatio(1, contentMode: .fit).frame(width: 250, height: 250)
3232

3333
Button("Perform Super Resolution") {
3434
performSuperRes.toggle()
3535
}
3636

3737
if performSuperRes {
38-
Text("Output high resolution image: ").frame(width: 350, height: 40, alignment:.leading)
38+
Text("Higher resolution image: ").frame(width: 350, height: 40, alignment:.leading)
3939

4040
if let outputImage = runOrtSuperResolution() {
41-
Image(uiImage: outputImage)
41+
Image(uiImage: outputImage).resizable()
42+
.aspectRatio(1, contentMode: .fit).frame(width: 250, height: 250)
43+
4244
} else {
4345
Text("Unable to perform super resolution. ").frame(width: 350, height: 40, alignment:.leading)
4446
}

mobile/examples/super_resolution/ios/ORTSuperResolution/ORTSuperResolution/ORTSuperResolutionPerformer.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ + (nullable UIImage*)performSuperResolutionWithError:(NSError **)error {
3535

3636
// Step 1: Load model
3737

38-
NSString *model_path = [NSBundle.mainBundle pathForResource:@"pt_super_resolution_with_pre_post_processing_opset16"
38+
NSString *model_path = [NSBundle.mainBundle pathForResource:@"pytorch_superresolution_with_pre_post_processing_opset18"
3939
ofType:@"onnx"];
4040
if (model_path == nullptr) {
4141
throw std::runtime_error("Failed to get model path");

mobile/examples/super_resolution/ios/ORTSuperResolution/Podfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ target 'ORTSuperResolution' do
77
# Pods for OrtSuperResolution
88
pod 'onnxruntime-c'
99

10-
# Pre-release version pods
11-
pod 'onnxruntime-extensions-c', '0.5.0-dev+261962.e3663fb'
10+
pod 'onnxruntime-extensions-c'
1211

1312
end
1413

mobile/examples/super_resolution/ios/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,4 @@ The model used here is from source: [Pytorch Super Resolution](https://pytorch.o
2828
#
2929
Here's an example screenshot of the app:
3030

31-
<img width=25% src="images/Screenshot1.png" alt="App Screenshot" />
32-
<img width=25% src="images/Screenshot2.png" alt="App Screenshot" />
31+
<img width=25% src="images/Sample_Screenshot_1.png" alt="App Screenshot" />
1.6 MB
Loading
-1.77 MB
Binary file not shown.
-2.38 MB
Binary file not shown.

0 commit comments

Comments
 (0)