Skip to content

Commit

Permalink
Merge branch 'develop' into feat/grounding_dino
Browse files Browse the repository at this point in the history
  • Loading branch information
cpvannier authored Feb 29, 2024
2 parents b211a9a + 39f8436 commit 2b41772
Show file tree
Hide file tree
Showing 20 changed files with 143 additions and 63 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Format top-level Markdown and YAML files with Prettier
uses: creyD/[email protected]
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Format backend code with black
uses: psf/black@stable
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,23 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: "3.10"

# Install PyTorch and TensorFlow CPU versions manually to prevent installing CUDA
# Install SAM and MobileSAM manually as they cannot be included in PyPI
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pylint
python -m pip install torch~=2.2.0 torchaudio~=2.2.0 torchvision~=0.17.0 --index-url https://download.pytorch.org/whl/cpu
python -m pip install tensorflow-cpu~=2.15.0
python -m pip install segment-anything@git+https://github.com/facebookresearch/segment-anything
python -m pip install mobile-sam@git+https://github.com/ChaoningZhang/MobileSAM
python -m pip install .
- name: Lint backend code with Pylint
Expand Down
86 changes: 86 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# @Copyright: CEA-LIST/DIASI/SIALV/LVA (2023)
# @Author: CEA-LIST/DIASI/SIALV/LVA <[email protected]>
# @License: CECILL-C
#
# This software is a collaborative computer program whose purpose is to
# generate and explore labeled data for computer vision applications.
# This software is governed by the CeCILL-C license under French law and
# abiding by the rules of distribution of free software. You can use,
# modify and/ or redistribute the software under the terms of the CeCILL-C
# license as circulated by CEA, CNRS and INRIA at the following URL
#
# http://www.cecill.info

# This workflow will publish the new version of Pixano Inference to PyPI when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Publish

on:
release:
types: [published]

permissions:
contents: write

jobs:
deploy_pypi:
name: Build and publish to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install hatch
- name: Build package
run: hatch build

- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1

deploy_docs:
name: Publish documentation website
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Configure git credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Create cache_id for key creation
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV

- name: Create cache key with cache_id
uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Install dependencies
run: pip install .[documentation]

- name: Publish documentation website
run: mkdocs gh-deploy --force
32 changes: 14 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,37 @@ All notable changes to Pixano will be documented in this file.

## [Unreleased]

## [0.3.0b2] - 2024-02-19
## [0.3.0] - 2024-02-29

### Added

- Publish **Pixano Inference on PyPI**
- Add **new MobileSAM model** as a lighter alternative to SAM (pixano/pixano-inference#2)
- Add issue and pull request templates on GitHub repository

### Fixed

- Fix ignored members in linting CI configuration
- Specify black version in formatting CI configuration
- Fix GitHub version and documentation links in README

## [0.3.0b1] - 2024-01-23

### Added

- Add GitHub actions to format and lint code
- Add GitHub action to publish docs and PyPI package (pixano/pixano-inference#9)
- Add issue and pull request templates on GitHub repository
- Add CONTRIBUTING.md for installation information and contribution guidelines

### Changed

- **Breaking:** Remove SAM and MobileSAM dependencies to allow publishing to PyPI (pixano/pixano-inference#14)
- **Breaking:** Update to Pixano 0.5.0
- **Breaking:** Update InferenceModel `id` attribute to `model_id` to stop redefining built-in `id`
- **Breaking:** Update submodule names to `pytorch` and `tensorflow`
- Update README with a small header description listing main features and more detailed installation instructions
- Generate API reference automatically
- Update documentation website accent color to complementary color of the Pixano main accent color
- Add cross-references to Pixano, TensorFlow, and Hugging Face Transformers in the API reference of the documentation website
- Generate API reference on documentation website automatically
- Add cross-references to Pixano, TensorFlow, and Hugging Face Transformers in the API reference
- Update documentation deployment (pixano/pixano-inference#9)

### Fixed

- Fix links to Pixano notebooks
- Fix internal cross-references in the API reference of the documentation website
- Update deprecated GitHub actions (pixano/pixano-inference#11)
- Prevent CUDA installation in lint GitHub action action
- Fix ignored members in linting CI configuration
- Specify black version in formatting CI configuration
- Fix GitHub version and documentation links in README

## [0.2.1] - 2023-11-13

Expand Down Expand Up @@ -117,8 +114,7 @@ All notable changes to Pixano will be documented in this file.
- Create first public release

[Unreleased]: https://github.com/pixano/pixano/compare/main...develop
[0.3.0b2]: https://github.com/pixano/pixano-inference/compare/v0.3.0b1...v0.3.0b2
[0.3.0b1]: https://github.com/pixano/pixano-inference/compare/v0.2.1...v0.3.0b1
[0.3.0]: https://github.com/pixano/pixano-inference/compare/v0.2.1...v0.3.0
[0.2.1]: https://github.com/pixano/pixano-inference/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/pixano/pixano-inference/compare/v0.1.6...v0.2.0
[0.1.6]: https://github.com/pixano/pixano-inference/compare/v0.1.5...v0.1.6
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ conda activate pixano_env
Then, you can install Pixano Inference inside that environment with pip:

```shell
pip install pixano-inference@git+https://github.com/pixano/pixano-inference
pip install pixano-inference
```

As it is a requirement of Pixano Inference, Pixano will automatically be downloaded if it is not already installed.
Expand Down
2 changes: 1 addition & 1 deletion docs/code/index.md → docs/api_reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
Here you will find the documentation for all of our implemented models.

- The **_pytorch_** module contains models from the PyTorch library.
- The **_segment_anything_** module contains the Segment Anything Model (SAM) for Meta.
- The **_github_** module contains the Segment Anything Model (SAM) for Meta.
- The **_tensorflow_** module contains models from the TensorFlow library.
- The **_transformers_** module contains models from the Hugging Face Transformers library.
2 changes: 1 addition & 1 deletion docs/assets/extra.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
:root {
--md-primary-fg-color: #1e7736;
--md-primary-fg-color: #771e5f;
}
2 changes: 1 addition & 1 deletion docs/gen_ref_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import mkdocs_gen_files

SRC_PATH = "pixano_inference"
REF_PATH = "code"
REF_PATH = "api_reference"
IGNORED_FILES = ["__init__.py", "__version__.py"]

nav = mkdocs_gen_files.Nav()
Expand Down
5 changes: 5 additions & 0 deletions docs/getting_started/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Getting started with Pixano Inference

- [Installing Pixano Inference](installing_pixano_inference.md)
- [Using pre-annotation models](pre_annotation.md)
- [Using interactive annotation models](interactive_annotation.md)
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,12 @@ Then, you can install the Pixano and Pixano Inference packages inside that envir

```shell
pip install pixano
pip install pixano-inference@git+https://github.com/pixano/pixano-inference
pip install pixano-inference
```

To use the inference models available through GitHub, install the following additional packages:

```shell
python -m pip install segment-anything@git+https://github.com/facebookresearch/segment-anything
python -m pip install mobile-sam@git+https://github.com/ChaoningZhang/MobileSAM
```
File renamed without changes.
File renamed without changes.
14 changes: 0 additions & 14 deletions docs/index.md

This file was deleted.

7 changes: 0 additions & 7 deletions docs/user/index.md

This file was deleted.

25 changes: 14 additions & 11 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
site_name: Pixano Inference Documentation
site_name: Pixano Documentation
theme:
name: material
logo: assets/pixano_white.png
Expand Down Expand Up @@ -55,6 +55,9 @@ plugins:
- docs/gen_ref_pages.py
- literate-nav:
nav_file: SUMMARY.md
- redirects:
redirect_maps:
"index.md": "getting_started/index.md"
- mkdocstrings:
enable_inventory: true
handlers:
Expand All @@ -68,7 +71,7 @@ plugins:
- https://arrow.apache.org/docs/objects.inv
- https://docs.pydantic.dev/2.4/objects.inv
- https://ipython.readthedocs.io/en/8.13.2/objects.inv
- https://pixano.github.io/objects.inv
- https://pixano.github.io/pixano/objects.inv
- https://pytorch.org/docs/master/objects.inv
- url: https://github.com/GPflow/tensorflow-intersphinx/raw/master/tf2_py_objects.inv
base_url: https://www.tensorflow.org/api_docs/python
Expand All @@ -87,14 +90,14 @@ plugins:
heading_level: 1

nav:
- "Home": index.md
- "Home": https://pixano.github.io/

- "Getting started":
- user/index.md
- "Installing Pixano Inference": user/install.md
- "Pre-annotation": user/pre_annotation.md
- "Interactive annotation": user/interactive_annotation.md
- "Pixano": https://pixano.github.io/pixano/

- "API reference": code/

- "Pixano": https://pixano.github.io
- "Pixano Inference":
- "Getting started":
- getting_started/index.md
- "Installing Pixano Inference": getting_started/installing_pixano_inference.md
- "Pre-annotation": getting_started/pre_annotation.md
- "Interactive annotation": getting_started/interactive_annotation.md
- "API reference": api_reference/
2 changes: 1 addition & 1 deletion pixano_inference/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
#
# http://www.cecill.info

__version__ = "0.3.0b2"
__version__ = "0.3.0"
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ dependencies = [
"torchvision ~= 0.17.0",
"tensorflow ~= 2.15.0",
"tensorflow-hub ~= 0.15.0",
"segment-anything@git+https://github.com/facebookresearch/segment-anything",
"mobile-sam@git+https://github.com/ChaoningZhang/MobileSAM",
"groundingdino@git+https://github.com/IDEA-Research/GroundingDINO",
"transformers >= 4.33.0",
"timm >= 0.9.12",
"gitpython >= 3.1.30",
Expand All @@ -50,6 +47,7 @@ documentation = [
"mkdocstrings-python ~= 1.7.0",
"mkdocs-gen-files ~= 0.5.0",
"mkdocs-literate-nav ~= 0.6.0",
"mkdocs-redirects ~= 1.2.1",
]

[project.urls]
Expand Down

0 comments on commit 2b41772

Please sign in to comment.