Skip to content

Commit

Permalink
add option not to install pytorch in build
Browse files Browse the repository at this point in the history
  • Loading branch information
mqcmd196 committed Feb 5, 2025
1 parent 6615afc commit e213e2b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.0.2)
project(detic_ros)

option(DETIC_ROS_INSTALL_TORCH "Installing the pytorch when building" ON)

find_package(catkin REQUIRED COMPONENTS
catkin_virtualenv
std_msgs
Expand Down Expand Up @@ -66,9 +68,16 @@ catkin_package(
CATKIN_DEPENDS message_runtime
)

if(DETIC_ROS_INSTALL_TORCH)
set(REQUIREMENTS requirements_with_torch.txt)
else()
set(REQUIREMENTS requirements_without_torch.txt)
endif()

catkin_generate_virtualenv(
PYTHON_INTERPRETER python3
CHECK_VENV FALSE
INPUT_REQUIREMENTS ${REQUIREMENTS}
)

file(GLOB PYTHON_SCRIPTS node_script/*.py)
Expand Down
File renamed without changes.
17 changes: 17 additions & 0 deletions requirements_without_torch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-f https://dl.fbaipublicfiles.com/detectron2/wheels/cu111/torch1.9/index.html
detectron2

pillow<10.0.0 # After 10.0.0, following error occurs: AttributeError: module 'PIL.Image' has no attribute 'LINEAR'

# Copied from Detic
opencv-python==4.5.5.62
timm==0.5.4
dataclasses # remove version specification for local install
ftfy==6.0.3
regex==2022.1.18
fasttext==0.9.2
scikit-learn==1.0.2
numpy==1.22.0
lvis==0.5.3
nltk==3.6.7
git+https://github.com/openai/CLIP.git

0 comments on commit e213e2b

Please sign in to comment.