Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added darknets pretrained weights #29

Merged
merged 5 commits into from
May 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{% set data = load_setup_py_data(setup_file='../setup.py', from_recipe_dir=True) %}

package:
name: {{ data.name }}
version: "{{ data.version }}"

source:
fn: {{ data.name }}-{{ data.version }}.tar.gz
url: ../dist/{{ data.name }}-{{ data.version }}.tar.gz

build:
number: 0
noarch: python
script: python setup.py install --single-version-externally-managed --record=record.txt

requirements:

host:
- python>=3.6

run:
- pytorch >=1.2.0
- torchvision >=0.4.0

test:
# Python imports
imports:
- holocron
- holocron.models
- holocron.nn
- holocron.ops
- holocron.optim
requires:
- python

about:
home: {{ data.get('url') }}
license: {{ data['license'] }}
license_url: https://github.com/frgfm/Holocron/blob/master/LICENSE
license_file: LICENSE
summary: {{ data['description'] }}
description: |
{{ data['long_description'] | replace("\n", "\n ") | replace("#", '\#')}}
doc_url: https://frgfm.github.io/Holocron/
dev_url: {{ data.get('url') }}
80 changes: 80 additions & 0 deletions .github/workflows/pkg-upload.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: pypi-publish

on:
release:
types: [published, edited]

jobs:

pypi-publish:
if: "!github.event.release.prerelease"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
architecture: x64
- name: Cache python modules
uses: actions/cache@v1.1.2
env:
cache-name: cache-pkg-requirements
with:
path: ~/.cache/pip
key: ${{ runner.os }}-install-${{ env.cache-name }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-install-${{ env.cache-name }}-
${{ runner.os }}-install-
${{ runner.os }}-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine --upgrade
- name: Get release tag
id: release_tag
run: |
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
VERSION: ${{ steps.release_tag.outputs.VERSION }}
run: |
VERSION="${VERSION:1}"
BUILD_VERSION=$VERSION python setup.py sdist bdist_wheel
twine check dist/*
twine upload dist/*

conda-publish:
if: "!github.event.release.prerelease"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Miniconda setup
uses: goanpeca/setup-miniconda@v1
with:
auto-update-conda: true
python-version: 3.7
- name: Install dependencies
run: |
conda install -y conda-build conda-verify anaconda-client
- name: Get release tag
id: release_tag
run: |
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Anaconda login
run: |
conda install -y conda-build conda-verify anaconda-client
- name: Build and publish
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
VERSION: ${{ steps.release_tag.outputs.VERSION }}
run: |
VERSION="${VERSION:1}"
export BUILD_VERSION=$VERSION
python setup.py sdist
mkdir conda-dist
conda-build ./conda/ -c pytorch --output-folder conda-dist
ls -l conda-dist/noarch/*tar.bz2
anaconda upload conda-dist/noarch/*tar.bz2 -u frgfm
6 changes: 3 additions & 3 deletions holocron/models/darknet.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
default_cfgs = {
'darknet24': {'arch': 'DarknetV1',
'layout': [[128, 256, 256, 512], [*([256, 512] * 4), 512, 1024], [512, 1024, 512, 1024]],
'url': None},
'url': 'https://github.com/frgfm/Holocron/releases/download/v0.1.0/darknet24_224-c88d3570.pth'},
'darknet19': {'arch': 'DarknetV2',
'layout': [(128, 1), (256, 1), (512, 2), (1024, 2)],
'url': None},
'url': 'https://github.com/frgfm/Holocron/releases/download/v0.1.0/darknet19_224-44aaede3.pth'},
'darknet53': {'arch': 'DarknetV3',
'layout': [(1, 64, 128), (2, 128, 256), (8, 256, 512), (8, 512, 1024), (4, 1024)],
'url': None},
'url': 'https://github.com/frgfm/Holocron/releases/download/v0.1.0/darknet53_224-f4c640a8.pth'},
}


Expand Down
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[metadata]
description-file = README.md
license_file = LICENSE
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import subprocess
from setuptools import setup, find_packages

version = '0.1.0a0'
version = '0.1.1a0'
sha = 'Unknown'
package_name = 'pylocron'

Expand Down