update version and fix bug that cannot run without cupy

This commit is contained in:
unknown
2026-01-20 17:06:28 +08:00
parent 3f92d5161b
commit 8654594ede
6 changed files with 16 additions and 16 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ def install_nuitka():
def build():
install_nuitka()
version = "0.2.0"
version = "0.2.1"
src_dir = Path("src/orisys")
output_dir = Path("build_nuitka")
dist_dir = Path("dist_nuitka")
+1 -1
View File
@@ -16,7 +16,7 @@ def install_nuitka():
def build():
install_nuitka()
version = "0.2.0"
version = "0.2.1"
src_dir = Path("src/orisys")
output_dir = Path("build_nuitka")
dist_dir = Path("dist_nuitka")
+2 -2
View File
@@ -19,11 +19,11 @@ def main():
# 步骤1:创建传感器对象 (必要步骤),config_name为配置文件名(内置配置文件名)或路径(自定义配置文件路径)
# 方式1: 从视频文件读取
# sensor = orisys.Sensor("s1.mp4", config_name="./config/prototype_of3.json", cal_path= "./config/cal.npy", isstitch=True, cuda=True, verbose=True)
sensor = orisys.Sensor("s1.mp4", config_name="./config/prototype_of3.json", cal_path= "./config/cal.npy", isstitch=True, cuda=True, verbose=True)
# 方式2: 从摄像头读取(取消注释使用)
sensor = orisys.Sensor(0, config_name="./config/prototype_of3.json", cal_path= "./config/cal.npy", isstitch=True, cuda=True, verbose=True)
# sensor = orisys.Sensor(0, config_name="./config/prototype_of3.json", cal_path= "./config/cal.npy", isstitch=True, cuda=True, verbose=True)
print("\n按 'q' 退出程序,按 'r' 重置光流追踪器")
+1 -2
View File
@@ -9,7 +9,7 @@ if configs_dir.exists():
setup(
name="orisys",
version="0.2.0",
version="0.2.1",
description="Orisys - Optical Tactile Sensor SDK",
author="Your Name",
package_dir={"": "src"},
@@ -21,7 +21,6 @@ setup(
install_requires=[
"numpy>=1.24.4",
"opencv-python>=4.10.0.84",
"opencv-contrib-python",
"scipy>=1.10.1",
],
extras_require={
+10 -9
View File
@@ -36,12 +36,13 @@ try:
CUPY_AVAILABLE = True
# Try to import CuPy streams for parallel execution
try:
from cupy.cuda import Stream
STREAMS_AVAILABLE = True
except ImportError:
Stream = None
STREAMS_AVAILABLE = False
if CUPY_AVAILABLE:
try:
from cupy.cuda import Stream
STREAMS_AVAILABLE = True
except ImportError:
Stream = None
STREAMS_AVAILABLE = False
# Create fused elementwise kernel for torque computation
# Computes cross products and combines them in a single kernel pass
@@ -103,9 +104,9 @@ class nHHD(object):
raise ValueError("nHHD Solver works only for 2 and 3 dimensions")
self.psolver.prepare(False)
self.stream1 = cp.cuda.Stream()
self.stream2 = cp.cuda.Stream()
if CUPY_AVAILABLE:
self.stream1 = cp.cuda.Stream()
self.stream2 = cp.cuda.Stream()
# create the 3-component decomposition
def decompose(self, vfield, verbose=0):
+1 -1
View File
@@ -5,7 +5,7 @@ A Python library for processing and analyzing optical tactile sensor data,
including image stitching, optical flow tracking, and deformation decomposition.
"""
__version__ = "0.2.0"
__version__ = "0.2.1"
__author__ = "Orisys"
from .sensor import Sensor