.github/workflows/windows-ov.yml: upgrade to openvino 2024.5.0 #273
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build (Windows-OV) | |
on: | |
push: | |
paths: | |
- 'common/**' | |
- 'vsov/**' | |
- '.github/workflows/windows-ov.yml' | |
workflow_call: | |
inputs: | |
tag: | |
description: 'which tag to upload to' | |
required: true | |
type: string | |
ov_tag: | |
description: 'which tag of openvino to use' | |
required: true | |
default: 'latest' | |
type: string | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'which tag to upload to' | |
default: '' | |
ov_tag: | |
description: 'which tag of openvino to use' | |
required: true | |
default: 'latest' | |
type: string | |
jobs: | |
build-windows: | |
runs-on: windows-2022 | |
defaults: | |
run: | |
shell: cmd | |
working-directory: vsov | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup MSVC | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Setup Ninja | |
run: pip install ninja | |
- name: Cache protobuf | |
id: cache-protobuf | |
uses: actions/cache@v4 | |
with: | |
path: vsov/protobuf/install | |
key: ${{ runner.os }}-vsov-protobuf-v3 | |
- name: Checkout protobuf | |
uses: actions/checkout@v4 | |
if: steps.cache-protobuf.outputs.cache-hit != 'true' | |
with: | |
repository: protocolbuffers/protobuf | |
# follows protobuf in https://github.com/AmusementClub/openvino/tree/master/thirdparty/protobuf | |
# if you change this, remember to bump the version of the cache key. | |
ref: f0dc78d7e6e331b8c6bb2d5283e06aa26883ca7c | |
fetch-depth: 1 | |
path: vsov/protobuf | |
- name: Configure protobuf | |
if: steps.cache-protobuf.outputs.cache-hit != 'true' | |
run: cmake -S protobuf -B protobuf\build_rel -G Ninja -LA | |
-D CMAKE_BUILD_TYPE=Release | |
-D protobuf_BUILD_SHARED_LIBS=OFF -D protobuf_BUILD_TESTS=OFF | |
- name: Build protobuf | |
if: steps.cache-protobuf.outputs.cache-hit != 'true' | |
run: cmake --build protobuf\build_rel --verbose | |
- name: Install protobuf | |
if: steps.cache-protobuf.outputs.cache-hit != 'true' | |
run: cmake --install protobuf\build_rel --prefix protobuf\install | |
- name: Cache onnx | |
id: cache-onnx | |
uses: actions/cache@v4 | |
with: | |
path: vsov/onnx/install | |
key: ${{ runner.os }}-vsov-onnx-v3 | |
- name: Checkout onnx | |
if: steps.cache-onnx.outputs.cache-hit != 'true' | |
uses: actions/checkout@v4 | |
with: | |
repository: onnx/onnx | |
# follows onnx in https://github.com/AmusementClub/openvino/tree/master/thirdparty/onnx | |
# if you change this, remember to bump the version of the cache key. | |
ref: b8baa8446686496da4cc8fda09f2b6fe65c2a02c | |
fetch-depth: 1 | |
path: vsov/onnx | |
- name: Configure onnx | |
if: steps.cache-onnx.outputs.cache-hit != 'true' | |
run: cmake -S onnx -B onnx\build -G Ninja -LA | |
-D CMAKE_BUILD_TYPE=Release | |
-D Protobuf_PROTOC_EXECUTABLE=protobuf\install\bin\protoc | |
-D Protobuf_LITE_LIBRARY=protobuf\install\lib | |
-D Protobuf_LIBRARIES=protobuf\install\lib | |
-D ONNX_USE_LITE_PROTO=ON -D ONNX_USE_PROTOBUF_SHARED_LIBS=OFF | |
-D ONNX_GEN_PB_TYPE_STUBS=OFF -D ONNX_ML=0 | |
-D ONNX_USE_MSVC_STATIC_RUNTIME=1 | |
- name: Build onnx | |
if: steps.cache-onnx.outputs.cache-hit != 'true' | |
run: cmake --build onnx\build --verbose | |
- name: Install onnx | |
if: steps.cache-onnx.outputs.cache-hit != 'true' | |
run: cmake --install onnx\build --prefix onnx\install | |
- name: Download VapourSynth headers | |
run: | | |
curl -s -o vs.zip -L https://github.com/vapoursynth/vapoursynth/archive/refs/tags/R54.zip | |
unzip -q vs.zip | |
mv vapoursynth-*/ vapoursynth/ | |
- name: Download OpenVINO Runtime Precompilation | |
shell: bash | |
run: | | |
# rev="${{github.event.inputs.ov_tag || inputs.ov_tag || 'latest'}}" | |
# if [ "$rev" == "latest" ]; then | |
# url="https://github.com/AmusementClub/openvino/releases/latest/download/openvino-gpu-win64.zip" | |
# else | |
# url="https://github.com/AmusementClub/openvino/releases/download/$rev/openvino-gpu-win64.zip" | |
# fi | |
url="https://github.com/AmusementClub/openvino/releases/download/2020.2-15171-g4655dd6ce3-2058-g5833781ddb/openvino-gpu-win64.zip" | |
curl -s -o openvino.zip -LJO "$url" | |
unzip -q openvino.zip | |
- name: Configure | |
run: cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=Release | |
-D CMAKE_INTERPROCEDURAL_OPTIMIZATION=ON | |
-D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded | |
-D OpenVINO_DIR=openvino/runtime/cmake | |
-D VAPOURSYNTH_INCLUDE_DIRECTORY="%cd%\vapoursynth\include" | |
-D ENABLE_VISUALIZATION=ON | |
-D WIN32_SHARED_OPENVINO=ON | |
-D protobuf_DIR=protobuf\install\cmake | |
-D ONNX_DIR=onnx\install\lib\cmake\ONNX | |
- name: Build | |
run: cmake --build build --verbose | |
- name: Install | |
run: | | |
cmake --install build --prefix install | |
mkdir artifact | |
mkdir artifact\vsov | |
copy openvino\runtime\3rdparty\tbb\bin\tbb12.dll artifact\vsov\ | |
copy install\bin\vsov.dll artifact\ | |
xcopy openvino\runtime\bin\intel64\Release\* artifact\vsov\ /s | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: VSOV-Windows-x64 | |
path: vsov/artifact | |
- name: Setup Python portable | |
run: | | |
curl -s -o python.zip -LJO https://www.python.org/ftp/python/3.9.9/python-3.9.9-embed-amd64.zip | |
7z x python.zip -ovs_portable | |
- name: Install VapourSynth portable | |
run: | | |
curl -s -o vs.7z -LJO https://github.com/vapoursynth/vapoursynth/releases/download/R54/VapourSynth64-Portable-R54.7z | |
7z x vs.7z -ovs_portable -y | |
- name: Copy plugin | |
run: | | |
copy artifact\*.dll vs_portable\vapoursynth64\plugins | |
mkdir vs_portable\vapoursynth64\plugins\vsov\ | |
copy artifact\vsov\* vs_portable\vapoursynth64\plugins\vsov\ | |
- name: Install waifu2x model | |
run: | | |
curl -s -o waifu2x.7z -LJO https://github.com/AmusementClub/vs-mlrt/releases/download/model-20211209/waifu2x_v3.7z | |
7z x waifu2x.7z -ovs_portable\vapoursynth64\plugins\models | |
- name: Download x265 | |
run: | | |
curl -s -o x265.7z -LJO https://github.com/AmusementClub/x265/releases/download/Yuuki-3.5-AC3/x265-win64-x86-64-clang.Yuuki-3.5-AC3.7z | |
7z x x265.7z -ovs_portable\ | |
- name: Create script | |
shell: bash | |
run: echo "import vapoursynth as vs;from vapoursynth import core;import sys;print(core.ov, file=sys.stderr);core.std.BlankClip(format=vs.RGBS).ov.Model(r\"waifu2x\\upconv_7_anime_style_art_rgb\\scale2.0x_model.onnx\", builtin=True).resize.Bicubic(format=vs.YUV420P10, matrix_s='709').set_output()" > test.vpy | |
- name: Run vspipe | |
shell: bash | |
run: | | |
set -ex | |
vs_portable/vspipe -i test.vpy - | |
vs_portable/vspipe --y4m -p -e 9 test.vpy - | vs_portable/x265 --log-file x265.log --log-file-level info --y4m -D 10 --preset ultrafast -o out.hevc - | |
ls -l out.hevc x265.log | |
cat x265.log | |
grep -F 'encoded 10 frames' x265.log || exit 2 | |
grep -i 'error' x265.log && exit 1 | |
exit 0 | |
- name: Create script (fp16) | |
shell: bash | |
run: echo "import vapoursynth as vs;from vapoursynth import core;import sys;print(core.ov, file=sys.stderr);core.std.BlankClip(format=vs.RGBS).ov.Model(r\"waifu2x\\upconv_7_anime_style_art_rgb\\scale2.0x_model.onnx\", builtin=True, fp16=True).resize.Bicubic(format=vs.YUV420P10, matrix_s='709').set_output()" > test_fp16.vpy | |
- name: Run vspipe (fp16) | |
shell: bash | |
run: | | |
set -ex | |
vs_portable/vspipe -i test_fp16.vpy - | |
vs_portable/vspipe --y4m -p -e 9 test_fp16.vpy - | vs_portable/x265 --log-file x265.log --log-file-level info --y4m -D 10 --preset ultrafast -o out.hevc - | |
ls -l out.hevc x265.log | |
cat x265.log | |
grep -F 'encoded 10 frames' x265.log || exit 2 | |
grep -i 'error' x265.log && exit 1 | |
exit 0 | |
- name: Create script (flexible output) | |
shell: bash | |
run: echo "import vapoursynth as vs;from vapoursynth import core;import sys;print(core.ov, file=sys.stderr);prop=\"test\";output=core.std.BlankClip(format=vs.RGBS).ov.Model(r\"waifu2x\\upconv_7_anime_style_art_rgb\\scale2.0x_model.onnx\", builtin=True, flexible_output_prop=prop);core.std.ShufflePlanes([output[\"clip\"].std.PropToClip(prop=f\"{prop}{i}\") for i in range(output[\"num_planes\"])], [0, 0, 0], vs.RGB).resize.Bicubic(format=vs.YUV420P10, matrix_s='709').set_output()" > test_flexible_output.vpy | |
- name: Run vspipe (flexible output) | |
shell: bash | |
run: | | |
set -ex | |
vs_portable/vspipe -i test_flexible_output.vpy - | |
vs_portable/vspipe --y4m -p -e 9 test_flexible_output.vpy - | vs_portable/x265 --log-file x265.log --log-file-level info --y4m -D 10 --preset ultrafast -o out.hevc - | |
ls -l out.hevc x265.log | |
cat x265.log | |
grep -F 'encoded 10 frames' x265.log || exit 2 | |
grep -i 'error' x265.log && exit 1 | |
exit 0 | |
- name: Describe | |
run: git describe --tags --long | |
- name: Dump dependencies | |
run: dumpbin /dependents artifact\vsov.dll | |
- name: Compress artifact for release | |
if: github.event_name == 'workflow_dispatch' && github.event.inputs.tag != '' | |
run: | | |
cd artifact | |
7z a -t7z -mx=7 ../../VSOV-Windows-x64.${{ github.event.inputs.tag }}.7z . | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: github.event_name == 'workflow_dispatch' && github.event.inputs.tag != '' | |
with: | |
tag_name: ${{ inputs.tag }} | |
files: VSOV-Windows-x64.${{ github.event.inputs.tag }}.7z | |
fail_on_unmatched_files: true | |
generate_release_notes: false | |
prerelease: true |