Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mobile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ The [Xamarin.Forms](https://dotnet.microsoft.com/apps/xamarin/xamarin-forms) exa
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.

- [Android Super Resolution](examples/super_resolution/android)
- [iOS Super Resolution](examples/speech_recognition/ios)
- [iOS Super Resolution](examples/super_resolution/ios)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot!

Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
objects = {

/* Begin PBXBuildFile section */
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 */; };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this file be under source control?

Copy link
Contributor Author

@YUNQIUGUO YUNQIUGUO Feb 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the older opset16 version model, do we still want to keep that model in the project?

also fyi .pbxproj file updates are auto-generated after updating the ios app.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer we only have the opset 18 model given that will have significantly better output.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also fyi .pbxproj file updates are auto-generated after updating the ios app.

That's why I wondered the pbxporj file should be under version control? If it gets re-generated. Not a biggie

510A53E8296FE46F000DB268 /* cat_224x224.png in Resources */ = {isa = PBXBuildFile; fileRef = 510A53E7296FE46F000DB268 /* cat_224x224.png */; };
5130D9BC2968B93A009B4B88 /* ORTSuperResolutionApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5130D9BB2968B93A009B4B88 /* ORTSuperResolutionApp.swift */; };
5130D9BE2968B93A009B4B88 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5130D9BD2968B93A009B4B88 /* ContentView.swift */; };
5130D9C02968B93C009B4B88 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5130D9BF2968B93C009B4B88 /* Assets.xcassets */; };
5130D9C32968B93C009B4B88 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5130D9C22968B93C009B4B88 /* Preview Assets.xcassets */; };
5197BEA129A0492D004B83DE /* pytorch_superresolution_with_pre_post_processing_opset18.onnx in Resources */ = {isa = PBXBuildFile; fileRef = 5197BEA029A0492D004B83DE /* pytorch_superresolution_with_pre_post_processing_opset18.onnx */; };
5197BEA229A0492D004B83DE /* pytorch_superresolution_with_pre_post_processing_opset18.onnx in Resources */ = {isa = PBXBuildFile; fileRef = 5197BEA029A0492D004B83DE /* pytorch_superresolution_with_pre_post_processing_opset18.onnx */; };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are there two entries here for pytorch_superresolution_with_pre_post_processing_opset18.onnx? was it added twice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are there two entries here for pytorch_superresolution_with_pre_post_processing_opset18.onnx? was it added twice?

I think one is for ORTSuperResolution and one is for ORTSuperResolutionTest. I added the model to both targets.

51AB38AF2981FA5E004E33B0 /* ORTSuperResolutionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51AB38AE2981FA5E004E33B0 /* ORTSuperResolutionTests.swift */; };
51D5968B2968DE9900F1CD43 /* ORTSuperResolutionPerformer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51D5968A2968DE9900F1CD43 /* ORTSuperResolutionPerformer.mm */; };
/* End PBXBuildFile section */
Expand All @@ -28,13 +29,13 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
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>"; };
510A53E7296FE46F000DB268 /* cat_224x224.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cat_224x224.png; sourceTree = "<group>"; };
5130D9B82968B93A009B4B88 /* ORTSuperResolution.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ORTSuperResolution.app; sourceTree = BUILT_PRODUCTS_DIR; };
5130D9BB2968B93A009B4B88 /* ORTSuperResolutionApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ORTSuperResolutionApp.swift; sourceTree = "<group>"; };
5130D9BD2968B93A009B4B88 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
5130D9BF2968B93C009B4B88 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
5130D9C22968B93C009B4B88 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
5197BEA029A0492D004B83DE /* pytorch_superresolution_with_pre_post_processing_opset18.onnx */ = {isa = PBXFileReference; lastKnownFileType = file; path = pytorch_superresolution_with_pre_post_processing_opset18.onnx; sourceTree = "<group>"; };
51AB38AC2981FA5E004E33B0 /* ORTSuperResolutionTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ORTSuperResolutionTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
51AB38AE2981FA5E004E33B0 /* ORTSuperResolutionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ORTSuperResolutionTests.swift; sourceTree = "<group>"; };
51D596892968DE9900F1CD43 /* ORTSuperResolutionPerformer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORTSuperResolutionPerformer.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -82,8 +83,8 @@
5130D9BA2968B93A009B4B88 /* ORTSuperResolution */ = {
isa = PBXGroup;
children = (
510A53D5296DE390000DB268 /* pt_super_resolution_with_pre_post_processing_opset16.onnx */,
510A53E7296FE46F000DB268 /* cat_224x224.png */,
5197BEA029A0492D004B83DE /* pytorch_superresolution_with_pre_post_processing_opset18.onnx */,
51D5968A2968DE9900F1CD43 /* ORTSuperResolutionPerformer.mm */,
51D596892968DE9900F1CD43 /* ORTSuperResolutionPerformer.h */,
5130D9BB2968B93A009B4B88 /* ORTSuperResolutionApp.swift */,
Expand Down Expand Up @@ -200,17 +201,18 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
510A53D6296DE390000DB268 /* pt_super_resolution_with_pre_post_processing_opset16.onnx in Resources */,
5130D9C32968B93C009B4B88 /* Preview Assets.xcassets in Resources */,
5130D9C02968B93C009B4B88 /* Assets.xcassets in Resources */,
510A53E8296FE46F000DB268 /* cat_224x224.png in Resources */,
5197BEA129A0492D004B83DE /* pytorch_superresolution_with_pre_post_processing_opset18.onnx in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
51AB38AA2981FA5E004E33B0 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
5197BEA229A0492D004B83DE /* pytorch_superresolution_with_pre_post_processing_opset18.onnx in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,21 @@ struct ContentView: View {
.border(Color.purple, width: 4)
.background(Color.purple)

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

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

Button("Perform Super Resolution") {
performSuperRes.toggle()
}

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

if let outputImage = runOrtSuperResolution() {
Image(uiImage: outputImage)
Image(uiImage: outputImage).resizable()
.aspectRatio(1, contentMode: .fit).frame(width: 250, height: 250)

} else {
Text("Unable to perform super resolution. ").frame(width: 350, height: 40, alignment:.leading)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ + (nullable UIImage*)performSuperResolutionWithError:(NSError **)error {

// Step 1: Load model

NSString *model_path = [NSBundle.mainBundle pathForResource:@"pt_super_resolution_with_pre_post_processing_opset16"
NSString *model_path = [NSBundle.mainBundle pathForResource:@"pytorch_superresolution_with_pre_post_processing_opset18"
ofType:@"onnx"];
if (model_path == nullptr) {
throw std::runtime_error("Failed to get model path");
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ target 'ORTSuperResolution' do
# Pods for OrtSuperResolution
pod 'onnxruntime-c'

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

end

Expand Down
3 changes: 1 addition & 2 deletions mobile/examples/super_resolution/ios/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ The model used here is from source: [Pytorch Super Resolution](https://pytorch.o
#
Here's an example screenshot of the app:

<img width=25% src="images/Screenshot1.png" alt="App Screenshot" />
<img width=25% src="images/Screenshot2.png" alt="App Screenshot" />
<img width=25% src="images/Sample_Screenshot_1.png" alt="App Screenshot" />
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.