From f4cc46ed1411aa9bf8d1d3080935f430536e22cb Mon Sep 17 00:00:00 2001 From: Alex Liberzon Date: Sat, 21 Dec 2024 23:49:06 +0200 Subject: [PATCH] added the files to previous commit --- .gitignore | 1 + py_bind/optv/correspondences.pyx | 6 +++--- py_bind/pyproject.toml | 7 ++----- py_bind/setup.py | 11 +++++++++-- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index cb7ee50..373676b 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ py_bind/wheelhouse/* *.pyd *.pyc *.so +py_bind/optv/*.html diff --git a/py_bind/optv/correspondences.pyx b/py_bind/optv/correspondences.pyx index 0c35399..494d5d7 100644 --- a/py_bind/optv/correspondences.pyx +++ b/py_bind/optv/correspondences.pyx @@ -85,7 +85,7 @@ cdef class MatchedCoords: """ cdef: np.ndarray[ndim=2, dtype=np.float64_t] positions - np.ndarray[ndim=1, dtype=np.int32_t] point_numbers + np.ndarray[ndim=1, dtype=np.int64_t] point_numbers int pt positions = np.empty((self._num_pts, 2)) @@ -98,7 +98,7 @@ cdef class MatchedCoords: return positions, point_numbers - def get_by_pnrs(self, np.ndarray[ndim=1, dtype=np.int32_t] pnrs): + def get_by_pnrs(self, np.ndarray[ndim=1, dtype=np.int64_t] pnrs): """ Return the flat positions of points whose pnr property is given, as an (n,2) flat position array. Assumes all pnrs are to be found, otherwise @@ -161,7 +161,7 @@ def correspondences(list img_pts, list flat_coords, list cals, num_cams * sizeof(coord_2d *)) frame frm - np.ndarray[ndim=2, dtype=np.int32_t] clique_ids + np.ndarray[ndim=2, dtype=np.int64_t] clique_ids np.ndarray[ndim=3, dtype=np.float64_t] clique_targs # Return buffers: diff --git a/py_bind/pyproject.toml b/py_bind/pyproject.toml index b87fe7b..596d9b7 100644 --- a/py_bind/pyproject.toml +++ b/py_bind/pyproject.toml @@ -1,6 +1,6 @@ [build-system] -requires = ["flit_core >=2,<4"] -build-backend = "flit_core.buildapi" +requires = ["setuptools","numpy","cython","pyyaml"] +build-backend = "setuptools.build_meta" [project] name = "optv" @@ -13,6 +13,3 @@ dependencies = [ "numpy", "cython" ] - -[tool.cibuildwheel] -before-build = "pip install numpy cython && cd py_bind && python setup.py prepare" diff --git a/py_bind/setup.py b/py_bind/setup.py index 7af2452..80f8e30 100644 --- a/py_bind/setup.py +++ b/py_bind/setup.py @@ -1,14 +1,21 @@ # -*- coding: utf-8 -*- -from distutils.core import setup +# from distutils.core import setup import setuptools import os import shutil import sys import glob -from setuptools import Extension +from setuptools import Extension, setup from setuptools.command.build_ext import build_ext +from Cython.Compiler import Options import importlib +import numpy as np + + +# These are optional +Options.docstrings = True +Options.annotate = True class PrepareCommand(setuptools.Command):