Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ControlNet committed Aug 31, 2023
1 parent 0348eef commit 52754c0
Show file tree
Hide file tree
Showing 102 changed files with 13,947 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Release
on:
push:
branches:
- "master"
jobs:

check-version:
name: Check Version
runs-on: ubuntu-20.04
outputs:
local-version: ${{ steps.get-local-version.outputs.version }}
remote-version: ${{ steps.get-remote-version.outputs.version }}
steps:
- uses: actions/checkout@v2
- name: Get Local Version
id: get-local-version
run: echo "version=$(cat version.txt)" >> $GITHUB_OUTPUT
- name: Get Remote Version
id: get-remote-version
run: echo "version=$(curl -s https://pypi.org/pypi/marlin_pytorch/json | jq -r '.info.version')" >> $GITHUB_OUTPUT

release:
runs-on: ubuntu-20.04
needs: check-version
if: needs.check-version.outputs.local-version != needs.check-version.outputs.remote-version

strategy:
matrix:
python-version: ["3.9"]

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Install dependencies
run: |
pip install -r requirements.lib.txt
python init.py
- name: Build package for marlin_pytorch
run: python setup.py sdist bdist_wheel

- name: Release marlin_pytorch to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Get the version
run: |
VER=$(cat version.txt)
echo "VERSION=$VER" >> $GITHUB_ENV
- name: Release to GitHub Release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ env.VERSION }}"
title: "[${{ env.VERSION }}] Marlin-PyTorch Release"
prerelease: false
files: "dist/*"
draft: true
152 changes: 152 additions & 0 deletions .github/workflows/unittest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
name: Unittest
on:
push:
branches-ignore:
- "master"
pull_request:

jobs:
unittest:
name: Unittest

strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
torch-version: ["1.8.*", "1.9.*", "1.10.*", "1.11.*", "1.12.*", "1.13.*"]
include:
- torch-version: "1.8.*"
torchvision-version: "0.9.*"
- torch-version: "1.9.*"
torchvision-version: "0.10.*"
- torch-version: "1.10.*"
torchvision-version: "0.11.*"
- torch-version: "1.11.*"
torchvision-version: "0.12.*"
- torch-version: "1.12.*"
torchvision-version: "0.13.*"
- torch-version: "1.13.*"
torchvision-version: "0.14.*"
exclude:
- python-version: "3.6"
torch-version: "1.11.*"
- python-version: "3.6"
torch-version: "1.12.*"
- python-version: "3.6"
torch-version: "1.13.*"
- python-version: "3.10"
torch-version: "1.8.*"
- python-version: "3.10"
torch-version: "1.9.*"
- python-version: "3.10"
torch-version: "1.10.*"

runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3

- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 10

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Install PyAV Dependencies for Python 3.6
if: matrix.python-version == '3.6'
run: |
sudo apt install -y libavformat-dev libavdevice-dev
- name: Install dependencies
run: |
sudo apt install -y ffmpeg wget
pip install torch==${{ matrix.torch-version }}
pip install torchvision==${{ matrix.torchvision-version }}
pip install -r requirements.lib.txt
python init.py
- name: Download model checkpoints
run: |
mkdir test/model
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
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
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
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
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
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
- name: Set PYTHONPATH
run: echo "PYTHONPATH=$(pwd)/src" >> $GITHUB_ENV

- name: Run Test
run: | # python -m unittest discover test
python -m unittest test/test_version.py
python -m unittest test/test_marlin_vit_base.py
python -m unittest test/test_marlin_vit_small.py
python -m unittest test/test_marlin_vit_large.py
coverage:
# Run coverage and report to coveralls
name: Coverage
needs: [unittest]
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
architecture: x64

- name: Install dependencies
run: |
sudo apt install -y ffmpeg wget
pip install torch=="1.13.*"
pip install torchvision=="0.14.*"
pip install -r requirements.lib.txt
python init.py
pip install coverage pytest coveralls
- name: Download model checkpoints
run: |
mkdir test/model
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
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
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
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
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
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
- name: Set PYTHONPATH
run: echo "PYTHONPATH=$(pwd)/src" >> $GITHUB_ENV

- name: Run Coverage
run: coverage run --source=marlin_pytorch -m unittest discover

- name: Coveralls
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: marlin_pytorch
COVERALLS_PARALLEL: true

coveralls_finish:
name: Coveralls Finish
needs: [coverage]
runs-on: ubuntu-20.04
container: python:3-slim

steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 52754c0

Please sign in to comment.