From 3c3f64fc7058bb25d774729a8936cc5c15ba8442 Mon Sep 17 00:00:00 2001 From: naokiyokoyama Date: Tue, 22 Oct 2024 14:53:33 -0400 Subject: [PATCH] setting numpy and opencv versions, fixing video colormap bug with new versions --- pyproject.toml | 3 ++- vlfm/vlm/detections.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7cccd48..f09c720 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ requires-python = ">=3.9" dependencies = [ "torch == 1.12.1", "torchvision == 0.13.1", - "numpy >= 1.22.4", + "numpy == 1.26.4", "flask >= 2.3.2", "seaborn >= 0.12.2", # required by yolov7 "open3d >= 0.17.0", @@ -25,6 +25,7 @@ dependencies = [ "frontier_exploration @ git+https://github.com/naokiyokoyama/frontier_exploration.git", "mobile_sam @ git+https://github.com/ChaoningZhang/MobileSAM.git", "depth_camera_filtering @ git+https://github.com/naokiyokoyama/depth_camera_filtering", + "opencv-python == 4.5.5.64" ] [project.optional-dependencies] diff --git a/vlfm/vlm/detections.py b/vlfm/vlm/detections.py index 20c823a..9a6ac30 100644 --- a/vlfm/vlm/detections.py +++ b/vlfm/vlm/detections.py @@ -211,7 +211,7 @@ def draw_bounding_box( if color is None: # Randomly choose a color from the rainbow colormap (so boxes aren't black) - single_pixel = np.array([[np.random.randint(0, 256)]]) + single_pixel = np.array([[np.random.randint(0, 256)]], dtype=np.uint8) single_pixel = cv2.applyColorMap(single_pixel, cv2.COLORMAP_RAINBOW) # reshape to a single dimensional array