Skip to content

Commit c511ad6

Browse files
committed
add readmes, update to use model.onnx
1 parent f265cf3 commit c511ad6

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

mobile/examples/model_tester/common/model_runner.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,19 +211,16 @@ RunResult Run(const RunConfig& run_config) {
211211
return run_result;
212212
}
213213

214-
std::string GetRunSummary(const RunConfig& run_config, const RunResult& run_result) {
214+
std::string GetRunSummary(const RunConfig& /*run_config*/, const RunResult& run_result) {
215215
auto to_display_duration = []<typename Rep, typename Period>(std::chrono::duration<Rep, Period> d) {
216216
using DisplayPeriod = std::chrono::microseconds::period;
217217
using DisplayDuration = std::chrono::duration<Rep, DisplayPeriod>;
218218
return std::chrono::duration_cast<DisplayDuration>(d);
219219
};
220220

221-
const auto model_path = std::filesystem::path{run_config.model_path};
222-
223221
const auto stats = ComputeRunResultStats(run_result);
224222

225223
const auto summary = std::format(
226-
"Model: {}\n"
227224
"Load time: {}\n"
228225
"N (number of runs): {}\n"
229226
"Latency\n"
@@ -233,7 +230,6 @@ std::string GetRunSummary(const RunConfig& run_config, const RunResult& run_resu
233230
" p99: {}\n"
234231
" min: {}\n"
235232
" max: {}\n",
236-
model_path.filename().string(),
237233
to_display_duration(run_result.load_duration),
238234
stats.n,
239235
to_display_duration(stats.average),

mobile/examples/model_tester/ios/ModelTester/ModelTester.xcodeproj/project.pbxproj

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
/* Begin PBXBuildFile section */
1010
2E163DAB2DCBE38900B4ED4A /* model_runner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E163DAA2DCBE38900B4ED4A /* model_runner.cpp */; };
1111
2E163DD22DCBEC9F00B4ED4A /* model_runner_objc_wrapper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E163DD12DCBEC9200B4ED4A /* model_runner_objc_wrapper.mm */; };
12-
2E163DD82DCC23E500B4ED4A /* ssd_mobilenet_v1.onnx in Resources */ = {isa = PBXBuildFile; fileRef = 2E163DD62DCC23E500B4ED4A /* ssd_mobilenet_v1.onnx */; };
13-
2E163DDA2DCC3DC600B4ED4A /* mobilenetv2-12.onnx in Resources */ = {isa = PBXBuildFile; fileRef = 2E163DD92DCC3DC600B4ED4A /* mobilenetv2-12.onnx */; };
12+
2E5D16F52DCD83DE0097F05B /* model.onnx in Resources */ = {isa = PBXBuildFile; fileRef = 2E5D16F42DCD83DE0097F05B /* model.onnx */; };
1413
/* End PBXBuildFile section */
1514

1615
/* Begin PBXContainerItemProxy section */
@@ -39,8 +38,7 @@
3938
2E163DCF2DCBE98F00B4ED4A /* ModelTester-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ModelTester-Bridging-Header.h"; sourceTree = "<group>"; };
4039
2E163DD02DCBEB0900B4ED4A /* model_runner_objc_wrapper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = model_runner_objc_wrapper.h; sourceTree = "<group>"; };
4140
2E163DD12DCBEC9200B4ED4A /* model_runner_objc_wrapper.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = model_runner_objc_wrapper.mm; sourceTree = "<group>"; };
42-
2E163DD62DCC23E500B4ED4A /* ssd_mobilenet_v1.onnx */ = {isa = PBXFileReference; lastKnownFileType = file; path = ssd_mobilenet_v1.onnx; sourceTree = "<group>"; };
43-
2E163DD92DCC3DC600B4ED4A /* mobilenetv2-12.onnx */ = {isa = PBXFileReference; lastKnownFileType = file; path = "mobilenetv2-12.onnx"; sourceTree = "<group>"; };
41+
2E5D16F42DCD83DE0097F05B /* model.onnx */ = {isa = PBXFileReference; lastKnownFileType = file; path = model.onnx; sourceTree = "<group>"; };
4442
/* End PBXFileReference section */
4543

4644
/* Begin PBXFileSystemSynchronizedRootGroup section */
@@ -130,8 +128,7 @@
130128
2E163DD72DCC23E500B4ED4A /* model */ = {
131129
isa = PBXGroup;
132130
children = (
133-
2E163DD92DCC3DC600B4ED4A /* mobilenetv2-12.onnx */,
134-
2E163DD62DCC23E500B4ED4A /* ssd_mobilenet_v1.onnx */,
131+
2E5D16F42DCD83DE0097F05B /* model.onnx */,
135132
);
136133
path = model;
137134
sourceTree = "<group>";
@@ -258,8 +255,7 @@
258255
isa = PBXResourcesBuildPhase;
259256
buildActionMask = 2147483647;
260257
files = (
261-
2E163DD82DCC23E500B4ED4A /* ssd_mobilenet_v1.onnx in Resources */,
262-
2E163DDA2DCC3DC600B4ED4A /* mobilenetv2-12.onnx in Resources */,
258+
2E5D16F52DCD83DE0097F05B /* model.onnx in Resources */,
263259
);
264260
runOnlyForDeploymentPostprocessing = 0;
265261
};

mobile/examples/model_tester/ios/ModelTester/ModelTester/ContentView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ struct ContentView: View {
1515
DispatchQueue.global().async {
1616
var output: String
1717
do {
18-
guard let modelPath = Bundle.main.path(forResource: "mobilenetv2-12", ofType: "onnx") else {
18+
guard let modelPath = Bundle.main.path(forResource: "model", ofType: "onnx") else {
1919
throw ModelTesterError.runtimeError(msg: "Failed to find model file path.")
2020
}
2121

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add a model here and name it model.onnx.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
This directory contains example code for apps that can be used to run a model with onnxruntime. They can be used for basic performance testing.
2+
3+
- `common/` contains common, cross-platform, code.
4+
- `ios/` contains an example iOS app.
5+

0 commit comments

Comments
 (0)