Skip to content

Commit ac26416

Browse files
authored
Merge pull request #1 from edadaltocg/dev
Merge dev branch into master
2 parents 0ea312e + 66464fc commit ac26416

Some content is hidden

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

85 files changed

+3339
-1672
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_style = space
7+
indent_size = 2
8+
trim_trailing_whitespace = true
9+
insert_final_newline = false
10+
11+
[*.py]
12+
indent_size = 4

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export DATASETS_DIR="storage/"
1+
export DATA_DIR="storage/"
22
export CHECKPOINTS_DIR="checkpoints/"
33
export RESULTS_DIR="results/"

.github/release.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/python-package.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
python-version: ["3.8", "3.9", "3.10"]
19+
python-version: ["3.8"]
2020

2121
steps:
2222
- uses: actions/checkout@v3
@@ -27,14 +27,17 @@ jobs:
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip
30-
python -m pip install flake8 pytest
30+
python -m pip install -r requirements_dev.txt
31+
python -m pip install -e .
3132
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
32-
- name: Lint with flake8
33+
- name: Format and Lint
3334
run: |
35+
black --config pyproject.toml .
36+
isort --settings pyproject.toml .
3437
# stop the build if there are Python syntax errors or undefined names
3538
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
3639
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
37-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
40+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics
3841
- name: Test with pytest
3942
run: |
40-
pytest
43+
coverage run -m pytest -vv tests/models.py

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,13 @@ dmypy.json
147147
/results
148148
/storage
149149
/logs
150-
/checkpoints
150+
/checkpoints*
151151

152152
# .lock
153153
*.lock
154154

155155
# github releases
156156
/releases
157+
158+
/deprecated
159+
/scripts/bash

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Changelog
2+
3+
## Template
4+
5+
Date: YYYY-MM-DD, Version: X.Y.Z, Author: @username, PR: #PR/Issue: #ISSUE (optional), Milestone: description
6+
7+
## History
8+
9+
2023-02-28, 0.1.0, @edadaltocg, Initial release.

README.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p align="center">
22
<br>
3-
<img src="./face-with-monocle.svg" width="150" height="150" />
3+
<img src="./face-with-monocle.svg" width="150" height="150" />
44
<br>
55
</p>
66

@@ -10,3 +10,56 @@
1010
Package to accelerate research on out-of-distribution (OOD) detection inspired by Huggingface's transformers.
1111

1212
Under development.
13+
14+
## Deployment & Documentation & Stats & License
15+
16+
[![PyPi version](https://badgen.net/pypi/v/pip/)](https://pypi.org/project/pip)
17+
18+
[![Documentation Status](https://readthedocs.org/projects/ansicolortags/badge/?version=latest)](http://ansicolortags.readthedocs.io/?badge=latest)
19+
20+
[![GitHub stars](https://img.shields.io/github/stars/Naereen/StrapDown.js.svg?style=social&label=Star&maxAge=2592000)](https://GitHub.com/Naereen/StrapDown.js/stargazers/)
21+
22+
23+
[![GitHub forks](https://badgen.net/github/forks/Naereen/Strapdown.js/)](https://GitHub.com/Naereen/StrapDown.js/network/)
24+
25+
[![PyPI download month](https://img.shields.io/pypi/dm/ansicolortags.svg)](https://pypi.python.org/pypi/ansicolortags/)
26+
27+
[![GitHub contributors](https://img.shields.io/github/contributors/Naereen/badges.svg)](https://GitHub.com/Naereen/badges/graphs/contributors/)
28+
29+
[![DOI:10.1007/978-3-319-76207-4_15](https://zenodo.org/badge/DOI/10.1007/978-3-319-76207-4_15.svg)](https://doi.org/10.1007/978-3-319-76207-4_15)
30+
31+
[![PyPi license](https://badgen.net/pypi/license/pip/)](https://pypi.org/project/pip/)
32+
33+
-----
34+
35+
<!--
36+
## Examples
37+
38+
```python
39+
``` -->
40+
41+
## Features
42+
43+
- Datasets with md5 checksums.
44+
- Models pre-trained on CIFAR and integrated in `timm`.
45+
- Pipeline for evaluating OOD detectors on CIFAR and ImageNet benchmarks.
46+
- Multiple seed simulations.
47+
- Diverse aggregation methods for OOD detection.
48+
- Efficient OOD detection metrics.
49+
50+
## Installation
51+
52+
```bash
53+
pip install detectors
54+
```
55+
56+
<!-- ## TODO
57+
58+
- Pipeline for generating results table.
59+
60+
## Contributing
61+
62+
## Citing detectors
63+
64+
```bibtex
65+
``` -->

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.https://www.sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/source/conf.py

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
import os
14+
import sys
15+
16+
sys.path.insert(0, os.path.abspath("../../src/"))
17+
18+
19+
# -- Project information -----------------------------------------------------
20+
21+
project = "detectors"
22+
copyright = "2023, Eduardo Dadalto"
23+
author = "Eduardo Dadalto"
24+
25+
# The full version, including alpha/beta/rc tags
26+
release = "0.1.0"
27+
28+
29+
# -- General configuration ---------------------------------------------------
30+
31+
# Add any Sphinx extension module names here, as strings. They can be
32+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
33+
# ones.
34+
extensions = [
35+
"sphinx.ext.duration",
36+
"sphinx.ext.doctest",
37+
"sphinx.ext.autodoc",
38+
"sphinx.ext.coverage",
39+
"sphinx.ext.autosummary",
40+
"myst_parser",
41+
"sphinx.ext.napoleon",
42+
"sphinx.ext.imgmath",
43+
"sphinx.ext.viewcode",
44+
"sphinxcontrib.bibtex",
45+
]
46+
47+
source_suffix = [".rst", ".md"]
48+
49+
# Napoleon settings
50+
napoleon_google_docstring = True
51+
napoleon_numpy_docstring = True
52+
napoleon_include_init_with_doc = False
53+
napoleon_include_private_with_doc = False
54+
napoleon_include_special_with_doc = True
55+
napoleon_use_admonition_for_examples = False
56+
napoleon_use_admonition_for_notes = False
57+
napoleon_use_admonition_for_references = False
58+
napoleon_use_ivar = False
59+
napoleon_use_param = True
60+
napoleon_use_rtype = True
61+
napoleon_preprocess_types = False
62+
napoleon_type_aliases = None
63+
napoleon_attr_annotations = True
64+
65+
# Add any paths that contain templates here, relative to this directory.
66+
templates_path = ["_templates"]
67+
68+
# List of patterns, relative to source directory, that match files and
69+
# directories to ignore when looking for source files.
70+
# This pattern also affects html_static_path and html_extra_path.
71+
exclude_patterns = []
72+
73+
74+
# -- Options for HTML output -------------------------------------------------
75+
76+
# The theme to use for HTML and HTML Help pages. See the documentation for
77+
# a list of builtin themes.
78+
#
79+
html_theme = "classic"
80+
81+
# Add any paths that contain custom static files (such as style sheets) here,
82+
# relative to this directory. They are copied after the builtin static files,
83+
# so a file named "default.css" will overwrite the builtin "default.css".
84+
html_static_path = ["_static"]

0 commit comments

Comments
 (0)