Skip to content

Commit

Permalink
Version 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Labbeti committed Sep 28, 2022
1 parent 589f21b commit 7cdd3ac
Show file tree
Hide file tree
Showing 46 changed files with 3,910 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[flake8]
max-line-length = 88
extend-ignore = W191,E203,E501,E402
show_source = True
exclude =
# No need to traverse our git directory
.git,
# There's no value in checking cache directories
__pycache__,
# The conf file is mostly autogenerated, ignore it
docs/source/conf.py,
# The old directory contains Flake8 2.0
old,
# This contains our built documentation
build,
# This contains builds of flake8 that we don't want to check
dist,
# Ignore notebook checkpoints
.ipynb_checkpoints,
# Ignore submodule caption-evaluation-tools
tests/caption-evaluation-tools
per-file-ignores =
# imported but unused
__init__.py: F401
83 changes: 83 additions & 0 deletions .github/workflows/python-package-pip.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Template: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package using Pip

on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]

jobs:
build:
runs-on: ubuntu-latest

steps:
# --- INSTALLATIONS ---
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Set up Java 11
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'

- name: Load cache of pip dependencies
uses: actions/cache@master
id: cache_requirements
with:
path: ${{ env.pythonLocation }}/lib/python3.9/site-packages/*
key: ${{ runner.os }}-pip-${{ hashFiles('setup.cfg') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install pip dev dependencies + package if needed
if: steps.cache_requirements.outputs.cache-hit == 'false'
run: |
python -m pip install --upgrade pip
python -m pip install -e .[dev]
- name: Install package if needed
if: steps.cache_requirements.outputs.cache-hit == 'true'
run: |
python -m pip install -e . --no-dependencies
- name: Load cache of external code
uses: actions/cache@master
id: cache_external
with:
path: /home/runner/aac-metrics-cache/*
key: ${{ runner.os }}-${{ hashFiles('install_spice.sh') }}
restore-keys: |
${{ runner.os }}-
# --- TESTS ---
- name: Lint with flake8
run: |
python -m flake8 --config .flake8 --exit-zero --show-source --statistics src
- name: Check format with Black
run: |
python -m black --check --diff src
- name: Install external code if needed
if: steps.cache_external.outputs.cache-hit != 'true'
run: |
aac-metrics-download
- name: Print install info
run: |
aac-metrics-info
- name: Test with pytest
run: |
python -m pytest -v
136 changes: 136 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# VSCode dir
.vscode/

tests/caption-evaluation-tools
tmp/
tmp*/
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "caption-evaluation-tools"]
path = tests/caption-evaluation-tools
url = https://github.com/audio-captioning/caption-evaluation-tools
branch = master
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Change log

All notable changes to this project will be documented in this file.

## [0.1.0] 2022-09-28
### Added
- BLEU, METEOR, ROUGE-l, SPICE, CIDEr and SPIDEr metrics functions and modules.
- SPIDEr-max experimental implementation.
- Installation script in download.py.
- Evaluation script in evaluate.py.
- Unittest with `caption-evaluation-tools` repository.
21 changes: 21 additions & 0 deletions LICENCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Etienne Labbé "Labbeti"

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
6 changes: 6 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

recursive-include . *.py
global-exclude *.pyc
global-exclude __pycache__

include install_spice.sh
Loading

0 comments on commit 7cdd3ac

Please sign in to comment.