|
1 | | -# MACOW |
2 | | -MACOW: Maritime Collision Warning System |
| 1 | +<table align="center"> |
| 2 | + <tr> |
| 3 | + <td> |
| 4 | + <img src="docs/imgs/logo.png" alt="MACOW Logo" height="80"> |
| 5 | + </td> |
| 6 | + <td> |
| 7 | + <h2><strong>MACOW: Maritime Collision Warning System</strong></h2> |
| 8 | + <em>AI-powered visual detection system for maritime</em> |
| 9 | + </td> |
| 10 | + </tr> |
| 11 | +</table> |
| 12 | + |
| 13 | +<p align="center"> |
| 14 | + <img src="docs/imgs/demo.gif" alt="Demo GIF"> |
| 15 | +</p> |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | +## Installation |
| 21 | + |
| 22 | +### Prerequisites |
| 23 | +- Python 3.12+ |
| 24 | +- pip3 (Python package installer) |
| 25 | +- *(Optional)* CUDA-enabled GPU |
| 26 | + |
| 27 | +### Setup |
| 28 | + |
| 29 | +1. **Clone the repository** |
| 30 | + ```bash |
| 31 | + git clone https://github.com/eadali/MACOW.git |
| 32 | + cd MACOW |
| 33 | + ``` |
| 34 | + |
| 35 | +2. **(Recommended) Create a virtual environment** |
| 36 | + ```bash |
| 37 | + python3 -m venv macow |
| 38 | + source macow/bin/activate |
| 39 | + ``` |
| 40 | + |
| 41 | +3. **Install dependencies** |
| 42 | + - **CPU only:** |
| 43 | + ```bash |
| 44 | + pip3 install -r requirements.txt |
| 45 | + ``` |
| 46 | + - **GPU (CUDA) support:** |
| 47 | + ```bash |
| 48 | + pip3 install -r requirements-cuda.txt |
| 49 | + ``` |
| 50 | + |
| 51 | +4. **Verify installation** |
| 52 | + ```bash |
| 53 | + python3 -c "import torch; print(torch.cuda.is_available())" |
| 54 | + ``` |
| 55 | + |
| 56 | +*See `requirements.txt` and `requirements-cuda.txt` for details.* |
| 57 | + |
| 58 | +--- |
| 59 | + |
| 60 | +## Usage |
| 61 | + |
| 62 | +### Running the Script |
| 63 | + |
| 64 | +To process an image, video, or camera stream, use the following commands: |
| 65 | + |
| 66 | +#### Process a video (CPU) |
| 67 | +```bash |
| 68 | +python3 demo.py config/yolo8n-bytetrack-cpu.yaml --onnx-path downloads/yolo8n-416.onnx --video downloads/sea.mp4 |
| 69 | +``` |
| 70 | + |
| 71 | +#### Process a video (CUDA/GPU) |
| 72 | +```bash |
| 73 | +python3 demo.py config/yolo8n-bytetrack-cuda.yaml --onnx-path downloads/yolo8n-416.onnx --video downloads/sea.mp4 |
| 74 | +``` |
| 75 | + |
| 76 | +### Command-Line Arguments |
| 77 | + |
| 78 | +| Argument | Description | Required/Default | |
| 79 | +|---------------|------------------------------------------|------------------| |
| 80 | +| config | Path to the YAML configuration file | Required | |
| 81 | +| --onnx-path | Path to the ONNX model file | Required | |
| 82 | +| --image | Path to the input image file | Mutually exclusive with --video/--camid | |
| 83 | +| --video | Path to the input video file | Mutually exclusive with --image/--camid | |
| 84 | +| --camid | Camera ID for video capture | Mutually exclusive with --image/--video | |
| 85 | + |
| 86 | +**Note:** |
| 87 | +- You must provide exactly one of `--image`, `--video`, or `--camid`. |
| 88 | +- The `config` argument is a positional argument (no `--config`). |
| 89 | + |
| 90 | +--- |
| 91 | + |
| 92 | +## Acknowledgements |
| 93 | + |
| 94 | +Special thanks to the [kaganbozali](https://github.com/kaganbozali) for providing the YOLO model used in this project. |
0 commit comments