https://github.com/berkeleyautomation/xray
X-Ray: Mechanical Search for an Occluded Object by Minimizing Support of Learned Occupancy Distributions
https://github.com/berkeleyautomation/xray
Last synced: 3 months ago
JSON representation
X-Ray: Mechanical Search for an Occluded Object by Minimizing Support of Learned Occupancy Distributions
- Host: GitHub
- URL: https://github.com/berkeleyautomation/xray
- Owner: BerkeleyAutomation
- Created: 2019-10-14T21:50:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-25T06:52:28.000Z (over 3 years ago)
- Last Synced: 2025-07-25T07:11:27.003Z (10 months ago)
- Language: Python
- Homepage: http://sites.google.com/berkeley.edu/x-ray
- Size: 133 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.python.org/)
[](https://github.com/psf/black)
# X-Ray: Mechanical Search for an Occluded Object by Minimizing Support of Learned Occupancy Distributions
[[PDF]](https://arxiv.org/pdf/2004.09039.pdf) [[Video]](https://youtu.be/n9leWuXJ6Ko) [[Presentation]](https://youtu.be/NtJdx9H3TD8) [[Website]](http://sites.google.com/berkeley.edu/x-ray)
## Provided Dataset and Pre-trained Model
You can download the provided dataset and a pre-trained model using the scripts `scripts/download_dataset.sh` and `scripts/download_weights.sh`, respectively.
## Local Install
You can install the library with all dependencies using `pip install .` from the root directory of the project.
### Training
You may train a new model on the existing dataset (or on a different dataset):
```shell
python tools/train.py
```
Training configuration is set using the `cfg/train.yaml` file. Command line arguments `--resume` and `--amp` allow for resuming training of an existing model or using automatic mixed precision during training, respectively.
### Benchmarking
You may benchmark an existing model on a dataset:
```
python tools/benchmark.py
```
### Other Scripts
There are several other scripts in the `tools` folder that provide various functionalities for training, testing, or analyzing models or datasets.
- `tools/loss_plots.py` generates plots of metrics tracked during training (e.g., loss, mean IOU, accuracy, and balanced accuracy) and validation.
- `tools/mean_bgr.py` finds the mean BGR values in a training dataset (useful for normalization).
- `tools/test_real.py` provides an example script that reads an image from the camera and plots the image with the predicted occupancy distribution from the model.
## Docker
You can build a docker image for training/benchmarking using the provided dockerfile (e.g.,
`docker build -t xray .` from the root directory). The following commands assume a built docker image named `xray`.
### Example docker training command
```shell
docker run --gpus --rm -v /path/to/cfg:/cfg -v /path/to/dataset:/dataset -v /path/to/models/models:/models xray python3 xray/tools/train.py --config /cfg/train_docker.yaml --amp
```
This command trains a model using AMP and the configuration specified in `train_docker.yaml`. You may also need to adjust the `--shm-size` docker parameter.
### Example docker benchmarking command
```shell
docker run --gpus --rm -v /path/to/cfg:/cfg -v /path/to/dataset:/dataset -v /path/to/models/models:/models -v /path/to/benchmark/output:/benchmark xray python3 xray/tools/benchmark.py --config /cfg/benchmark_docker.yaml
```
This command benchmarks a model using the configuration specified in `benchmark_docker.yaml`. You may also need to adjust the `--shm-size` docker parameter.