Skip to content

Commit

Permalink
Update code for support Linux & update sample code & docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhanwei Wu committed Dec 20, 2024
1 parent 0eedadf commit 60ee370
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions pybind/AppBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,17 @@ PYBIND11_MODULE(appbuilder, m) {
m.attr("__license__") = "BSD-3-Clause";

m.def("model_initialize", &initialize, "Initialize models.");
#ifdef _WIN32
m.def("model_initialize", &initialize_P, "Initialize models.");
#endif
m.def("model_inference", &inference, "Inference models.");
#ifdef _WIN32
m.def("model_inference", &inference_P, "Inference models.");
#endif
m.def("model_destroy", &destroy, "Destroy models.");
#ifdef _WIN32
m.def("model_destroy", &destroy_P, "Destroy models.");
#endif
m.def("memory_create", &create_memory, "Create share memory.");
m.def("memory_delete", &delete_memory, "Delete share memory.");
m.def("set_log_level", &set_log_level, "Set QNN log level.");
Expand Down
4 changes: 2 additions & 2 deletions samples/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ python stable_diffusion_v2_1\stable_diffusion_v2_1.py --prompt "spectacular view

| Model | QNN SDK Version | Command |
| ---- | :----: | ---- |
| stable_diffusion_v1_5 | 2.24 | python stable_diffusion_v2_1\stable_diffusion_v2_1.py --prompt "the prompt string ..." |
| stable_diffusion_v2_1 | 2.24 | python stable_diffusion_v1_5\stable_diffusion_v1_5.py --prompt "the prompt string ..." |
| stable_diffusion_v2_1 | 2.24 | python stable_diffusion_v2_1\stable_diffusion_v2_1.py --prompt "the prompt string ..." |
| stable_diffusion_v1_5 | 2.24 | python stable_diffusion_v1_5\stable_diffusion_v1_5.py --prompt "the prompt string ..." |
| riffusion | 2.24 | python riffusion\riffusion.py --prompt "the prompt string ..." |
| real_esrgan_x4plus | 2.28 | python real_esrgan_x4plus\real_esrgan_x4plus.py |
| real_esrgan_general_x4v3 | 2.28 | python real_esrgan_general_x4v3\real_esrgan_general_x4v3.py |
Expand Down
Binary file added samples/python/real_esrgan_general_x4v3/input.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed samples/python/real_esrgan_general_x4v3/input.png
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def Release():

Init()

Inference(execution_ws + "\\input.png", execution_ws + "\\output.png")
Inference(execution_ws + "\\input.jpg", execution_ws + "\\output.jpg")

Release()

Binary file added samples/python/real_esrgan_x4plus/input.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed samples/python/real_esrgan_x4plus/input.png
Binary file not shown.
2 changes: 1 addition & 1 deletion samples/python/real_esrgan_x4plus/real_esrgan_x4plus.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def Release():

Init()

Inference(execution_ws + "\\input.png", execution_ws + "\\output.png")
Inference(execution_ws + "\\input.jpg", execution_ws + "\\output.jpg")

Release()

2 changes: 2 additions & 0 deletions src/Utils/DataUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
#include <iostream>
#include <numeric>
#include <queue>
#ifdef _WIN32
#include <intrin.h>
#endif
#include "DataUtil.hpp"
#include "Logger.hpp"
#ifndef __hexagon__
Expand Down

0 comments on commit 60ee370

Please sign in to comment.