From 608ec835f869477ed6df71af07d18a4351a7fe03 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 11:53:40 +0100 Subject: [PATCH 01/45] added gitignore file --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eba74f4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +venv/ \ No newline at end of file From 0afe5ade7e687050c152925b88201d4334d53974 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 11:59:40 +0100 Subject: [PATCH 02/45] added initial build file --- .github/workflows/build.yml | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..211d281 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,48 @@ +name: Build + +on: + push: + branches: [ master workflow ] + pull_request: + branches: [ master workflow ] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-18.04 + TARGET: ubuntu + CMD_BUILD: pip install git+https://github.com/andreped/SimpleCRF.git + + - os: macos-10.15 + TARGET: macos + CMD_BUILD: pip install git+https://github.com/andreped/SimpleCRF.git + + - os: windows-2019 + TARGET: windows + CMD_BUILD: pip install git+https://github.com/andreped/SimpleCRF.git + + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Install dependencies + run: pip install wheel setuptools + + - name: Build wheel + run: python setup.py bdist_wheel --universal + + - name: Install program for ${{matrix.TARGET}} + run: ${{matrix.CMD_BUILD}} + + - name: Upload Python wheel + uses: actions/upload-artifact@v2 + with: + name: Python wheel + path: ${{github.workspace}}/dist/SimpleCRF-*.whl + if-no-files-found: error \ No newline at end of file From a357837d623bfe6dabbce8bb24f340c1c77ca179 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 12:02:56 +0100 Subject: [PATCH 03/45] accept all branches for push and PR --- .github/workflows/build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 211d281..a600985 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,9 +2,13 @@ name: Build on: push: - branches: [ master workflow ] + branches: + - '*' + #[ master workflow ] pull_request: - branches: [ master workflow ] + branches: + - '*' + #[ master workflow ] jobs: build: From c62de3ff4f8fa7c5c84e0da6ebb0c1b52ee9c4cc Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 12:04:36 +0100 Subject: [PATCH 04/45] forgot numpy dependency --- .github/workflows/build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a600985..43946a8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,11 @@ jobs: python-version: 3.7 - name: Install dependencies - run: pip install wheel setuptools + run: | + pip install wheel setuptools + ls -la + pip install requirements.txt + - name: Build wheel run: python setup.py bdist_wheel --universal @@ -49,4 +53,4 @@ jobs: with: name: Python wheel path: ${{github.workspace}}/dist/SimpleCRF-*.whl - if-no-files-found: error \ No newline at end of file + if-no-files-found: error From 2445d81a3c571c1ff1c605d3f13c573d8309ebaa Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 12:06:09 +0100 Subject: [PATCH 05/45] forgot '-r' --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 43946a8..9a20310 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: run: | pip install wheel setuptools ls -la - pip install requirements.txt + pip install -r requirements.txt - name: Build wheel From 6f653077bc6f51fb15eb0bca92d7e7a4a11ca8d6 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 12:07:25 +0100 Subject: [PATCH 06/45] removed ls prompt --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9a20310..7f0da03 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,7 +38,6 @@ jobs: - name: Install dependencies run: | pip install wheel setuptools - ls -la pip install -r requirements.txt From fcafd3d257a9d6272d3d286fd8d82fcfd232bd52 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 12:13:38 +0100 Subject: [PATCH 07/45] build works. Install from wheel instead --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7f0da03..bdfef72 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,11 @@ jobs: run: python setup.py bdist_wheel --universal - name: Install program for ${{matrix.TARGET}} - run: ${{matrix.CMD_BUILD}} + run: | + ls + ls dist/ + pip install ${{github.workspace}}/dist/SimpleCRF-*.whl + #${{matrix.CMD_BUILD}} - name: Upload Python wheel uses: actions/upload-artifact@v2 From 18fec3cf0a0c2d9b0e8bccfeaa8ae48e3334f1b5 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 12:22:00 +0100 Subject: [PATCH 08/45] wildcard have to be handled differently on windows. Added potential fix --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bdfef72..b933ffa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,8 @@ jobs: run: | ls ls dist/ - pip install ${{github.workspace}}/dist/SimpleCRF-*.whl + pip install --find-links=${{github.workspace}}/dist/ SimpleCRF + #${{github.workspace}}/dist/SimpleCRF-*.whl #${{matrix.CMD_BUILD}} - name: Upload Python wheel From ba2671a1b54b5d94bab8636d06f57c36fc58db00 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 12:28:56 +0100 Subject: [PATCH 09/45] Build works for all OSs. Added demo tests in the build --- .github/workflows/build.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b933ffa..bc7a6c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,17 +40,20 @@ jobs: pip install wheel setuptools pip install -r requirements.txt - - name: Build wheel run: python setup.py bdist_wheel --universal - name: Install program for ${{matrix.TARGET}} - run: | - ls - ls dist/ - pip install --find-links=${{github.workspace}}/dist/ SimpleCRF - #${{github.workspace}}/dist/SimpleCRF-*.whl - #${{matrix.CMD_BUILD}} + run: pip install --find-links=${{github.workspace}}/dist/ SimpleCRF + + - name: Run maxflow demo + run: python ${{github.workspace}}/examples/demo_maxflow.py + + - name: Run densecrf demo + run: python ${{github.workspace}}/examples/demo_densecrf.py + + - name: Run densecrf3d demo + run: ${{github.workspace}}/examples/demo_densecrf3d.py - name: Upload Python wheel uses: actions/upload-artifact@v2 From a2f1efb6724031a63df1d9b042b8308baf843232 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 12:35:13 +0100 Subject: [PATCH 10/45] Added install of deps for maxflow demo, and disabled the two other demos for now --- .github/workflows/build.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bc7a6c9..a345d47 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,14 +46,16 @@ jobs: - name: Install program for ${{matrix.TARGET}} run: pip install --find-links=${{github.workspace}}/dist/ SimpleCRF - - name: Run maxflow demo - run: python ${{github.workspace}}/examples/demo_maxflow.py + - name: Run maxflow demo (and install deps) + run: | + pip install SimpleITK pillow matplotlib + python ${{github.workspace}}/examples/demo_maxflow.py - - name: Run densecrf demo - run: python ${{github.workspace}}/examples/demo_densecrf.py + #- name: Run densecrf demo + # run: python ${{github.workspace}}/examples/demo_densecrf.py - - name: Run densecrf3d demo - run: ${{github.workspace}}/examples/demo_densecrf3d.py + #- name: Run densecrf3d demo + # run: ${{github.workspace}}/examples/demo_densecrf3d.py - name: Upload Python wheel uses: actions/upload-artifact@v2 From 701108b1c2384c20ba231ca25d833c2e218e516d Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 12:45:55 +0100 Subject: [PATCH 11/45] modified maxflow example to use argv instead --- examples/demo_maxflow.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/demo_maxflow.py b/examples/demo_maxflow.py index 2a02928..a9d9170 100755 --- a/examples/demo_maxflow.py +++ b/examples/demo_maxflow.py @@ -4,6 +4,7 @@ import maxflow from PIL import Image import matplotlib.pyplot as plt +import sys def maxflow2d(I, P, param): """ @@ -189,8 +190,9 @@ def test_interactive_max_flow3d(): print(" 2 -- 3D max flow without interactions") print(" 3 -- 3D max flow with interactions") print("please enter the index of an example:") - method = input() - method = "{0:}".format(method) + #method = input() + #method = "{0:}".format(method) + method = sys.argv[1] if(method == '0'): demo_maxflow() elif(method == '1'): @@ -200,4 +202,4 @@ def test_interactive_max_flow3d(): elif(method == '3'): test_interactive_max_flow3d() else: - print("invalid number : {0:}".format(method)) + print("invalid number : method") From 0ee36d9d15987c821c8848ff3dd6f4bd6f24029d Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 12:46:19 +0100 Subject: [PATCH 12/45] added argv to demo run in build --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a345d47..1a2191f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: - name: Run maxflow demo (and install deps) run: | pip install SimpleITK pillow matplotlib - python ${{github.workspace}}/examples/demo_maxflow.py + python ${{github.workspace}}/examples/demo_maxflow.py 1 #- name: Run densecrf demo # run: python ${{github.workspace}}/examples/demo_densecrf.py From eadf1064104f70f3ebf1c392595ba229426f425c Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 12:50:42 +0100 Subject: [PATCH 13/45] used 'cd' before running program --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a2191f..7c40472 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: - name: Run maxflow demo (and install deps) run: | pip install SimpleITK pillow matplotlib - python ${{github.workspace}}/examples/demo_maxflow.py 1 + cd ${{github.workspace}}/examples && python demo_maxflow.py 1 #- name: Run densecrf demo # run: python ${{github.workspace}}/examples/demo_densecrf.py From 12733a010959899aed555d36ac5ec7a5e6fb8002 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 12:58:06 +0100 Subject: [PATCH 14/45] maxflow script successfully runs on the cloud. Added more tests using the same demo --- .github/workflows/build.yml | 3 +++ examples/demo_maxflow.py | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7c40472..4f24cb6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,6 +50,9 @@ jobs: run: | pip install SimpleITK pillow matplotlib cd ${{github.workspace}}/examples && python demo_maxflow.py 1 + cd ${{github.workspace}}/examples && python demo_maxflow.py 2 + cd ${{github.workspace}}/examples && python demo_maxflow.py 3 + cd ${{github.workspace}}/examples && python demo_maxflow.py 4 #- name: Run densecrf demo # run: python ${{github.workspace}}/examples/demo_densecrf.py diff --git a/examples/demo_maxflow.py b/examples/demo_maxflow.py index a9d9170..bd1feec 100755 --- a/examples/demo_maxflow.py +++ b/examples/demo_maxflow.py @@ -189,9 +189,10 @@ def test_interactive_max_flow3d(): print(" 1 -- 2D max flow with interactions") print(" 2 -- 3D max flow without interactions") print(" 3 -- 3D max flow with interactions") - print("please enter the index of an example:") - #method = input() - #method = "{0:}".format(method) + + if len(sys.argv) == 1: + raise ValueError("Please, provide an argument.") + method = sys.argv[1] if(method == '0'): demo_maxflow() @@ -202,4 +203,4 @@ def test_interactive_max_flow3d(): elif(method == '3'): test_interactive_max_flow3d() else: - print("invalid number : method") + raise ValueError("Invalid number:" + method) From c046824aa242f981cddf37e9c4739c522cf5516e Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 13:01:51 +0100 Subject: [PATCH 15/45] off by one --- .github/workflows/build.yml | 2 +- examples/demo_maxflow.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4f24cb6..5b51acf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,10 +49,10 @@ jobs: - name: Run maxflow demo (and install deps) run: | pip install SimpleITK pillow matplotlib + cd ${{github.workspace}}/examples && python demo_maxflow.py 0 cd ${{github.workspace}}/examples && python demo_maxflow.py 1 cd ${{github.workspace}}/examples && python demo_maxflow.py 2 cd ${{github.workspace}}/examples && python demo_maxflow.py 3 - cd ${{github.workspace}}/examples && python demo_maxflow.py 4 #- name: Run densecrf demo # run: python ${{github.workspace}}/examples/demo_densecrf.py diff --git a/examples/demo_maxflow.py b/examples/demo_maxflow.py index bd1feec..0c0fcaa 100755 --- a/examples/demo_maxflow.py +++ b/examples/demo_maxflow.py @@ -192,7 +192,7 @@ def test_interactive_max_flow3d(): if len(sys.argv) == 1: raise ValueError("Please, provide an argument.") - + method = sys.argv[1] if(method == '0'): demo_maxflow() @@ -203,4 +203,4 @@ def test_interactive_max_flow3d(): elif(method == '3'): test_interactive_max_flow3d() else: - raise ValueError("Invalid number:" + method) + raise ValueError("Invalid number: " + method) From 001d529177187e3fd8f9732b19813071df687ab6 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 13:10:42 +0100 Subject: [PATCH 16/45] build works - at least on ubuntu. Added the same argv solution for the two other demos. Also did some minor refactoring. --- .github/workflows/build.yml | 6 ------ examples/demo_densecrf.py | 9 +++++---- examples/demo_densecrf3d.py | 9 +++++---- examples/demo_maxflow.py | 3 --- 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5b51acf..f45ae00 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,12 +54,6 @@ jobs: cd ${{github.workspace}}/examples && python demo_maxflow.py 2 cd ${{github.workspace}}/examples && python demo_maxflow.py 3 - #- name: Run densecrf demo - # run: python ${{github.workspace}}/examples/demo_densecrf.py - - #- name: Run densecrf3d demo - # run: ${{github.workspace}}/examples/demo_densecrf3d.py - - name: Upload Python wheel uses: actions/upload-artifact@v2 with: diff --git a/examples/demo_densecrf.py b/examples/demo_densecrf.py index fd60ff9..0ff03ba 100755 --- a/examples/demo_densecrf.py +++ b/examples/demo_densecrf.py @@ -2,6 +2,7 @@ import numpy as np from PIL import Image import matplotlib.pyplot as plt +import sys def densecrf(I, P, param): """ @@ -108,12 +109,12 @@ def demo_densecrf2(): print("example list") print(" 0 -- Dense CRF example for a binary segmentation") print(" 1 -- Dense CRF example for a multi-class segmentation") - print("please enter the index of an example:") - method = input() - method = "{0:}".format(method) + if len(sys.argv) == 1: + raise ValueError("Please, provide an argument.") + method = sys.argv[1] if(method == '0'): demo_densecrf1() elif(method == '1'): demo_densecrf2() else: - print("invalid number : {0:}".format(method)) \ No newline at end of file + raise ValueError("Invalid number: " + method) diff --git a/examples/demo_densecrf3d.py b/examples/demo_densecrf3d.py index fd8fa5a..aabe005 100755 --- a/examples/demo_densecrf3d.py +++ b/examples/demo_densecrf3d.py @@ -3,6 +3,7 @@ import numpy as np from PIL import Image import matplotlib.pyplot as plt +import sys def densecrf3d(I, P, param): """ @@ -91,14 +92,14 @@ def demo_densecrf3d_2(): print("example list") print(" 0 -- 3D Dense CRF example for single-modal segmentation") print(" 1 -- 3D Dense CRF example for multi-modal segmentation") - print("please enter the index of an example:") - method = input() - method = "{0:}".format(method) + if len(sys.argv) == 1: + raise ValueError("Please, provide an argument.") + method = sys.argv[1] if(method == '0'): demo_densecrf3d_1() elif(method == '1'): demo_densecrf3d_2() else: - print("invalid number : {0:}".format(method)) + raise ValueError("Invalid number: " + method) diff --git a/examples/demo_maxflow.py b/examples/demo_maxflow.py index 0c0fcaa..58b34ce 100755 --- a/examples/demo_maxflow.py +++ b/examples/demo_maxflow.py @@ -1,4 +1,3 @@ - import numpy as np import SimpleITK as sitk import maxflow @@ -189,10 +188,8 @@ def test_interactive_max_flow3d(): print(" 1 -- 2D max flow with interactions") print(" 2 -- 3D max flow without interactions") print(" 3 -- 3D max flow with interactions") - if len(sys.argv) == 1: raise ValueError("Please, provide an argument.") - method = sys.argv[1] if(method == '0'): demo_maxflow() From e1fe454dfad0040f1485b3fa26463f149868d575 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 13:11:55 +0100 Subject: [PATCH 17/45] simple test to see how G-A works with matrix --- .github/workflows/build.yml | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f45ae00..b696be6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,30 +4,15 @@ on: push: branches: - '*' - #[ master workflow ] pull_request: branches: - '*' - #[ master workflow ] jobs: build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - include: - - os: ubuntu-18.04 - TARGET: ubuntu - CMD_BUILD: pip install git+https://github.com/andreped/SimpleCRF.git - - - os: macos-10.15 - TARGET: macos - CMD_BUILD: pip install git+https://github.com/andreped/SimpleCRF.git - - - os: windows-2019 - TARGET: windows - CMD_BUILD: pip install git+https://github.com/andreped/SimpleCRF.git - + runs-on: + ${{ matrix.os }} + steps: - uses: actions/checkout@v1 - name: Set up Python 3.7 From a7da841b01720d22ce6aa8d76e83b03f24b3dc9b Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 13:12:55 +0100 Subject: [PATCH 18/45] typo --- .github/workflows/build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b696be6..7f2766f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,9 +10,8 @@ on: jobs: build: - runs-on: - ${{ matrix.os }} - + runs-on: ${{ matrix.os }} + steps: - uses: actions/checkout@v1 - name: Set up Python 3.7 From c6a5567c0b6bb20bfc5def559683469f35f10d8c Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 13:14:32 +0100 Subject: [PATCH 19/45] strategy matrix needed --- .github/workflows/build.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7f2766f..48cbc33 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,17 @@ on: jobs: build: runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-18.04 + TARGET: ubuntu + + - os: macos-10.15 + TARGET: macos + + - os: windows-2019 + TARGET: windows steps: - uses: actions/checkout@v1 From 4e863a984bd3a72d8b86b4410cf437a2e13b0b1f Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 13:21:33 +0100 Subject: [PATCH 20/45] windows and macos seems to hang after successive runs? Tried only running a single demo --- .github/workflows/build.yml | 3 --- examples/demo_densecrf3d.py | 2 -- 2 files changed, 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 48cbc33..13bcb6f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,9 +45,6 @@ jobs: run: | pip install SimpleITK pillow matplotlib cd ${{github.workspace}}/examples && python demo_maxflow.py 0 - cd ${{github.workspace}}/examples && python demo_maxflow.py 1 - cd ${{github.workspace}}/examples && python demo_maxflow.py 2 - cd ${{github.workspace}}/examples && python demo_maxflow.py 3 - name: Upload Python wheel uses: actions/upload-artifact@v2 diff --git a/examples/demo_densecrf3d.py b/examples/demo_densecrf3d.py index aabe005..5cb4648 100755 --- a/examples/demo_densecrf3d.py +++ b/examples/demo_densecrf3d.py @@ -101,5 +101,3 @@ def demo_densecrf3d_2(): demo_densecrf3d_2() else: raise ValueError("Invalid number: " + method) - - From 0a2c97287f221e8475834abf52d2a80cae1a6902 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 14:31:39 +0100 Subject: [PATCH 21/45] removed demo as demos dont work on the cloud for different reasons --- .github/workflows/build.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 13bcb6f..d4bcb4b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,10 +41,11 @@ jobs: - name: Install program for ${{matrix.TARGET}} run: pip install --find-links=${{github.workspace}}/dist/ SimpleCRF - - name: Run maxflow demo (and install deps) - run: | - pip install SimpleITK pillow matplotlib - cd ${{github.workspace}}/examples && python demo_maxflow.py 0 + #- name: Run maxflow demo (and install deps) + # run: | + # pip install SimpleITK pillow matplotlib + # cd ${{github.workspace}}/examples && python demo_maxflow.py 0 + # if: matrix.os == windows-2019 - name: Upload Python wheel uses: actions/upload-artifact@v2 From 1ec80e666eb6987c0e9764f5d9452d2c764d9954 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 14:43:47 +0100 Subject: [PATCH 22/45] build any python 3.x --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d4bcb4b..2d84d60 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,10 +25,10 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Set up Python 3.7 + - name: Set up Python 3 uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: '3.x' - name: Install dependencies run: | From 1473d302d1afb514ecc8fd4c69d188501d33f121 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 14:47:47 +0100 Subject: [PATCH 23/45] added import test --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d84d60..4d9e626 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,6 +41,9 @@ jobs: - name: Install program for ${{matrix.TARGET}} run: pip install --find-links=${{github.workspace}}/dist/ SimpleCRF + - name: Test import + run: python -c "import denseCRF, maxflow" + #- name: Run maxflow demo (and install deps) # run: | # pip install SimpleITK pillow matplotlib From e48b2831f5f1591d9b60ee62657dfe19b3fef7aa Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 15:21:59 +0100 Subject: [PATCH 24/45] added python limited api to have forward compatibility --- setup.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index de5eb04..7b81513 100755 --- a/setup.py +++ b/setup.py @@ -25,7 +25,8 @@ def finalize_options(self): 'maxflow_python/util.cpp', 'dependency/maxflow-v3.0/graph.cpp', 'dependency/maxflow-v3.0/maxflow.cpp', - maxflow_source]) + maxflow_source], + py_limited_api=True) module_name2 = 'denseCRF' densecrf_source = "densecrf_python/wrap2D_py{0:}.cpp".format(py_version) @@ -45,7 +46,8 @@ def finalize_options(self): './dependency/densecrf/src/util.cpp', './dependency/densecrf/external/liblbfgs/lib/lbfgs.c', densecrf_source, - ]) + ], + py_limited_api=True) module_name3 = 'denseCRF3D' densecrf_source = "densecrf_python/wrap3D_py{0:}.cpp".format(py_version) @@ -65,13 +67,14 @@ def finalize_options(self): './dependency/densecrf3d/src/util.cpp', './dependency/densecrf/external/liblbfgs/lib/lbfgs.c', densecrf_source, - ]) + ], + py_limited_api=True) # Get the summary description = 'An open-source toolkit for conditional random field (CRF) and dense CRF' # Get the long description -if(sys.version[0] == '2'): +if (sys.version[0] == '2'): import io with io.open('README.md', 'r', encoding='utf-8') as f: long_description = f.read() @@ -100,5 +103,5 @@ def finalize_options(self): cmdclass={'build_ext': build_ext},) -# to build, run python stup.py build or python setup.py build_ext --inplace +# to build, run python setup.py build or python setup.py build_ext --inplace # to install, run python setup.py install From 64ed8c0afafd89fec075231385e0c8670b7b1ab8 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 15:22:48 +0100 Subject: [PATCH 25/45] build for python 3.6 (with abi3) --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d9e626..25d979e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,10 +25,10 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Set up Python 3 + - name: Set up Python 3.6 uses: actions/setup-python@v2 with: - python-version: '3.x' + python-version: 3.6 - name: Install dependencies run: | @@ -36,7 +36,7 @@ jobs: pip install -r requirements.txt - name: Build wheel - run: python setup.py bdist_wheel --universal + run: python setup.py bdist_wheel - name: Install program for ${{matrix.TARGET}} run: pip install --find-links=${{github.workspace}}/dist/ SimpleCRF From a3b83fcf7d160b903c46ee4c90ac60c5c9dd1e71 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 15:29:34 +0100 Subject: [PATCH 26/45] separate build workflows for each OS --- .../workflows/{build.yml => CI-macos.yaml} | 13 +---- .github/workflows/CI-ubuntu.yaml | 47 +++++++++++++++++++ .github/workflows/CI-windows.yaml | 47 +++++++++++++++++++ 3 files changed, 95 insertions(+), 12 deletions(-) rename .github/workflows/{build.yml => CI-macos.yaml} (81%) create mode 100644 .github/workflows/CI-ubuntu.yaml create mode 100644 .github/workflows/CI-windows.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/CI-macos.yaml similarity index 81% rename from .github/workflows/build.yml rename to .github/workflows/CI-macos.yaml index 25d979e..86c6b50 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/CI-macos.yaml @@ -10,18 +10,7 @@ on: jobs: build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - include: - - os: ubuntu-18.04 - TARGET: ubuntu - - - os: macos-10.15 - TARGET: macos - - - os: windows-2019 - TARGET: windows + runs-on: macos-10.15 steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/CI-ubuntu.yaml b/.github/workflows/CI-ubuntu.yaml new file mode 100644 index 0000000..720be32 --- /dev/null +++ b/.github/workflows/CI-ubuntu.yaml @@ -0,0 +1,47 @@ +name: Build + +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + +jobs: + build: + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.6 + uses: actions/setup-python@v2 + with: + python-version: 3.6 + + - name: Install dependencies + run: | + pip install wheel setuptools + pip install -r requirements.txt + + - name: Build wheel + run: python setup.py bdist_wheel + + - name: Install program for ${{matrix.TARGET}} + run: pip install --find-links=${{github.workspace}}/dist/ SimpleCRF + + - name: Test import + run: python -c "import denseCRF, maxflow" + + #- name: Run maxflow demo (and install deps) + # run: | + # pip install SimpleITK pillow matplotlib + # cd ${{github.workspace}}/examples && python demo_maxflow.py 0 + # if: matrix.os == windows-2019 + + - name: Upload Python wheel + uses: actions/upload-artifact@v2 + with: + name: Python wheel + path: ${{github.workspace}}/dist/SimpleCRF-*.whl + if-no-files-found: error diff --git a/.github/workflows/CI-windows.yaml b/.github/workflows/CI-windows.yaml new file mode 100644 index 0000000..6b0c9c9 --- /dev/null +++ b/.github/workflows/CI-windows.yaml @@ -0,0 +1,47 @@ +name: Build + +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + +jobs: + build: + runs-on: windows-2019 + + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.6 + uses: actions/setup-python@v2 + with: + python-version: 3.6 + + - name: Install dependencies + run: | + pip install wheel setuptools + pip install -r requirements.txt + + - name: Build wheel + run: python setup.py bdist_wheel + + - name: Install program for ${{matrix.TARGET}} + run: pip install --find-links=${{github.workspace}}/dist/ SimpleCRF + + - name: Test import + run: python -c "import denseCRF, maxflow" + + #- name: Run maxflow demo (and install deps) + # run: | + # pip install SimpleITK pillow matplotlib + # cd ${{github.workspace}}/examples && python demo_maxflow.py 0 + # if: matrix.os == windows-2019 + + - name: Upload Python wheel + uses: actions/upload-artifact@v2 + with: + name: Python wheel + path: ${{github.workspace}}/dist/SimpleCRF-*.whl + if-no-files-found: error From 08ed3b3f074dad374fb32083522b6c9c6ba5475b Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 15:31:27 +0100 Subject: [PATCH 27/45] OS dependent name for each build --- .github/workflows/CI-macos.yaml | 2 +- .github/workflows/CI-ubuntu.yaml | 2 +- .github/workflows/CI-windows.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI-macos.yaml b/.github/workflows/CI-macos.yaml index 86c6b50..e621cbd 100644 --- a/.github/workflows/CI-macos.yaml +++ b/.github/workflows/CI-macos.yaml @@ -1,4 +1,4 @@ -name: Build +name: macOS on: push: diff --git a/.github/workflows/CI-ubuntu.yaml b/.github/workflows/CI-ubuntu.yaml index 720be32..c4710b6 100644 --- a/.github/workflows/CI-ubuntu.yaml +++ b/.github/workflows/CI-ubuntu.yaml @@ -1,4 +1,4 @@ -name: Build +name: Ubuntu on: push: diff --git a/.github/workflows/CI-windows.yaml b/.github/workflows/CI-windows.yaml index 6b0c9c9..977810c 100644 --- a/.github/workflows/CI-windows.yaml +++ b/.github/workflows/CI-windows.yaml @@ -1,4 +1,4 @@ -name: Build +name: Windows on: push: From 38bb1d86fafc93e43b9b33bf355691e7cddd8c53 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 15:39:03 +0100 Subject: [PATCH 28/45] added remaining abi3 stuff --- .github/workflows/CI-macos.yaml | 4 ++-- .github/workflows/CI-ubuntu.yaml | 4 ++-- .github/workflows/CI-windows.yaml | 4 ++-- setup.cfg | 2 ++ setup.py | 4 +--- 5 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 setup.cfg diff --git a/.github/workflows/CI-macos.yaml b/.github/workflows/CI-macos.yaml index e621cbd..bab367e 100644 --- a/.github/workflows/CI-macos.yaml +++ b/.github/workflows/CI-macos.yaml @@ -25,9 +25,9 @@ jobs: pip install -r requirements.txt - name: Build wheel - run: python setup.py bdist_wheel + run: python setup.py bdist_wheel --py-limited-api=cp36 - - name: Install program for ${{matrix.TARGET}} + - name: Install software run: pip install --find-links=${{github.workspace}}/dist/ SimpleCRF - name: Test import diff --git a/.github/workflows/CI-ubuntu.yaml b/.github/workflows/CI-ubuntu.yaml index c4710b6..b5c1b07 100644 --- a/.github/workflows/CI-ubuntu.yaml +++ b/.github/workflows/CI-ubuntu.yaml @@ -25,9 +25,9 @@ jobs: pip install -r requirements.txt - name: Build wheel - run: python setup.py bdist_wheel + run: python setup.py bdist_wheel --py-limited-api=cp36 - - name: Install program for ${{matrix.TARGET}} + - name: Install software run: pip install --find-links=${{github.workspace}}/dist/ SimpleCRF - name: Test import diff --git a/.github/workflows/CI-windows.yaml b/.github/workflows/CI-windows.yaml index 977810c..dc40418 100644 --- a/.github/workflows/CI-windows.yaml +++ b/.github/workflows/CI-windows.yaml @@ -25,9 +25,9 @@ jobs: pip install -r requirements.txt - name: Build wheel - run: python setup.py bdist_wheel + run: python setup.py bdist_wheel --py-limited-api=cp36 - - name: Install program for ${{matrix.TARGET}} + - name: Install software run: pip install --find-links=${{github.workspace}}/dist/ SimpleCRF - name: Test import diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..467b49d --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +py_limited_api = cp36 \ No newline at end of file diff --git a/setup.py b/setup.py index 7b81513..e62d30e 100755 --- a/setup.py +++ b/setup.py @@ -95,9 +95,7 @@ def finalize_options(self): ext_modules = [module1, module2, module3], classifiers=[ 'License :: OSI Approved :: BSD License', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3 :: Only', ], python_requires = '>=3.6', cmdclass={'build_ext': build_ext},) From 1e99d25e10357a5871807767bc485afc4eeea135 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 16:01:33 +0100 Subject: [PATCH 29/45] removed gitignore file --- .gitignore | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index eba74f4..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -venv/ \ No newline at end of file From 45f37bbf22c01ab1bbe4c09f7f080d3f331b8aea Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 16:39:30 +0100 Subject: [PATCH 30/45] try uninstalling SimpleCRF before installing through wheel --- .github/workflows/CI-windows.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI-windows.yaml b/.github/workflows/CI-windows.yaml index dc40418..b096830 100644 --- a/.github/workflows/CI-windows.yaml +++ b/.github/workflows/CI-windows.yaml @@ -28,7 +28,9 @@ jobs: run: python setup.py bdist_wheel --py-limited-api=cp36 - name: Install software - run: pip install --find-links=${{github.workspace}}/dist/ SimpleCRF + run: | + pip uninstall SimpleCRF + pip install --find-links=${{github.workspace}}/dist/ SimpleCRF - name: Test import run: python -c "import denseCRF, maxflow" From d923ef87f6e5614b921811e144b48d7f0e539cfc Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 17:25:55 +0100 Subject: [PATCH 31/45] removed abi3 stuff that did not seem to work. Added builds for specific python3.x versions instead - different wheel for individual python versions --- .github/workflows/CI-macos.yaml | 10 +++++++--- .github/workflows/CI-ubuntu.yaml | 10 +++++++--- .github/workflows/CI-windows.yaml | 14 ++++++++------ setup.py | 11 ++++++++--- 4 files changed, 30 insertions(+), 15 deletions(-) diff --git a/.github/workflows/CI-macos.yaml b/.github/workflows/CI-macos.yaml index bab367e..a66a9c9 100644 --- a/.github/workflows/CI-macos.yaml +++ b/.github/workflows/CI-macos.yaml @@ -11,13 +11,16 @@ on: jobs: build: runs-on: macos-10.15 + strategy: + matrix: + python-version: [3.6, 3.7, 3.8, 3.9, 3.10] steps: - uses: actions/checkout@v1 - - name: Set up Python 3.6 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: - python-version: 3.6 + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | @@ -25,7 +28,8 @@ jobs: pip install -r requirements.txt - name: Build wheel - run: python setup.py bdist_wheel --py-limited-api=cp36 + run: python setup.py bdist_wheel + #--py-limited-api=cp36 - name: Install software run: pip install --find-links=${{github.workspace}}/dist/ SimpleCRF diff --git a/.github/workflows/CI-ubuntu.yaml b/.github/workflows/CI-ubuntu.yaml index b5c1b07..4b6c148 100644 --- a/.github/workflows/CI-ubuntu.yaml +++ b/.github/workflows/CI-ubuntu.yaml @@ -11,13 +11,16 @@ on: jobs: build: runs-on: ubuntu-18.04 + strategy: + matrix: + python-version: [3.6, 3.7, 3.8, 3.9, 3.10] steps: - uses: actions/checkout@v1 - - name: Set up Python 3.6 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: - python-version: 3.6 + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | @@ -25,7 +28,8 @@ jobs: pip install -r requirements.txt - name: Build wheel - run: python setup.py bdist_wheel --py-limited-api=cp36 + run: python setup.py bdist_wheel + #--py-limited-api=cp36 - name: Install software run: pip install --find-links=${{github.workspace}}/dist/ SimpleCRF diff --git a/.github/workflows/CI-windows.yaml b/.github/workflows/CI-windows.yaml index b096830..3910cae 100644 --- a/.github/workflows/CI-windows.yaml +++ b/.github/workflows/CI-windows.yaml @@ -11,13 +11,16 @@ on: jobs: build: runs-on: windows-2019 + strategy: + matrix: + python-version: [3.6, 3.7, 3.8, 3.9, 3.10] steps: - uses: actions/checkout@v1 - - name: Set up Python 3.6 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: - python-version: 3.6 + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | @@ -25,12 +28,11 @@ jobs: pip install -r requirements.txt - name: Build wheel - run: python setup.py bdist_wheel --py-limited-api=cp36 + run: python setup.py bdist_wheel + #--py-limited-api=cp36 - name: Install software - run: | - pip uninstall SimpleCRF - pip install --find-links=${{github.workspace}}/dist/ SimpleCRF + run: pip install --find-links=${{github.workspace}}/dist/ SimpleCRF - name: Test import run: python -c "import denseCRF, maxflow" diff --git a/setup.py b/setup.py index e62d30e..e68a502 100755 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ def finalize_options(self): 'dependency/maxflow-v3.0/graph.cpp', 'dependency/maxflow-v3.0/maxflow.cpp', maxflow_source], - py_limited_api=True) + py_limited_api=False) module_name2 = 'denseCRF' densecrf_source = "densecrf_python/wrap2D_py{0:}.cpp".format(py_version) @@ -47,7 +47,7 @@ def finalize_options(self): './dependency/densecrf/external/liblbfgs/lib/lbfgs.c', densecrf_source, ], - py_limited_api=True) + py_limited_api=False) module_name3 = 'denseCRF3D' densecrf_source = "densecrf_python/wrap3D_py{0:}.cpp".format(py_version) @@ -68,7 +68,7 @@ def finalize_options(self): './dependency/densecrf/external/liblbfgs/lib/lbfgs.c', densecrf_source, ], - py_limited_api=True) + py_limited_api=False) # Get the summary description = 'An open-source toolkit for conditional random field (CRF) and dense CRF' @@ -96,6 +96,11 @@ def finalize_options(self): classifiers=[ 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: 3 :: Only', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', ], python_requires = '>=3.6', cmdclass={'build_ext': build_ext},) From 816bb6b220ff2b595b6e298b844bc87aa5d1d5c1 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 17:28:02 +0100 Subject: [PATCH 32/45] fix for python 3.10 --- .github/workflows/CI-macos.yaml | 2 +- .github/workflows/CI-ubuntu.yaml | 2 +- .github/workflows/CI-windows.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI-macos.yaml b/.github/workflows/CI-macos.yaml index a66a9c9..f2b3e67 100644 --- a/.github/workflows/CI-macos.yaml +++ b/.github/workflows/CI-macos.yaml @@ -13,7 +13,7 @@ jobs: runs-on: macos-10.15 strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9, 3.10] + python-version: [3.6, 3.7, 3.8, 3.9, 3] steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/CI-ubuntu.yaml b/.github/workflows/CI-ubuntu.yaml index 4b6c148..3612537 100644 --- a/.github/workflows/CI-ubuntu.yaml +++ b/.github/workflows/CI-ubuntu.yaml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-18.04 strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9, 3.10] + python-version: [3.6, 3.7, 3.8, 3.9, 3] steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/CI-windows.yaml b/.github/workflows/CI-windows.yaml index 3910cae..c9a897c 100644 --- a/.github/workflows/CI-windows.yaml +++ b/.github/workflows/CI-windows.yaml @@ -13,7 +13,7 @@ jobs: runs-on: windows-2019 strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9, 3.10] + python-version: [3.6, 3.7, 3.8, 3.9, 3] steps: - uses: actions/checkout@v1 From ceb0842100fb7981a306cd059c2a3dd8df40839b Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 17:32:04 +0100 Subject: [PATCH 33/45] removed config file as no longer needed as abi3 solution didnt work --- setup.cfg | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 setup.cfg diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 467b49d..0000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[bdist_wheel] -py_limited_api = cp36 \ No newline at end of file From 8d369482f25d0dea644dc4b00a032ce214630ddc Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 22:07:50 +0100 Subject: [PATCH 34/45] added unit test for windows --- .github/workflows/CI-macos.yaml | 6 ------ .github/workflows/CI-ubuntu.yaml | 6 ------ .github/workflows/CI-windows.yaml | 9 ++++----- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/.github/workflows/CI-macos.yaml b/.github/workflows/CI-macos.yaml index f2b3e67..400661a 100644 --- a/.github/workflows/CI-macos.yaml +++ b/.github/workflows/CI-macos.yaml @@ -37,12 +37,6 @@ jobs: - name: Test import run: python -c "import denseCRF, maxflow" - #- name: Run maxflow demo (and install deps) - # run: | - # pip install SimpleITK pillow matplotlib - # cd ${{github.workspace}}/examples && python demo_maxflow.py 0 - # if: matrix.os == windows-2019 - - name: Upload Python wheel uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/CI-ubuntu.yaml b/.github/workflows/CI-ubuntu.yaml index 3612537..c3bc672 100644 --- a/.github/workflows/CI-ubuntu.yaml +++ b/.github/workflows/CI-ubuntu.yaml @@ -37,12 +37,6 @@ jobs: - name: Test import run: python -c "import denseCRF, maxflow" - #- name: Run maxflow demo (and install deps) - # run: | - # pip install SimpleITK pillow matplotlib - # cd ${{github.workspace}}/examples && python demo_maxflow.py 0 - # if: matrix.os == windows-2019 - - name: Upload Python wheel uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/CI-windows.yaml b/.github/workflows/CI-windows.yaml index c9a897c..70b90b2 100644 --- a/.github/workflows/CI-windows.yaml +++ b/.github/workflows/CI-windows.yaml @@ -37,11 +37,10 @@ jobs: - name: Test import run: python -c "import denseCRF, maxflow" - #- name: Run maxflow demo (and install deps) - # run: | - # pip install SimpleITK pillow matplotlib - # cd ${{github.workspace}}/examples && python demo_maxflow.py 0 - # if: matrix.os == windows-2019 + - name: Test maxflow demo + run: | + pip install SimpleITK pillow matplotlib + cd ${{github.workspace}}/examples && python demo_maxflow.py 0 - name: Upload Python wheel uses: actions/upload-artifact@v2 From 5b6d9c811a950a277f5ed93eaca292936d640d8c Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 22:14:07 +0100 Subject: [PATCH 35/45] skip test for python 3 --- .github/workflows/CI-windows.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI-windows.yaml b/.github/workflows/CI-windows.yaml index 70b90b2..ceae025 100644 --- a/.github/workflows/CI-windows.yaml +++ b/.github/workflows/CI-windows.yaml @@ -41,6 +41,7 @@ jobs: run: | pip install SimpleITK pillow matplotlib cd ${{github.workspace}}/examples && python demo_maxflow.py 0 + if: python-version != 3 - name: Upload Python wheel uses: actions/upload-artifact@v2 From 2896a25f1a6f1b0f00f8cd3ff43c575054fc9098 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 22:18:58 +0100 Subject: [PATCH 36/45] fixed if statement --- .github/workflows/CI-windows.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI-windows.yaml b/.github/workflows/CI-windows.yaml index ceae025..eca3d79 100644 --- a/.github/workflows/CI-windows.yaml +++ b/.github/workflows/CI-windows.yaml @@ -37,11 +37,11 @@ jobs: - name: Test import run: python -c "import denseCRF, maxflow" - - name: Test maxflow demo + - if: python-version != 3 + name: Test maxflow demo run: | pip install SimpleITK pillow matplotlib cd ${{github.workspace}}/examples && python demo_maxflow.py 0 - if: python-version != 3 - name: Upload Python wheel uses: actions/upload-artifact@v2 From 8c6415e2c2a2322d449d0fb09d2777605d32cae5 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 22:21:02 +0100 Subject: [PATCH 37/45] another typo --- .github/workflows/CI-windows.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI-windows.yaml b/.github/workflows/CI-windows.yaml index eca3d79..d02233f 100644 --- a/.github/workflows/CI-windows.yaml +++ b/.github/workflows/CI-windows.yaml @@ -37,7 +37,7 @@ jobs: - name: Test import run: python -c "import denseCRF, maxflow" - - if: python-version != 3 + - if: ${{ matrix.python-version }} != 3 name: Test maxflow demo run: | pip install SimpleITK pillow matplotlib From 48846b88a5dac7d652d3d9f0fa42341b80f6145a Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 22:24:40 +0100 Subject: [PATCH 38/45] removed py3.10 for now --- .github/workflows/CI-windows.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/CI-windows.yaml b/.github/workflows/CI-windows.yaml index d02233f..ee62836 100644 --- a/.github/workflows/CI-windows.yaml +++ b/.github/workflows/CI-windows.yaml @@ -13,7 +13,7 @@ jobs: runs-on: windows-2019 strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9, 3] + python-version: [3.6, 3.7, 3.8, 3.9] steps: - uses: actions/checkout@v1 @@ -37,7 +37,6 @@ jobs: - name: Test import run: python -c "import denseCRF, maxflow" - - if: ${{ matrix.python-version }} != 3 name: Test maxflow demo run: | pip install SimpleITK pillow matplotlib From 545eb02042147d7ec0b5c43c2faeac9b5c86578d Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 22:25:32 +0100 Subject: [PATCH 39/45] typo --- .github/workflows/CI-windows.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI-windows.yaml b/.github/workflows/CI-windows.yaml index ee62836..4ad4d6c 100644 --- a/.github/workflows/CI-windows.yaml +++ b/.github/workflows/CI-windows.yaml @@ -37,7 +37,7 @@ jobs: - name: Test import run: python -c "import denseCRF, maxflow" - name: Test maxflow demo + - name: Test maxflow demo run: | pip install SimpleITK pillow matplotlib cd ${{github.workspace}}/examples && python demo_maxflow.py 0 From fe313aee0c4c2eebe045fa60f8a2e5f678618465 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 22:30:48 +0100 Subject: [PATCH 40/45] added demo tests again for all OSs, and temporarily removed build for python 3.10 --- .github/workflows/CI-macos.yaml | 7 ++++++- .github/workflows/CI-ubuntu.yaml | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI-macos.yaml b/.github/workflows/CI-macos.yaml index 400661a..4c1a5a3 100644 --- a/.github/workflows/CI-macos.yaml +++ b/.github/workflows/CI-macos.yaml @@ -13,7 +13,7 @@ jobs: runs-on: macos-10.15 strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9, 3] + python-version: [3.6, 3.7, 3.8, 3.9] steps: - uses: actions/checkout@v1 @@ -37,6 +37,11 @@ jobs: - name: Test import run: python -c "import denseCRF, maxflow" + - name: Test maxflow demo + run: | + pip install SimpleITK pillow matplotlib + cd ${{github.workspace}}/examples && python demo_maxflow.py 0 + - name: Upload Python wheel uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/CI-ubuntu.yaml b/.github/workflows/CI-ubuntu.yaml index c3bc672..711d7f2 100644 --- a/.github/workflows/CI-ubuntu.yaml +++ b/.github/workflows/CI-ubuntu.yaml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-18.04 strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9, 3] + python-version: [3.6, 3.7, 3.8, 3.9] steps: - uses: actions/checkout@v1 @@ -37,6 +37,11 @@ jobs: - name: Test import run: python -c "import denseCRF, maxflow" + - name: Test maxflow demo + run: | + pip install SimpleITK pillow matplotlib + cd ${{github.workspace}}/examples && python demo_maxflow.py 0 + - name: Upload Python wheel uses: actions/upload-artifact@v2 with: From d01f100ba0adfef49b45711aecad4faa3b899223 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 22:33:30 +0100 Subject: [PATCH 41/45] swapped plt.show with plt.savefig --- examples/demo_maxflow.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/demo_maxflow.py b/examples/demo_maxflow.py index 58b34ce..4eda2be 100755 --- a/examples/demo_maxflow.py +++ b/examples/demo_maxflow.py @@ -96,10 +96,11 @@ def demo_maxflow(): param = (lamda, sigma) lab = maxflow2d(Iq, Prob, param) + fig = plt.figure() plt.subplot(1,3,1); plt.axis('off'); plt.imshow(I); plt.title('input image') plt.subplot(1,3,2); plt.axis('off'); plt.imshow(fP); plt.title('initial \n segmentation') plt.subplot(1,3,3); plt.axis('off'); plt.imshow(lab); plt.title('CRF result') - plt.show() + fig.savefig('./demo_result.png') def demo_interactive_maxflow(): I = Image.open('../data/brain.png') @@ -121,10 +122,11 @@ def demo_interactive_maxflow(): param = (lamda, sigma) lab = interactive_maxflow2d(Iq, Prob, Seed, param) + fig = plt.figure() plt.subplot(1,3,1); plt.axis('off'); plt.imshow(I); plt.title('input image') plt.subplot(1,3,2); plt.axis('off'); plt.imshow(fP); plt.title('initial \n segmentation') plt.subplot(1,3,3); plt.axis('off'); plt.imshow(lab); plt.title('CRF result') - plt.show() + fig.savefig('./demo_result.png') def demo_maxflow3d(): img_name = "../data/2013_12_1_img.nii.gz" From 77dce9e11ad282889484574de084572b0fe4270d Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 22:46:01 +0100 Subject: [PATCH 42/45] all three demos are now run for each build, but only for python 3.10 currently, as SimpleITK is not supported on Python 3.10 (yet). Also swapped plt.show with plt.savefig for all demos --- .github/workflows/CI-macos.yaml | 15 ++++++++++++--- .github/workflows/CI-ubuntu.yaml | 13 ++++++++++--- .github/workflows/CI-windows.yaml | 16 +++++++++++----- examples/demo_densecrf.py | 6 ++++-- 4 files changed, 37 insertions(+), 13 deletions(-) diff --git a/.github/workflows/CI-macos.yaml b/.github/workflows/CI-macos.yaml index 4c1a5a3..48c624d 100644 --- a/.github/workflows/CI-macos.yaml +++ b/.github/workflows/CI-macos.yaml @@ -37,10 +37,19 @@ jobs: - name: Test import run: python -c "import denseCRF, maxflow" + - name: Install deps for demos + run: pip install SimpleITK pillow matplotlib + - name: Test maxflow demo - run: | - pip install SimpleITK pillow matplotlib - cd ${{github.workspace}}/examples && python demo_maxflow.py 0 + run: cd ${{github.workspace}}/examples && python demo_maxflow.py 0 + + - name: Test denseCRF demo + run: cd ${{github.workspace}}/examples && python demo_densecrf.py 1 + + - name: Test denseCRF 3D demo + run: cd ${{github.workspace}}/examples && python demo_densecrf.py 2 + + - name: Test dense_crf demo - name: Upload Python wheel uses: actions/upload-artifact@v2 diff --git a/.github/workflows/CI-ubuntu.yaml b/.github/workflows/CI-ubuntu.yaml index 711d7f2..f13ef12 100644 --- a/.github/workflows/CI-ubuntu.yaml +++ b/.github/workflows/CI-ubuntu.yaml @@ -37,10 +37,17 @@ jobs: - name: Test import run: python -c "import denseCRF, maxflow" + - name: Install deps for demos + run: pip install SimpleITK pillow matplotlib + - name: Test maxflow demo - run: | - pip install SimpleITK pillow matplotlib - cd ${{github.workspace}}/examples && python demo_maxflow.py 0 + run: cd ${{github.workspace}}/examples && python demo_maxflow.py 0 + + - name: Test denseCRF demo + run: cd ${{github.workspace}}/examples && python demo_densecrf.py 1 + + - name: Test denseCRF 3D demo + run: cd ${{github.workspace}}/examples && python demo_densecrf.py 2 - name: Upload Python wheel uses: actions/upload-artifact@v2 diff --git a/.github/workflows/CI-windows.yaml b/.github/workflows/CI-windows.yaml index 4ad4d6c..df4e533 100644 --- a/.github/workflows/CI-windows.yaml +++ b/.github/workflows/CI-windows.yaml @@ -28,8 +28,7 @@ jobs: pip install -r requirements.txt - name: Build wheel - run: python setup.py bdist_wheel - #--py-limited-api=cp36 + run: python setup.py bdist_wheel - name: Install software run: pip install --find-links=${{github.workspace}}/dist/ SimpleCRF @@ -37,10 +36,17 @@ jobs: - name: Test import run: python -c "import denseCRF, maxflow" + - name: Install deps for demos + run: pip install SimpleITK pillow matplotlib + - name: Test maxflow demo - run: | - pip install SimpleITK pillow matplotlib - cd ${{github.workspace}}/examples && python demo_maxflow.py 0 + run: cd ${{github.workspace}}/examples && python demo_maxflow.py 0 + + - name: Test denseCRF demo + run: cd ${{github.workspace}}/examples && python demo_densecrf.py 1 + + - name: Test denseCRF 3D demo + run: cd ${{github.workspace}}/examples && python demo_densecrf.py 2 - name: Upload Python wheel uses: actions/upload-artifact@v2 diff --git a/examples/demo_densecrf.py b/examples/demo_densecrf.py index 0ff03ba..684f01f 100755 --- a/examples/demo_densecrf.py +++ b/examples/demo_densecrf.py @@ -73,10 +73,11 @@ def demo_densecrf1(): param = (w1, alpha, beta, w2, gamma, it) lab = densecrf(Iq, prob, param) lab = Image.fromarray(lab*255) + fig = plt.figure() plt.subplot(1,3,1); plt.axis('off'); plt.imshow(I); plt.title('input image') plt.subplot(1,3,2); plt.axis('off'); plt.imshow(L); plt.title('initial label') plt.subplot(1,3,3); plt.axis('off'); plt.imshow(lab); plt.title('after dense CRF') - plt.show() + fig.savefig('./demo_result.png') def demo_densecrf2(): I = Image.open('../dependency/densecrf/examples/im3.ppm') @@ -100,10 +101,11 @@ def demo_densecrf2(): lab = densecrf(Iq, prob, param) lab = colorize_label_map(lab, color_list) lab = Image.fromarray(lab) + fig = plt.figure() plt.subplot(1,3,1); plt.axis('off'); plt.imshow(I); plt.title('input image') plt.subplot(1,3,2); plt.axis('off'); plt.imshow(L); plt.title('initial label') plt.subplot(1,3,3); plt.axis('off'); plt.imshow(lab); plt.title('after dense CRF') - plt.show() + fig.savefig('./demo_result.png') if __name__ == "__main__": print("example list") From 4de3ffd3aa5e7cd525d1a22cdb96f015715e8a2f Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 22:48:02 +0100 Subject: [PATCH 43/45] removed redundant step and did some refactoring --- .github/workflows/CI-macos.yaml | 5 +---- .github/workflows/CI-ubuntu.yaml | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CI-macos.yaml b/.github/workflows/CI-macos.yaml index 48c624d..822162b 100644 --- a/.github/workflows/CI-macos.yaml +++ b/.github/workflows/CI-macos.yaml @@ -28,8 +28,7 @@ jobs: pip install -r requirements.txt - name: Build wheel - run: python setup.py bdist_wheel - #--py-limited-api=cp36 + run: python setup.py bdist_wheel - name: Install software run: pip install --find-links=${{github.workspace}}/dist/ SimpleCRF @@ -49,8 +48,6 @@ jobs: - name: Test denseCRF 3D demo run: cd ${{github.workspace}}/examples && python demo_densecrf.py 2 - - name: Test dense_crf demo - - name: Upload Python wheel uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/CI-ubuntu.yaml b/.github/workflows/CI-ubuntu.yaml index f13ef12..85b1da0 100644 --- a/.github/workflows/CI-ubuntu.yaml +++ b/.github/workflows/CI-ubuntu.yaml @@ -28,8 +28,7 @@ jobs: pip install -r requirements.txt - name: Build wheel - run: python setup.py bdist_wheel - #--py-limited-api=cp36 + run: python setup.py bdist_wheel - name: Install software run: pip install --find-links=${{github.workspace}}/dist/ SimpleCRF From c44eda1f95a3304b34c244c1ba6fe80317e23894 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 22:48:44 +0100 Subject: [PATCH 44/45] wrong argv --- .github/workflows/CI-macos.yaml | 2 +- .github/workflows/CI-ubuntu.yaml | 2 +- .github/workflows/CI-windows.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI-macos.yaml b/.github/workflows/CI-macos.yaml index 822162b..bf832d0 100644 --- a/.github/workflows/CI-macos.yaml +++ b/.github/workflows/CI-macos.yaml @@ -46,7 +46,7 @@ jobs: run: cd ${{github.workspace}}/examples && python demo_densecrf.py 1 - name: Test denseCRF 3D demo - run: cd ${{github.workspace}}/examples && python demo_densecrf.py 2 + run: cd ${{github.workspace}}/examples && python demo_densecrf.py 1 - name: Upload Python wheel uses: actions/upload-artifact@v2 diff --git a/.github/workflows/CI-ubuntu.yaml b/.github/workflows/CI-ubuntu.yaml index 85b1da0..d60ae5f 100644 --- a/.github/workflows/CI-ubuntu.yaml +++ b/.github/workflows/CI-ubuntu.yaml @@ -46,7 +46,7 @@ jobs: run: cd ${{github.workspace}}/examples && python demo_densecrf.py 1 - name: Test denseCRF 3D demo - run: cd ${{github.workspace}}/examples && python demo_densecrf.py 2 + run: cd ${{github.workspace}}/examples && python demo_densecrf.py 1 - name: Upload Python wheel uses: actions/upload-artifact@v2 diff --git a/.github/workflows/CI-windows.yaml b/.github/workflows/CI-windows.yaml index df4e533..3d4f537 100644 --- a/.github/workflows/CI-windows.yaml +++ b/.github/workflows/CI-windows.yaml @@ -46,7 +46,7 @@ jobs: run: cd ${{github.workspace}}/examples && python demo_densecrf.py 1 - name: Test denseCRF 3D demo - run: cd ${{github.workspace}}/examples && python demo_densecrf.py 2 + run: cd ${{github.workspace}}/examples && python demo_densecrf.py 1 - name: Upload Python wheel uses: actions/upload-artifact@v2 From a481adccea006ff1a8c99ee2cf9ff1a67d5ca560 Mon Sep 17 00:00:00 2001 From: andreped Date: Tue, 1 Feb 2022 23:12:26 +0100 Subject: [PATCH 45/45] one build to rule them all --- .../{CI-macos.yaml => CI-build.yaml} | 5 +- .github/workflows/CI-ubuntu.yaml | 56 ------------------- .github/workflows/CI-windows.yaml | 56 ------------------- 3 files changed, 3 insertions(+), 114 deletions(-) rename .github/workflows/{CI-macos.yaml => CI-build.yaml} (92%) delete mode 100644 .github/workflows/CI-ubuntu.yaml delete mode 100644 .github/workflows/CI-windows.yaml diff --git a/.github/workflows/CI-macos.yaml b/.github/workflows/CI-build.yaml similarity index 92% rename from .github/workflows/CI-macos.yaml rename to .github/workflows/CI-build.yaml index bf832d0..f6146c9 100644 --- a/.github/workflows/CI-macos.yaml +++ b/.github/workflows/CI-build.yaml @@ -1,4 +1,4 @@ -name: macOS +name: Build and upload wheels on: push: @@ -10,9 +10,10 @@ on: jobs: build: - runs-on: macos-10.15 + runs-on: ${{ matrix.os }} strategy: matrix: + os: [windows-2019, ubuntu-18.04, macos-10.15] python-version: [3.6, 3.7, 3.8, 3.9] steps: diff --git a/.github/workflows/CI-ubuntu.yaml b/.github/workflows/CI-ubuntu.yaml deleted file mode 100644 index d60ae5f..0000000 --- a/.github/workflows/CI-ubuntu.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: Ubuntu - -on: - push: - branches: - - '*' - pull_request: - branches: - - '*' - -jobs: - build: - runs-on: ubuntu-18.04 - strategy: - matrix: - python-version: [3.6, 3.7, 3.8, 3.9] - - steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - pip install wheel setuptools - pip install -r requirements.txt - - - name: Build wheel - run: python setup.py bdist_wheel - - - name: Install software - run: pip install --find-links=${{github.workspace}}/dist/ SimpleCRF - - - name: Test import - run: python -c "import denseCRF, maxflow" - - - name: Install deps for demos - run: pip install SimpleITK pillow matplotlib - - - name: Test maxflow demo - run: cd ${{github.workspace}}/examples && python demo_maxflow.py 0 - - - name: Test denseCRF demo - run: cd ${{github.workspace}}/examples && python demo_densecrf.py 1 - - - name: Test denseCRF 3D demo - run: cd ${{github.workspace}}/examples && python demo_densecrf.py 1 - - - name: Upload Python wheel - uses: actions/upload-artifact@v2 - with: - name: Python wheel - path: ${{github.workspace}}/dist/SimpleCRF-*.whl - if-no-files-found: error diff --git a/.github/workflows/CI-windows.yaml b/.github/workflows/CI-windows.yaml deleted file mode 100644 index 3d4f537..0000000 --- a/.github/workflows/CI-windows.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: Windows - -on: - push: - branches: - - '*' - pull_request: - branches: - - '*' - -jobs: - build: - runs-on: windows-2019 - strategy: - matrix: - python-version: [3.6, 3.7, 3.8, 3.9] - - steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - pip install wheel setuptools - pip install -r requirements.txt - - - name: Build wheel - run: python setup.py bdist_wheel - - - name: Install software - run: pip install --find-links=${{github.workspace}}/dist/ SimpleCRF - - - name: Test import - run: python -c "import denseCRF, maxflow" - - - name: Install deps for demos - run: pip install SimpleITK pillow matplotlib - - - name: Test maxflow demo - run: cd ${{github.workspace}}/examples && python demo_maxflow.py 0 - - - name: Test denseCRF demo - run: cd ${{github.workspace}}/examples && python demo_densecrf.py 1 - - - name: Test denseCRF 3D demo - run: cd ${{github.workspace}}/examples && python demo_densecrf.py 1 - - - name: Upload Python wheel - uses: actions/upload-artifact@v2 - with: - name: Python wheel - path: ${{github.workspace}}/dist/SimpleCRF-*.whl - if-no-files-found: error