Skip to content

Commit edbd209

Browse files
committed
update
1 parent 0348eef commit edbd209

103 files changed

Lines changed: 13949 additions & 2 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- "master"
6+
jobs:
7+
8+
check-version:
9+
name: Check Version
10+
runs-on: ubuntu-20.04
11+
outputs:
12+
local-version: ${{ steps.get-local-version.outputs.version }}
13+
remote-version: ${{ steps.get-remote-version.outputs.version }}
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Get Local Version
17+
id: get-local-version
18+
run: echo "version=$(cat version.txt)" >> $GITHUB_OUTPUT
19+
- name: Get Remote Version
20+
id: get-remote-version
21+
run: echo "version=$(curl -s https://pypi.org/pypi/marlin_pytorch/json | jq -r '.info.version')" >> $GITHUB_OUTPUT
22+
23+
release:
24+
runs-on: ubuntu-20.04
25+
needs: check-version
26+
if: needs.check-version.outputs.local-version != needs.check-version.outputs.remote-version
27+
28+
strategy:
29+
matrix:
30+
python-version: ["3.9"]
31+
32+
steps:
33+
- uses: actions/checkout@v2
34+
35+
- name: Set up Python
36+
uses: actions/setup-python@v2
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
architecture: x64
40+
41+
- name: Install dependencies
42+
run: |
43+
pip install -r requirements.lib.txt
44+
python init.py
45+
46+
- name: Build package for marlin_pytorch
47+
run: python setup.py sdist bdist_wheel
48+
49+
- name: Release marlin_pytorch to PyPI
50+
uses: pypa/gh-action-pypi-publish@release/v1
51+
with:
52+
user: __token__
53+
password: ${{ secrets.PYPI_API_TOKEN }}
54+
55+
- name: Get the version
56+
run: |
57+
VER=$(cat version.txt)
58+
echo "VERSION=$VER" >> $GITHUB_ENV
59+
60+
- name: Release to GitHub Release
61+
uses: marvinpinto/action-automatic-releases@latest
62+
with:
63+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
64+
automatic_release_tag: "${{ env.VERSION }}"
65+
title: "[${{ env.VERSION }}] Marlin-PyTorch Release"
66+
prerelease: false
67+
files: "dist/*"
68+
draft: true

.github/workflows/unittest.yaml

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
name: Unittest
2+
on:
3+
push:
4+
branches-ignore:
5+
- "master"
6+
pull_request:
7+
8+
jobs:
9+
unittest:
10+
name: Unittest
11+
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
16+
torch-version: ["1.8.*", "1.9.*", "1.10.*", "1.11.*", "1.12.*", "1.13.*"]
17+
include:
18+
- torch-version: "1.8.*"
19+
torchvision-version: "0.9.*"
20+
- torch-version: "1.9.*"
21+
torchvision-version: "0.10.*"
22+
- torch-version: "1.10.*"
23+
torchvision-version: "0.11.*"
24+
- torch-version: "1.11.*"
25+
torchvision-version: "0.12.*"
26+
- torch-version: "1.12.*"
27+
torchvision-version: "0.13.*"
28+
- torch-version: "1.13.*"
29+
torchvision-version: "0.14.*"
30+
exclude:
31+
- python-version: "3.6"
32+
torch-version: "1.11.*"
33+
- python-version: "3.6"
34+
torch-version: "1.12.*"
35+
- python-version: "3.6"
36+
torch-version: "1.13.*"
37+
- python-version: "3.10"
38+
torch-version: "1.8.*"
39+
- python-version: "3.10"
40+
torch-version: "1.9.*"
41+
- python-version: "3.10"
42+
torch-version: "1.10.*"
43+
44+
runs-on: ubuntu-20.04
45+
46+
steps:
47+
- uses: actions/checkout@v3
48+
49+
- name: Set Swap Space
50+
uses: pierotofy/set-swap-space@master
51+
with:
52+
swap-size-gb: 10
53+
54+
- name: Set up Python
55+
uses: actions/setup-python@v4
56+
with:
57+
python-version: ${{ matrix.python-version }}
58+
architecture: x64
59+
60+
- name: Install PyAV Dependencies for Python 3.6
61+
if: matrix.python-version == '3.6'
62+
run: |
63+
sudo apt install -y libavformat-dev libavdevice-dev
64+
65+
- name: Install dependencies
66+
run: |
67+
sudo apt install -y ffmpeg wget
68+
pip install torch==${{ matrix.torch-version }}
69+
pip install torchvision==${{ matrix.torchvision-version }}
70+
pip install -r requirements.lib.txt
71+
python init.py
72+
73+
- name: Download model checkpoints
74+
run: |
75+
mkdir test/model
76+
wget -O test/model/marlin_vit_base_ytf.encoder.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_base_ytf.encoder.pt
77+
wget -O test/model/marlin_vit_base_ytf.full.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_base_ytf.full.pt
78+
wget -O test/model/marlin_vit_small_ytf.encoder.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_small_ytf.encoder.pt
79+
wget -O test/model/marlin_vit_small_ytf.full.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_small_ytf.full.pt
80+
wget -O test/model/marlin_vit_large_ytf.encoder.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_large_ytf.encoder.pt
81+
wget -O test/model/marlin_vit_large_ytf.full.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_large_ytf.full.pt
82+
83+
- name: Set PYTHONPATH
84+
run: echo "PYTHONPATH=$(pwd)/src" >> $GITHUB_ENV
85+
86+
- name: Run Test
87+
run: | # python -m unittest discover test
88+
python -m unittest test/test_version.py
89+
python -m unittest test/test_marlin_vit_base.py
90+
python -m unittest test/test_marlin_vit_small.py
91+
python -m unittest test/test_marlin_vit_large.py
92+
93+
coverage:
94+
# Run coverage and report to coveralls
95+
name: Coverage
96+
needs: [unittest]
97+
runs-on: ubuntu-20.04
98+
99+
steps:
100+
- uses: actions/checkout@v2
101+
102+
- name: Set up Python
103+
uses: actions/setup-python@v2
104+
with:
105+
python-version: "3.10"
106+
architecture: x64
107+
108+
- name: Install dependencies
109+
run: |
110+
sudo apt install -y ffmpeg wget
111+
pip install torch=="1.13.*"
112+
pip install torchvision=="0.14.*"
113+
pip install -r requirements.lib.txt
114+
python init.py
115+
pip install coverage pytest coveralls
116+
117+
- name: Download model checkpoints
118+
run: |
119+
mkdir test/model
120+
wget -O test/model/marlin_vit_base_ytf.encoder.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_base_ytf.encoder.pt
121+
wget -O test/model/marlin_vit_base_ytf.full.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_base_ytf.full.pt
122+
wget -O test/model/marlin_vit_small_ytf.encoder.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_small_ytf.encoder.pt
123+
wget -O test/model/marlin_vit_small_ytf.full.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_small_ytf.full.pt
124+
wget -O test/model/marlin_vit_large_ytf.encoder.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_large_ytf.encoder.pt
125+
wget -O test/model/marlin_vit_large_ytf.full.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_large_ytf.full.pt
126+
127+
- name: Set PYTHONPATH
128+
run: echo "PYTHONPATH=$(pwd)/src" >> $GITHUB_ENV
129+
130+
- name: Run Coverage
131+
run: coverage run --source=marlin_pytorch -m unittest discover
132+
133+
- name: Coveralls
134+
run: coveralls --service=github
135+
env:
136+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137+
COVERALLS_FLAG_NAME: marlin_pytorch
138+
COVERALLS_PARALLEL: true
139+
140+
coveralls_finish:
141+
name: Coveralls Finish
142+
needs: [coverage]
143+
runs-on: ubuntu-20.04
144+
container: python:3-slim
145+
146+
steps:
147+
- name: Finished
148+
run: |
149+
pip3 install --upgrade coveralls
150+
coveralls --service=github --finish
151+
env:
152+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)