https://github.com/ashnair1/manhole-detector
Detect manholes
https://github.com/ashnair1/manhole-detector
Last synced: 7 months ago
JSON representation
Detect manholes
- Host: GitHub
- URL: https://github.com/ashnair1/manhole-detector
- Owner: ashnair1
- Created: 2021-12-11T17:31:37.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-10T08:08:54.000Z (almost 4 years ago)
- Last Synced: 2025-01-28T12:36:34.941Z (9 months ago)
- Language: Python
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Manhole Detector
Simple repo to show how [detectron2](https://github.com/facebookresearch/detectron2) can be used to build, train and test a model.
### Requirements
- torch>=1.8
- detectron2==0.6
- cudatoolkit==10.2### Train
```python
python manhole-detector/train.py
```### Evaluate
```python
python manhole-detector/eval.py --ckpt path/to/checkpoint
```### Inference
```python
python manhole-detector/infer.py -i path/to/img/directory -o path/to/output/directory -c path/to/checkpoint
```### Docker
You can either build the docker image manually or you could get the pre-built docker image
**Build manually**
```
git clone git@github.com:ashnair1/manhole-detector.git
cd manhole_detector/
docker build --build-arg USER_ID=$UID -t manhole:v1 .
```**Pull pre-built image**
```
docker pull ash1995/manhole:v1
```**Mount volumes and run docker container**
Assuming your test folder directory is as follows:
```
.
└── data
├── test
└── test_pred
```
where `test` contains test images and `test_pred` is the directory to save predictions.```
docker run --rm --gpus all -v /path/to/data/:/home/appuser/workspace/data manhole:v1 python manhole_detector/infer.py -i ./data/test -o ./data/test_pred/
```
**Note**: If you're building an image manually, you'll need to explicitly mount your checkpoint folder as well as the pre-built image comes with a checkpoint. Specify an additional volume mount via `-v path/to/output/:/home/appuser/workspace/output`