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

Fix dataset path #59

Merged
merged 2 commits into from
Sep 23, 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
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,19 @@ Testing profiles are:

## Build the images

> TODO (#16): run `export DATASET_PATH=/tmp` and then override it after generating a dataset to bypass this issue.

To build all the docker images:

```bash
docker compose -f docker/docker-compose.yml --profile "*" build
```

> **NOTE:** there will be a warning as follows, we will take care of that environment variable later on.

```bash
WARN[0000] The "DATASET_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "DATASET_NAME" variable is not set. Defaulting to a blank string.
```

## Dataset generation

It generates a dataset with 300 annotated pictures where many scene conditions are randomized such as lighting and object pose.
Expand All @@ -111,7 +117,7 @@ And once it finishes (note the scene does not evolve anymore) check the generate
To train a model you need a NVidia Omniverse synthetic dataset built in the previous step. You first need to set up the following environment variable:

```bash
export DATASET_PATH=$(pwd)/isaac_ws/datasets/YYYYMMDDHHMMSS_out_fruit_sdg
export DATASET_NAME=YYYYMMDDHHMMSS_out_fruit_sdg
```

Then you can run the training using the training profile:
Expand All @@ -126,7 +132,7 @@ After the training ends, a `model.pth` file will be available inside `model`. Ad
docker compose -f docker/docker-compose.yml --profile training_test up
```

This will evaluate every image in the `DATASET_PATH` and generate annotated images in the `model` folder.
This will evaluate every image in the `DATASET_NAME` and generate annotated images in the `model` folder.

## Run

Expand Down
6 changes: 2 additions & 4 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
"-o",
"./model/model.pth"]
volumes:
- ${DATASET_PATH}:/root/training_ws/data
- ../isaac_ws/datasets/${DATASET_NAME}:/root/training_ws/data
- ../model/:/root/training_ws/model
- torch_cache:/root/.cache/torch
deploy:
Expand All @@ -41,7 +41,7 @@ services:
"-o",
"./model"]
volumes:
- ${DATASET_PATH}:/root/training_ws/data
- ../isaac_ws/datasets/${DATASET_NAME}:/root/training_ws/data
- ../model/:/root/training_ws/model
- torch_cache:/root/.cache/torch
deploy:
Expand Down Expand Up @@ -158,7 +158,6 @@ services:
- DISPLAY
- QT_X11_NO_MITSHM=1
- XAUTHORITY=/tmp/.docker.xauth
- LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/isaac-sim/exts/omni.isaac.ros2_bridge/humble/lib
- ROS_DISTRO=humble
- ROS_DOMAIN_ID=0
- RMW_IMPLEMENTATION=rmw_fastrtps_cpp
Expand Down Expand Up @@ -194,7 +193,6 @@ services:
- DISPLAY
- QT_X11_NO_MITSHM=1
- XAUTHORITY=/tmp/.docker.xauth
- LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/isaac-sim/exts/omni.isaac.ros2_bridge/humble/lib
- ROS_DISTRO=humble
- ROS_DOMAIN_ID=0
- RMW_IMPLEMENTATION=rmw_fastrtps_cpp
Expand Down
3 changes: 3 additions & 0 deletions isaac_ws/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

SIM_SCRIPT_PATH="/root/isaac_ws/simulation_ws/scripts/launch_sim.py"
SDG_SCRIPT_PATH="/root/isaac_ws/simulation_ws/scripts/launch_sdg.py"
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/isaac-sim/exts/omni.isaac.ros2_bridge/humble/lib

SCRIPT_PATH=$(case "${MODE}" in
"SIM") echo "${SIM_SCRIPT_PATH}" ;;
Expand All @@ -25,4 +26,6 @@ esac)

cd /isaac-sim

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}

./python.sh ${SCRIPT_PATH}
Loading