Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vision stack implementation #1185

Merged
merged 15 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@
[submodule "mil_common/perception/yolov7-ros"]
path = mil_common/perception/yolov7-ros
url = https://github.com/uf-mil/yolov7-ros.git
[submodule "mil_common/perception/vision_stack"]
path = mil_common/perception/vision_stack
url = https://github.com/uf-mil/vision_stack.git
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env python3
import rospy
from image_geometry import PinholeCameraModel
from mil_ros_tools import (
Image_Subscriber,
)
from vision_stack import ResizeLayer, UnderWaterImageEnhancementLayer, VisionStack

__author__ = "Daniel Parra"


class ObjectDetectionTest:
def __init__(self):
camera = rospy.get_param("~image_topic", "/camera/front/right/image_rect_color")
self.vs = VisionStack(
layers=[
ResizeLayer(960, 608),
UnderWaterImageEnhancementLayer(),
],
)

self.image_sub = Image_Subscriber(camera, self.detection_callback)
self.camera_info = self.image_sub.wait_for_camera_info()
assert self.camera_info is not None
self.cam = PinholeCameraModel()
self.cam.fromCameraInfo(self.camera_info)

def detection_callback(self, msg):
# Create Image from array
self.vs.run(msg, True)


if __name__ == "__main__":
rospy.init_node("vision_pipeline_test")
ObjectDetectionTest()
rospy.spin()
1 change: 1 addition & 0 deletions mil_common/perception/vision_stack
Submodule vision_stack added at c04654
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ uvloop==0.16.0

# Data Science
pandas==1.4.1
numpy==1.22.3
numpy==1.24.4

# Machine Learning
scipy==1.10.0
Expand Down Expand Up @@ -54,3 +54,4 @@ opencv-python==4.6.0.66
seaborn==0.11.2
thop==0.1.1.post2207130030
requests==2.31.0
tensorflow==2.13.1
1 change: 1 addition & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ extend-exclude = [
"NaviGator/simulation/VRX/vrx",
"NaviGator/simulation/VRX/vrx-docker",
"mil_common/perception/yolov7-ros",
"mil_common/perception/vision_stack",
# sub simulation
"SubjuGator/simulation",
# docker contents
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ cmonly() {
alias xbox=startxbox

# PYTHONPATH modifications
export PYTHONPATH="${HOME}/catkin_ws/src/mil/mil_common/axros/axros/src:${PYTHONPATH}"
export PYTHONPATH="${HOME}/catkin_ws/src/mil/mil_common/perception/vision_stack/src:${HOME}/catkin_ws/src/mil/mil_common/axros/axros/src:${PYTHONPATH}"
Loading