Skip to content

Commit

Permalink
Enable light build at client side (HiroIshida#32)
Browse files Browse the repository at this point in the history
* Enable light build at client side

* Update badge
  • Loading branch information
HiroIshida authored Nov 8, 2022
1 parent ffc3f08 commit 40cd4f5
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 56 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
name: TestDockerBuild
name: run rostest inside docker

on:
schedule:
- cron: '30 1,13 * * *'
- cron: '30 0 * * *'
push:
branches:
- master
paths:
- 'Dockerfile'
pull_request:
branches:
- master
paths:
- 'Dockerfile'

jobs:
docker_build:
Expand All @@ -32,3 +28,6 @@ jobs:
with:
push: false
tags: detic_ros:latest
- name: rostest
run: |
docker run --rm detic_ros:latest /bin/bash -i -c "source ~/.bashrc; rostest detic_ros test_node.test"
33 changes: 0 additions & 33 deletions .github/workflows/rostest.yml

This file was deleted.

10 changes: 3 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
cmake_minimum_required(VERSION 3.0.2)
project(detic_ros)

# Download sample data
add_custom_target(${PROJECT_NAME}_download_image ALL
COMMAND ${PROJECT_SOURCE_DIR}/test/prepare_test_data.sh)

add_custom_target(${PROJECT_NAME}_setup_package ALL
COMMAND cd ${PROJECT_SOURCE_DIR} && ${PROJECT_SOURCE_DIR}/prepare.sh)

find_package(catkin REQUIRED
std_msgs
sensor_msgs
Expand All @@ -31,6 +24,9 @@ generate_messages(
)

if(CATKIN_ENABLE_TESTING)
add_custom_target(${PROJECT_NAME}_download_image ALL
COMMAND ${PROJECT_SOURCE_DIR}/test/prepare_test_data.sh)

find_package(catkin REQUIRED COMPONENTS rostest)
add_rostest(test/test_node.test)
# add_rostest(test/test_batch_processor.test) # somehow fail on workflow but fine on local
Expand Down
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,17 @@ SHELL ["/bin/bash", "-c"]
RUN sudo apt install python3-pip -y
RUN pip3 install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html


# Installing catkin package
RUN mkdir -p ~/detic_ws/src
RUN cd ~/detic_ws/src && git clone https://github.com/HiroIshida/detic_ros.git
RUN cd ~/detic_ws/src/detic_ros && pip3 install -r requirements.txt
COPY --chown=user . /home/user/detic_ws/src/detic_ros
RUN sudo apt install -y wget
RUN cd ~/detic_ws/src/detic_ros && ./prepare.sh
RUN sudo rosdep init && rosdep update
RUN sudo rosdep init && rosdep update && sudo apt update
RUN cd ~/detic_ws/src/detic_ros && source /opt/ros/noetic/setup.bash && rosdep install --from-paths . -i -r -y
RUN cd ~/detic_ws && source /opt/ros/noetic/setup.bash && catkin build
RUN cd ~/detic_ws/src/detic_ros && ./prepare.sh
RUN cd ~/detic_ws &&\
source /opt/ros/noetic/setup.bash &&\
catkin build

RUN touch ~/.bashrc
RUN echo "source ~/detic_ws/devel/setup.bash" >> ~/.bashrc
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## detic_ros [![rostest](https://github.com/HiroIshida/detic_ros/actions/workflows/rostest.yml/badge.svg)](https://github.com/HiroIshida/detic_ros/actions/workflows/rostest.yml) [![docker](https://github.com/HiroIshida/detic_ros/actions/workflows/docker_build.yml/badge.svg)](https://github.com/HiroIshida/detic_ros/actions/workflows/docker_build.yml)
## detic_ros [![rostest](https://github.com/HiroIshida/detic_ros/actions/workflows/docker_build.yml/badge.svg)](https://github.com/HiroIshida/detic_ros/actions/workflows/docker_build.yml)

ROS package for [Detic](https://github.com/facebookresearch/Detic). Run on both CPU and GPU, GPU is way performant, but work fine also with CPU (take few seconds to process single image).

Expand Down
8 changes: 4 additions & 4 deletions prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ if [ ! -d "models" ]; then
# https://github.com/facebookresearch/Detic/blob/main/docs/MODEL_ZOO.md#real-time-models

# Swin Transformer model
wget https://dl.fbaipublicfiles.com/detic/Detic_LCOCOI21k_CLIP_SwinB_896b32_4x_ft4x_max-size.pth -O models/Detic_LCOCOI21k_CLIP_SwinB_896b32_4x_ft4x_max-size.pth
wget -q https://dl.fbaipublicfiles.com/detic/Detic_LCOCOI21k_CLIP_SwinB_896b32_4x_ft4x_max-size.pth -O models/Detic_LCOCOI21k_CLIP_SwinB_896b32_4x_ft4x_max-size.pth
# ConvNet model
wget https://dl.fbaipublicfiles.com/detic/Detic_LCOCOI21k_CLIP_CXT21k_640b32_4x_ft4x_max-size.pth -O models/Detic_LCOCOI21k_CLIP_CXT21k_640b32_4x_ft4x_max-size.pth
wget -q https://dl.fbaipublicfiles.com/detic/Detic_LCOCOI21k_CLIP_CXT21k_640b32_4x_ft4x_max-size.pth -O models/Detic_LCOCOI21k_CLIP_CXT21k_640b32_4x_ft4x_max-size.pth
# Res50 model
wget https://dl.fbaipublicfiles.com/detic/Detic_LCOCOI21k_CLIP_R5021k_640b32_4x_ft4x_max-size.pth -O models/Detic_LCOCOI21k_CLIP_R5021k_640b32_4x_ft4x_max-size.pth
wget -q https://dl.fbaipublicfiles.com/detic/Detic_LCOCOI21k_CLIP_R5021k_640b32_4x_ft4x_max-size.pth -O models/Detic_LCOCOI21k_CLIP_R5021k_640b32_4x_ft4x_max-size.pth
# Res18 model
wget https://dl.fbaipublicfiles.com/detic/Detic_LCOCOI21k_CLIP_R18_640b32_4x_ft4x_max-size.pth -O models/Detic_LCOCOI21k_CLIP_R18_640b32_4x_ft4x_max-size.pth
wget -q https://dl.fbaipublicfiles.com/detic/Detic_LCOCOI21k_CLIP_R18_640b32_4x_ft4x_max-size.pth -O models/Detic_LCOCOI21k_CLIP_R18_640b32_4x_ft4x_max-size.pth
fi

pip3 install -r requirements.txt

0 comments on commit 40cd4f5

Please sign in to comment.