diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..bc0333f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,100 @@ +name: Similari + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +on: + push: + tags: + - '*' + pull_request: + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +jobs: + + linux: + runs-on: ubuntu-latest + strategy: + matrix: + include: + - docker_file: docker/Dockerfile.manylinux_2_28_ARM64 + name: manylinux-arm + arch: linux/arm64 + - docker_file: docker/Dockerfile.manylinux_2_28_X64 + name: manylinux-x86 + arch: linux/amd64 + steps: + - uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up docker buildx + uses: docker/setup-buildx-action@v2 + + - name: Build docker image + uses: docker/build-push-action@v4 + with: + file: ${{ matrix.docker_file }} + platforms: ${{ matrix.arch }} + tags: similari + push: false + load: true + context: . + + - name: Copy wheels + run: docker run --rm -v $(pwd)/distfiles:/tmp similari cp -R /opt/dist /tmp + + - name: Upload wheels + uses: actions/upload-artifact@v3 + with: + name: wheels + path: distfiles/dist + + - name: Publish to PyPI + if: "startsWith(github.ref, 'refs/tags/')" + uses: PyO3/maturin-action@v1 + env: + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} + with: + command: upload + args: --skip-existing distfiles/dist/* + + windows: + runs-on: windows-latest + strategy: + matrix: + target: [x64] + python: ["3.8", "3.9", "3.10", "3.11", "3.12"] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + architecture: ${{ matrix.target }} + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + working-directory: . + target: ${{ matrix.target }} + args: --release --out dist --find-interpreter + sccache: 'true' + - name: Upload wheels + uses: actions/upload-artifact@v3 + with: + name: wheels + path: dist + - name: Publish to PyPI + if: "startsWith(github.ref, 'refs/tags/')" + uses: PyO3/maturin-action@v1 + env: + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} + with: + command: upload + args: --skip-existing dist/* diff --git a/.github/workflows/docker-maturin-python-3_10.yml b/.github/workflows/docker-maturin-python-3_10.yml deleted file mode 100644 index 971ad5f..0000000 --- a/.github/workflows/docker-maturin-python-3_10.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Docker Python 3.10 - -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -env: - # Use docker.io for Docker Hub if empty - REGISTRY: ghcr.io - # github.repository as / - IMAGE_NAME: ${{ github.repository }} - - -jobs: - build: - - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - # This is used to complete the identity challenge - # with sigstore/fulcio when running outside of PRs. - id-token: write - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - # Workaround: https://github.com/docker/build-push-action/issues/461 - - name: Setup Docker buildx - uses: docker/setup-buildx-action@v2 - - # Login against a Docker registry except on PR - # https://github.com/docker/login-action - - name: Log into registry ${{ env.REGISTRY }} - if: github.event_name != 'pull_request' - uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - # Extract metadata (tags, labels) for Docker - # https://github.com/docker/metadata-action - - name: Extract Docker metadata - id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Build Python API with Maturin (Rust base image) - id: build-and-push - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - with: - context: . - file: docker/python_3.10/Dockerfile - push: false - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/docker-maturin-python-3_11.yml b/.github/workflows/docker-maturin-python-3_11.yml deleted file mode 100644 index 81a040c..0000000 --- a/.github/workflows/docker-maturin-python-3_11.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Docker Python 3.11 - -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -env: - # Use docker.io for Docker Hub if empty - REGISTRY: ghcr.io - # github.repository as / - IMAGE_NAME: ${{ github.repository }} - - -jobs: - build: - - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - # This is used to complete the identity challenge - # with sigstore/fulcio when running outside of PRs. - id-token: write - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - # Workaround: https://github.com/docker/build-push-action/issues/461 - - name: Setup Docker buildx - uses: docker/setup-buildx-action@v2 - - # Login against a Docker registry except on PR - # https://github.com/docker/login-action - - name: Log into registry ${{ env.REGISTRY }} - if: github.event_name != 'pull_request' - uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - # Extract metadata (tags, labels) for Docker - # https://github.com/docker/metadata-action - - name: Extract Docker metadata - id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Build Python API with Maturin (Rust base image) - id: build-and-push - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - with: - context: . - file: docker/python_3.11/Dockerfile - push: false - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/docker-maturin-python-3_8.yml b/.github/workflows/docker-maturin-python-3_8.yml deleted file mode 100644 index ed4eada..0000000 --- a/.github/workflows/docker-maturin-python-3_8.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Docker Python 3.8 - -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -env: - # Use docker.io for Docker Hub if empty - REGISTRY: ghcr.io - # github.repository as / - IMAGE_NAME: ${{ github.repository }} - - -jobs: - build: - - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - # This is used to complete the identity challenge - # with sigstore/fulcio when running outside of PRs. - id-token: write - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - # Workaround: https://github.com/docker/build-push-action/issues/461 - - name: Setup Docker buildx - uses: docker/setup-buildx-action@v2 - - # Login against a Docker registry except on PR - # https://github.com/docker/login-action - - name: Log into registry ${{ env.REGISTRY }} - if: github.event_name != 'pull_request' - uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - # Extract metadata (tags, labels) for Docker - # https://github.com/docker/metadata-action - - name: Extract Docker metadata - id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Build Python API with Maturin (Rust base image) - id: build-and-push - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - with: - context: . - file: docker/python_3.8/Dockerfile - push: false - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/docker-maturin-python-3_9.yml b/.github/workflows/docker-maturin-python-3_9.yml deleted file mode 100644 index 182b801..0000000 --- a/.github/workflows/docker-maturin-python-3_9.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Docker Python 3.9 - -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -env: - # Use docker.io for Docker Hub if empty - REGISTRY: ghcr.io - # github.repository as / - IMAGE_NAME: ${{ github.repository }} - - -jobs: - build: - - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - # This is used to complete the identity challenge - # with sigstore/fulcio when running outside of PRs. - id-token: write - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - # Workaround: https://github.com/docker/build-push-action/issues/461 - - name: Setup Docker buildx - uses: docker/setup-buildx-action@v2 - - # Login against a Docker registry except on PR - # https://github.com/docker/login-action - - name: Log into registry ${{ env.REGISTRY }} - if: github.event_name != 'pull_request' - uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - # Extract metadata (tags, labels) for Docker - # https://github.com/docker/metadata-action - - name: Extract Docker metadata - id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Build Python API with Maturin (Rust base image) - id: build-and-push - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - with: - context: . - file: docker/python_3.9/Dockerfile - push: false - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/docker-maturin-rust-1_67.yml b/.github/workflows/docker-maturin-rust-1_67.yml deleted file mode 100644 index d126d01..0000000 --- a/.github/workflows/docker-maturin-rust-1_67.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Docker Rust 1.67 - -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -env: - # Use docker.io for Docker Hub if empty - REGISTRY: ghcr.io - # github.repository as / - IMAGE_NAME: ${{ github.repository }} - - -jobs: - build: - - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - # This is used to complete the identity challenge - # with sigstore/fulcio when running outside of PRs. - id-token: write - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - # Workaround: https://github.com/docker/build-push-action/issues/461 - - name: Setup Docker buildx - uses: docker/setup-buildx-action@v2 - - # Login against a Docker registry except on PR - # https://github.com/docker/login-action - - name: Log into registry ${{ env.REGISTRY }} - if: github.event_name != 'pull_request' - uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - # Extract metadata (tags, labels) for Docker - # https://github.com/docker/metadata-action - - name: Extract Docker metadata - id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Build Python API with Maturin (Rust base image) - id: build-and-push - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - with: - context: . - file: docker/rust_1.67/Dockerfile - push: false - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/maturin.yml b/.github/workflows/maturin.yml deleted file mode 100644 index 4b8441e..0000000 --- a/.github/workflows/maturin.yml +++ /dev/null @@ -1,97 +0,0 @@ -# This file is autogenerated by maturin v0.15.1 -# To update, run -# -# maturin generate-ci github -o .github/maturin.yml -# -name: Maturin CI - -on: - push: - branches: - - main - - master - tags: - - '*' - pull_request: - workflow_dispatch: - -permissions: - contents: read - -jobs: - linux: - runs-on: ubuntu-latest - strategy: - matrix: - target: [x86_64, aarch64] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Build wheels - uses: PyO3/maturin-action@v1 - with: - target: ${{ matrix.target }} - args: --release --out dist --find-interpreter - sccache: 'true' - manylinux: auto - - name: Upload wheels - uses: actions/upload-artifact@v3 - with: - name: wheels - path: dist - - macos: - runs-on: macos-latest - strategy: - matrix: - target: [x86_64, aarch64] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Build wheels - uses: PyO3/maturin-action@v1 - with: - target: ${{ matrix.target }} - args: --release --out dist --find-interpreter - sccache: 'true' - - name: Upload wheels - uses: actions/upload-artifact@v3 - with: - name: wheels - path: dist - - sdist: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Build sdist - uses: PyO3/maturin-action@v1 - with: - command: sdist - args: --out dist - - name: Upload sdist - uses: actions/upload-artifact@v3 - with: - name: wheels - path: dist - - release: - name: Release - runs-on: ubuntu-latest - if: "startsWith(github.ref, 'refs/tags/')" - needs: [linux, macos, sdist] - steps: - - uses: actions/download-artifact@v3 - with: - name: wheels - - name: Publish to PyPI - uses: PyO3/maturin-action@v1 - env: - MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} - with: - command: upload - args: --skip-existing * diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index 92e2146..0000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Rust 1.67 - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -env: - CARGO_TERM_COLOR: always - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - uses: icepuma/rust-action@1.67.1 - with: - args: cargo fmt -- --check && cargo clippy -- -Dwarnings && cargo test diff --git a/Cargo.toml b/Cargo.toml index e1282f3..28ca280 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ repository = "https://github.com/insight-platform/Similari" readme = "README.md" keywords = ["machine-learning", "similarity", "tracking", "SORT", "DeepSORT"] categories = ["algorithms", "data-structures", "computer-vision", "science"] -version = "0.26.5" +version = "0.26.6" edition = "2021" license="Apache-2.0" rust-version = "1.66" @@ -21,23 +21,23 @@ default = ["python"] python = ["dep:pyo3", "dep:pyo3-build-config","dep:pyo3-log"] [dependencies] -itertools = "0.10" +itertools = "0.12" anyhow = "1.0" thiserror = "1.0" -once_cell = "1.17" -num_cpus = "1.15" +once_cell = "1.19" +num_cpus = "1.16" ultraviolet = "0.9" crossbeam = "0.8" rand = "0.8" log = "0.4" nalgebra = "0.32" -pathfinding = "4.3" -geo = "0.25" -rayon = "1.7" +pathfinding = "4.8" +geo = "0.27" +rayon = "1.8" env_logger = "0.10" [dependencies.pyo3] -version = "0.18" +version = "0.20" features = ["extension-module"] optional = true diff --git a/README.md b/README.md index b9885bf..73a0f84 100644 --- a/README.md +++ b/README.md @@ -14,15 +14,6 @@ Older versions: [![Rust](https://img.shields.io/crates/d/similari.svg)](https://crates.io/crates/similari) [![Rust](https://img.shields.io/github/license/insight-platform/Similari.svg)](https://img.shields.io/github/license/insight-platform/Similari.svg) -Build status: - -[![Rust](https://github.com/insight-platform/Similari/actions/workflows/rust.yml/badge.svg?branch=main)](https://github.com/insight-platform/Similari/actions/workflows/rust.yml) -[![Docker Rust 1.67](https://github.com/insight-platform/Similari/actions/workflows/docker-maturin-rust-1_67.yml/badge.svg?branch=main)](https://github.com/insight-platform/Similari/actions/workflows/docker-maturin-rust-1_67.yml) -[![Docker Python 3.8](https://github.com/insight-platform/Similari/actions/workflows/docker-maturin-python-3_8.yml/badge.svg?branch=main)](https://github.com/insight-platform/Similari/actions/workflows/docker-maturin-python-3_8.yml) -[![Docker Python 3.9](https://github.com/insight-platform/Similari/actions/workflows/docker-maturin-python-3_9.yml/badge.svg?branch=main)](https://github.com/insight-platform/Similari/actions/workflows/docker-maturin-python-3_9.yml) -[![Docker Python 3.10](https://github.com/insight-platform/Similari/actions/workflows/docker-maturin-python-3_10.yml/badge.svg?branch=main)](https://github.com/insight-platform/Similari/actions/workflows/docker-maturin-python-3_10.yml) -[![Docker Python 3.11](https://github.com/insight-platform/Similari/actions/workflows/docker-maturin-python-3_11.yml/badge.svg?branch=main)](https://github.com/insight-platform/Similari/actions/workflows/docker-maturin-python-3_11.yml) - :star: Star us on GitHub — it motivates us a lot! Similari is a Rust framework with Python bindings that helps build sophisticated tracking systems. With Similari one diff --git a/docker/Dockerfile.manylinux_2_28_ARM64 b/docker/Dockerfile.manylinux_2_28_ARM64 new file mode 100644 index 0000000..cac7e29 --- /dev/null +++ b/docker/Dockerfile.manylinux_2_28_ARM64 @@ -0,0 +1,10 @@ +FROM ghcr.io/insight-platform/manylinux_2_28_arm64:v0.0.3 as builder + +WORKDIR /opt +COPY . . +ARG PYTHON_INTERPRETER +RUN bash /opt/docker/build-manylinux.sh +RUN rm -rf target + +FROM alpine:3.18 as dist +COPY --from=builder /opt/dist /opt/dist diff --git a/docker/Dockerfile.manylinux_2_28_X64 b/docker/Dockerfile.manylinux_2_28_X64 new file mode 100644 index 0000000..7ead5a9 --- /dev/null +++ b/docker/Dockerfile.manylinux_2_28_X64 @@ -0,0 +1,10 @@ +FROM ghcr.io/insight-platform/manylinux_2_28_x64:v0.0.3 as builder + +WORKDIR /opt +COPY . . +ARG PYTHON_INTERPRETER +RUN bash /opt/docker/build-manylinux.sh +RUN rm -rf target + +FROM alpine:3.18 as dist +COPY --from=builder /opt/dist /opt/dist diff --git a/docker/build-manylinux.sh b/docker/build-manylinux.sh new file mode 100644 index 0000000..2f87afc --- /dev/null +++ b/docker/build-manylinux.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -e + +ARGS=-f + +if [[ -z $PYTHON_INTERPRETER ]]; then + ARGS=-f +else + ARGS="-i $PYTHON_INTERPRETER" +fi + +echo "Additional build args: $ARGS" + +maturin build $ARGS --release --out /opt/dist + diff --git a/docker/common/install-basic-deps.sh b/docker/common/install-basic-deps.sh deleted file mode 100644 index 234f329..0000000 --- a/docker/common/install-basic-deps.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -set -e - -apt-get update && apt-get install -y curl python3 build-essential python3-dev python3-pip - -curl -o rustup.sh --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -sh rustup.sh -y -source $HOME/.cargo/env -rustup update -rustc -V - -cargo install cargo-chef --locked - -/usr/bin/python3 -m pip install --upgrade pip -/usr/bin/python3 -m pip install --upgrade maturin~=0.15 diff --git a/docker/python_3.10/Dockerfile b/docker/python_3.10/Dockerfile deleted file mode 100644 index 9a20afb..0000000 --- a/docker/python_3.10/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM python:3.10-bullseye as base - -WORKDIR /opt -COPY docker/common/install-basic-deps.sh . -RUN bash /opt/install-basic-deps.sh - -FROM base as chef -ENV PATH="/root/.cargo/bin:$PATH" -RUN rustc -V - -FROM chef AS planner -WORKDIR /opt -COPY . . -RUN cargo chef prepare --recipe-path recipe.json - -FROM chef AS builder -WORKDIR /opt -COPY --from=planner /opt/recipe.json recipe.json -RUN cargo chef cook --release --recipe-path recipe.json -COPY .cargo/config /root/.cargo/ -COPY . . - -ENV RUSTFLAGS=" -C target-cpu=native -C opt-level=3" - -RUN maturin build --release --out dist -RUN python3 -m pip install --upgrade pip -RUN python3 -m pip install dist/*.whl diff --git a/docker/python_3.11/Dockerfile b/docker/python_3.11/Dockerfile deleted file mode 100644 index ea0c2a5..0000000 --- a/docker/python_3.11/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM python:3.11-bullseye as base - -WORKDIR /opt -COPY docker/common/install-basic-deps.sh . -RUN bash /opt/install-basic-deps.sh - -FROM base as chef -ENV PATH="/root/.cargo/bin:$PATH" -RUN rustc -V - -FROM chef AS planner -WORKDIR /opt -COPY . . -RUN cargo chef prepare --recipe-path recipe.json - -FROM chef AS builder -WORKDIR /opt -COPY --from=planner /opt/recipe.json recipe.json -RUN cargo chef cook --release --recipe-path recipe.json -COPY .cargo/config /root/.cargo/ -COPY . . - -ENV RUSTFLAGS=" -C target-cpu=native -C opt-level=3" - -RUN maturin build --release --out dist -RUN python3 -m pip install --upgrade pip -RUN python3 -m pip install dist/*.whl diff --git a/docker/python_3.8/Dockerfile b/docker/python_3.8/Dockerfile deleted file mode 100644 index dc63c14..0000000 --- a/docker/python_3.8/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM python:3.8-buster as base - -WORKDIR /opt -COPY docker/common/install-basic-deps.sh . -RUN bash /opt/install-basic-deps.sh - -FROM base as chef -ENV PATH="/root/.cargo/bin:$PATH" -RUN rustc -V - -FROM chef AS planner -WORKDIR /opt -COPY . . -RUN cargo chef prepare --recipe-path recipe.json - -FROM chef AS builder -WORKDIR /opt -COPY --from=planner /opt/recipe.json recipe.json -RUN cargo chef cook --release --recipe-path recipe.json -COPY .cargo/config /root/.cargo/ -COPY . . - -ENV RUSTFLAGS=" -C target-cpu=native -C opt-level=3" - -RUN maturin build --release --out dist -RUN python3 -m pip install --upgrade pip -RUN python3 -m pip install dist/*.whl diff --git a/docker/python_3.9/Dockerfile b/docker/python_3.9/Dockerfile deleted file mode 100644 index e119d46..0000000 --- a/docker/python_3.9/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM python:3.9-bullseye as base - -WORKDIR /opt -COPY docker/common/install-basic-deps.sh . -RUN bash /opt/install-basic-deps.sh - -FROM base as chef -ENV PATH="/root/.cargo/bin:$PATH" -RUN rustc -V - -FROM chef AS planner -WORKDIR /opt -COPY . . -RUN cargo chef prepare --recipe-path recipe.json - -FROM chef AS builder -WORKDIR /opt -COPY --from=planner /opt/recipe.json recipe.json -RUN cargo chef cook --release --recipe-path recipe.json -COPY .cargo/config /root/.cargo/ -COPY . . - -ENV RUSTFLAGS=" -C target-cpu=native -C opt-level=3" - -RUN maturin build --release --out dist -RUN python3 -m pip install --upgrade pip -RUN python3 -m pip install dist/*.whl diff --git a/docker/rust_1.67/Dockerfile b/docker/rust_1.67/Dockerfile deleted file mode 100644 index 866e4b0..0000000 --- a/docker/rust_1.67/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM rust:1.67-bullseye as chef - -RUN cargo install cargo-chef --locked -#RUN apt-get update && apt-get install -y python3 build-essential python3-dev python3-pip -#RUN /usr/bin/python3 -m pip install --upgrade pip -#RUN /usr/bin/python3 -m pip install --upgrade maturin~=0.13 - -FROM chef AS planner -WORKDIR /opt -COPY . . -RUN cargo chef prepare --recipe-path recipe.json - -FROM chef AS builder -WORKDIR /opt -COPY --from=planner /opt/recipe.json recipe.json -RUN cargo chef cook --release --recipe-path recipe.json -COPY .cargo/config /root/.cargo/ -COPY . . - -ENV RUSTFLAGS=" -C target-cpu=native -C opt-level=3" - -RUN cargo build --release - - - - - diff --git a/src/trackers.rs b/src/trackers.rs index 1d0c3ee..0719b2c 100644 --- a/src/trackers.rs +++ b/src/trackers.rs @@ -3,7 +3,7 @@ pub mod sort; /// Trait that implements epoch db management -mod epoch_db; +pub mod epoch_db; /// Visual tracker implementations pub mod visual_sort; diff --git a/src/trackers/sort/simple_api.rs b/src/trackers/sort/simple_api.rs index ef94bd7..e7e450d 100644 --- a/src/trackers/sort/simple_api.rs +++ b/src/trackers/sort/simple_api.rs @@ -435,10 +435,8 @@ pub mod python { use super::Sort; use pyo3::prelude::*; - #[pyclass( - name = "Sort", - text_signature = "(shards, bbox_history, max_idle_epochs, threshold)" - )] + #[pyclass] + #[pyo3(name = "Sort")] pub struct PySort(pub Sort); #[pymethods] diff --git a/src/trackers/visual_sort.rs b/src/trackers/visual_sort.rs index 93ecbd3..e6cab62 100644 --- a/src/trackers/visual_sort.rs +++ b/src/trackers/visual_sort.rs @@ -168,9 +168,7 @@ pub mod python { } } - #[pyclass( - text_signature = "(feature_opt, feature_quality_opt, bounding_box, custom_object_id_opt)" - )] + #[pyclass] #[derive(Debug, Clone)] #[pyo3(name = "VisualSortObservation")] pub struct PyVisualSortObservation(pub(crate) VisualSortObservation<'static>); @@ -205,9 +203,7 @@ pub mod python { } } - #[pyclass( - text_signature = "(feature_opt, feature_quality_opt, bounding_box, custom_object_id_opt)" - )] + #[pyclass] #[derive(Debug)] #[pyo3(name = "VisualSortObservationSet")] pub struct PyVisualSortObservationSet(pub(crate) VisualSortObservationSet<'static>); diff --git a/src/trackers/visual_sort/batch_api.rs b/src/trackers/visual_sort/batch_api.rs index ca5b447..0db7265 100644 --- a/src/trackers/visual_sort/batch_api.rs +++ b/src/trackers/visual_sort/batch_api.rs @@ -503,7 +503,7 @@ pub mod python { use super::{BatchVisualSort, VisualSortPredictionBatchRequest}; - #[pyclass(text_signature = "(distance_shards, voting_shards, opts)")] + #[pyclass] #[pyo3(name = "BatchVisualSort")] pub struct PyBatchVisualSort(pub(crate) BatchVisualSort); diff --git a/src/trackers/visual_sort/simple_api.rs b/src/trackers/visual_sort/simple_api.rs index 037a20e..3e96d07 100644 --- a/src/trackers/visual_sort/simple_api.rs +++ b/src/trackers/visual_sort/simple_api.rs @@ -685,7 +685,7 @@ pub mod python { use super::VisualSort; - #[pyclass(text_signature = "(shards, opts)")] + #[pyclass] #[pyo3(name = "VisualSort")] pub struct PyVisualSort(pub(crate) VisualSort); diff --git a/src/utils/kalman/kalman_2d_box.rs b/src/utils/kalman/kalman_2d_box.rs index 8615977..87f3ba6 100644 --- a/src/utils/kalman/kalman_2d_box.rs +++ b/src/utils/kalman/kalman_2d_box.rs @@ -72,7 +72,7 @@ impl Universal2DBoxKalmanFilter { let mut std: SVector = SVector::from_iterator( self.std_position(2.0, 1e-2, bbox.height) .into_iter() - .chain(self.std_velocity(10.0, 1e-5, bbox.height).into_iter()), + .chain(self.std_velocity(10.0, 1e-5, bbox.height)), ); std = std.component_mul(&std); @@ -89,7 +89,7 @@ impl Universal2DBoxKalmanFilter { let std_vel = self.std_velocity(1.0, 1e-5, mean[4]); let mut std: SVector = - SVector::from_iterator(std_pos.into_iter().chain(std_vel.into_iter())); + SVector::from_iterator(std_pos.into_iter().chain(std_vel)); std = std.component_mul(&std); diff --git a/src/utils/kalman/kalman_2d_point.rs b/src/utils/kalman/kalman_2d_point.rs index 9c90db8..27c828c 100644 --- a/src/utils/kalman/kalman_2d_point.rs +++ b/src/utils/kalman/kalman_2d_point.rs @@ -54,7 +54,7 @@ impl Point2DKalmanFilter { let mut std: SVector = SVector::from_iterator( self.std_position(2.0) .into_iter() - .chain(self.std_velocity(10.0).into_iter()), + .chain(self.std_velocity(10.0)), ); std = std.component_mul(&std); @@ -70,7 +70,7 @@ impl Point2DKalmanFilter { let std_vel = self.std_velocity(1.0); let mut std: SVector = - SVector::from_iterator(std_pos.into_iter().chain(std_vel.into_iter())); + SVector::from_iterator(std_pos.into_iter().chain(std_vel)); std = std.component_mul(&std);